]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/Makefile.in
fix one-time leak
[openldap] / servers / slapd / Makefile.in
index fcc9a4ce83050225027d316650e06131e27fbda1..510951893c3841f7037998751cd24bdd9e9b9a08 100644 (file)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2007 The OpenLDAP Foundation.
+## Copyright 1998-2012 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -13,7 +13,7 @@
 ## top-level directory of the distribution or, alternatively, at
 ## <http://www.OpenLDAP.org/license.html>.
 
-SLAPTOOLS=slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl
+SLAPTOOLS=slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema
 PROGRAMS=slapd $(SLAPTOOLS)
 XPROGRAMS=sslapd libbackends.a .backend liboverlays.a
 XSRCS=version.c
@@ -38,7 +38,7 @@ SRCS  = main.c globals.c bconfig.c config.c daemon.c \
                backglue.c backover.c ctxcsn.c ldapsync.c frontend.c \
                slapadd.c slapcat.c slapcommon.c slapdn.c slapindex.c \
                slappasswd.c slaptest.c slapauth.c slapacl.c component.c \
-               aci.c alock.c txn.c \
+               aci.c alock.c txn.c slapschema.c \
                $(@PLAT@_SRCS)
 
 OBJS   = main.o globals.o bconfig.o config.o daemon.o \
@@ -56,7 +56,7 @@ OBJS  = main.o globals.o bconfig.o config.o daemon.o \
                backglue.o backover.o ctxcsn.o ldapsync.o frontend.o \
                slapadd.o slapcat.o slapcommon.o slapdn.o slapindex.o \
                slappasswd.o slaptest.o slapauth.o slapacl.o component.o \
-               aci.o alock.o txn.o \
+               aci.o alock.o txn.o slapschema.o \
                $(@PLAT@_OBJS)
 
 LDAP_INCDIR= ../../include -I$(srcdir) -I$(srcdir)/slapi -I.
@@ -138,7 +138,7 @@ SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
 # for functions, but it is required for variables.
 #
 # The symdummy.c file basically references EVERY symbol available to slapd.exe,
-# including symbols that slapd.exe never actually refereneced. The file
+# including symbols that slapd.exe never actually referenced. The file
 # is compiled and included at link time. Without this object file, slapd.exe
 # would NOT export symbols that it never referenced. The reason that these
 # symbols must still be exported is because a dynamic module may want to
@@ -155,7 +155,7 @@ SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
 # on its own very long list of dependencies.
 #
 slapd.def: libbackends.a liboverlays.a version.o
-       @for i in $(LDFLAGS) ; do \
+       @for i in XX $(LDFLAGS) ; do \
            path=`expr "$$i" : "-L\(.*\)"`; \
            if test $$? != 0; then continue; fi; \
            paths="$$paths $$path"; \
@@ -167,7 +167,7 @@ slapd.def: libbackends.a liboverlays.a version.o
                -l*) \
                    done="" ;\
                    base=`expr "$$i" : "-l\(.*\)"`; \
-                   for p in $$paths ; do \
+                   for p in $$paths ; do \
                        for ext in la dll dll.a a ; do \
                            path=$$p/lib$$base.$$ext; \
                            test ! -f $$path && continue; \
@@ -259,12 +259,9 @@ slapd.exp: libslapd.a
        dlltool --dllname slapd.exe --input-def slapd.def \
                --base-file slapd.base --output-exp $@
 
-slapi/.libs/libslapi.a: FORCE
+slapi/libslapi.la: FORCE
        (cd slapi; $(MAKE) $(MFLAGS) all)
 
-libslapi.a: slapi/.libs/libslapi.a
-       cp slapi/.libs/libslapi.a .
-
 slapd: $(SLAPD_DEPENDS) @LIBSLAPI@
        $(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \
                $(WRAP_LIBS)
@@ -402,6 +399,10 @@ all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS) dynamic_overlays
                -e "s;%LOCALSTATEDIR%;$$localstatedir;" \
                -e "s;%MODULEDIR%;$$moduledir;" \
                $(srcdir)/slapd.conf > slapd.conf.tmp ; \
+       $(SED) -e "s;%SYSCONFDIR%;$$sysconfdir;" \
+               -e "s;%LOCALSTATEDIR%;$$localstatedir;" \
+               -e "s;%MODULEDIR%;$$moduledir;" \
+               $(srcdir)/slapd.ldif > slapd.ldif.tmp ; \
        touch all-cffiles
 
 install-schema: FORCE
@@ -427,6 +428,14 @@ install-conf: FORCE
        else \
                echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/slapd.conf" ; \
        fi
+       $(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif.default
+       if test ! -f $(DESTDIR)$(sysconfdir)/slapd.ldif; then \
+               echo "installing slapd.ldif in $(sysconfdir)"; \
+               echo "$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif"; \
+               $(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif; \
+       else \
+               echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/slapd.ldif" ; \
+       fi
 
 install-db-config: FORCE
        @-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir)