1999-09-09 06:52:19 +08:00
|
|
|
# $OpenLDAP$
|
1998-10-25 09:41:42 +08:00
|
|
|
##
|
|
|
|
## Makefile.in for slapd
|
|
|
|
##
|
|
|
|
PROGRAMS=slapd
|
1999-08-09 09:29:27 +08:00
|
|
|
XPROGRAMS=sslapd libbackends.a .backend
|
1998-11-22 14:24:59 +08:00
|
|
|
XSRCS=version.c
|
1999-10-28 15:20:07 +08:00
|
|
|
|
|
|
|
NT_SRCS = nt_svc.c
|
|
|
|
NT_OBJS = nt_svc.o ../../libraries/liblutil/slapdmsg.res
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \
|
|
|
|
attr.c entry.c config.c backend.c result.c operation.c \
|
|
|
|
dn.c compare.c modify.c delete.c modrdn.c ch_malloc.c \
|
|
|
|
value.c ava.c bind.c unbind.c abandon.c filterentry.c \
|
1999-04-03 11:19:07 +08:00
|
|
|
phonetic.c acl.c str2filter.c aclparse.c init.c user.c \
|
1999-11-24 03:00:09 +08:00
|
|
|
repl.c lock.c controls.c extended.c kerberos.c passwd.c \
|
2000-05-25 09:49:21 +08:00
|
|
|
schema.c schema_check.c schema_init.c schema_prep.c \
|
|
|
|
schemaparse.c ad.c at.c mr.c syntax.c oc.c \
|
2000-06-05 06:59:38 +08:00
|
|
|
monitor.c configinfo.c starttls.c index.c \
|
1999-10-28 15:20:07 +08:00
|
|
|
root_dse.c sasl.c module.c suffixalias.c $(@PLAT@_SRCS)
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
|
|
|
|
attr.o entry.o config.o backend.o result.o operation.o \
|
|
|
|
dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o \
|
|
|
|
value.o ava.o bind.o unbind.o abandon.o filterentry.o \
|
1999-04-03 11:19:07 +08:00
|
|
|
phonetic.o acl.o str2filter.o aclparse.o init.o user.o \
|
1999-11-24 03:00:09 +08:00
|
|
|
repl.o lock.o controls.o extended.o kerberos.o passwd.o \
|
2000-05-25 09:49:21 +08:00
|
|
|
schema.o schema_check.o schema_init.o schema_prep.o \
|
|
|
|
schemaparse.o ad.o at.o mr.o syntax.o oc.o \
|
2000-06-05 06:59:38 +08:00
|
|
|
monitor.o configinfo.o starttls.o index.o \
|
1999-10-28 15:20:07 +08:00
|
|
|
root_dse.o sasl.o module.o suffixalias.o $(@PLAT@_OBJS)
|
1998-10-25 09:41:42 +08:00
|
|
|
|
|
|
|
LDAP_INCDIR= ../../include
|
|
|
|
LDAP_LIBDIR= ../../libraries
|
|
|
|
|
1999-08-07 15:58:11 +08:00
|
|
|
SLAP_DIR=
|
|
|
|
SLAPD_MODULES=@SLAPD_MODULES_LIST@
|
2000-03-17 02:54:11 +08:00
|
|
|
|
1999-06-25 01:06:34 +08:00
|
|
|
XDEFS = $(MODULES_CPPFLAGS)
|
1999-08-07 15:58:11 +08:00
|
|
|
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
|
1999-06-25 01:06:34 +08:00
|
|
|
|
1999-01-14 09:31:43 +08:00
|
|
|
# $(LTHREAD_LIBS) must be last
|
1999-10-28 15:20:07 +08:00
|
|
|
XLIBS = libbackends.a -lavl -lldbm -lldif -llutil -lldap_r -llber
|
1999-01-14 09:31:43 +08:00
|
|
|
XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \
|
2000-03-17 02:54:11 +08:00
|
|
|
$(SECURITY_LIBS) \
|
|
|
|
$(LDIF_LIBS) $(LUTIL_LIBS)
|
1999-08-07 15:58:11 +08:00
|
|
|
XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS)
|
1999-01-10 10:25:41 +08:00
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
BUILD_OPT = "--enable-slapd"
|
|
|
|
BUILD_SRV = @BUILD_SLAPD@
|
|
|
|
|
1999-08-10 07:01:31 +08:00
|
|
|
all-local-srv: all-cffiles
|
1998-10-25 09:41:42 +08:00
|
|
|
|
1999-11-28 07:40:08 +08:00
|
|
|
NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
|
1999-10-28 15:20:07 +08:00
|
|
|
|
|
|
|
DEFINES = $(@PLAT@_@LIB_LINKAGE@_DEFS)
|
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
# The tricky part about building slapd in NT is that it will export symbols
|
|
|
|
# like a DLL. The symbols that it exports should be representative of all
|
|
|
|
# of the static symbols that it knows about.
|
1999-10-28 15:20:07 +08:00
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
NT_EXP = slapd.exp
|
|
|
|
NT_IMPLIB = libslapd.a
|
|
|
|
NT_DUMMY = symdummy.o
|
1999-10-28 15:20:07 +08:00
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
# Add extra def targets here
|
|
|
|
EXTRA_DEFS =
|
1999-10-28 15:20:07 +08:00
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
# NT needs this if libltdl is built statically. You'll have to fix the path
|
|
|
|
# to point to where libltdl was built, then put ltdl.def in EXTRA_DEFS
|
|
|
|
ltdl.def: ../../../libtool/libltdl/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ $^
|
1999-10-28 15:20:07 +08:00
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
DYNAMIC_DEFS = liblber.def libldap_r.def
|
|
|
|
|
|
|
|
STATIC_DEFS = libavl.def libldbm.def libldif.def liblutil.def slapd.def \
|
|
|
|
$(EXTRA_DEFS)
|
|
|
|
|
|
|
|
libavl.def: $(LDAP_LIBDIR)/libavl/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
liblber.def: $(LDAP_LIBDIR)/liblber/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
libldap_r.def: $(LDAP_LIBDIR)/libldap_r/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
libldbm.def: $(LDAP_LIBDIR)/libldbm/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
libldif.def: $(LDAP_LIBDIR)/libldif/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
liblutil.def: $(LDAP_LIBDIR)/liblutil/*.o
|
|
|
|
dlltool --export-all-symbols --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
slapd.def: $(OBJS) version.o
|
|
|
|
dlltool --export-all-symbols --exclude-symbols main,ServiceMain@8 --output-def $@ `ls $^ | grep -v test`
|
|
|
|
|
|
|
|
# We don't want to include symbols from dynamic libraries.
|
|
|
|
all.def: $(STATIC_DEFS) $(DYNAMIC_DEFS)
|
|
|
|
cat $(STATIC_DEFS) | grep " @ " | sed -e 's/ @ [0-9]*//' > $@
|
|
|
|
if [ "@LIB_LINKAGE@" != "DYN" ] ; \
|
|
|
|
then \
|
|
|
|
cat $(DYNAMIC_DEFS) | grep " @ " | sed -e 's/ @ [0-9]*//' >> $@; \
|
|
|
|
fi
|
|
|
|
echo EXPORTS > tmp.def
|
|
|
|
sort $@ >> tmp.def
|
|
|
|
rm -f $@
|
|
|
|
dlltool --input-def tmp.def --output-def $@
|
|
|
|
rm -f tmp.def
|
|
|
|
|
|
|
|
DUMMYTMP = symdummytmp.c
|
|
|
|
|
|
|
|
symdummy.c: all.def $(ALL_DEFS)
|
|
|
|
rm -f $@
|
|
|
|
echo "static void never_called() {" > $(DUMMYTMP)
|
|
|
|
cat $< | grep " @ " | while read line; \
|
|
|
|
do \
|
|
|
|
set dummy $$line; \
|
|
|
|
case $$# in \
|
|
|
|
5) \
|
|
|
|
echo "int $$2();" >> $@; \
|
|
|
|
echo "$$2();" >> $(DUMMYTMP); \
|
|
|
|
;; \
|
|
|
|
6) \
|
|
|
|
echo "extern int $$2;" >> $@; \
|
|
|
|
echo "$$2 = 0;" >> $(DUMMYTMP); \
|
|
|
|
;; \
|
|
|
|
esac; \
|
|
|
|
done
|
|
|
|
echo "" >> $@
|
|
|
|
echo "}" >> $(DUMMYTMP)
|
|
|
|
cat $(DUMMYTMP) >> $@
|
|
|
|
rm -f $(DUMMYTMP)
|
|
|
|
|
|
|
|
symdummy.o: symdummy.c
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
|
|
|
SLAPD_OBJS = $(OBJS) version.o symdummy.o
|
|
|
|
|
|
|
|
slapd.exp: libbackends.a all.def $(SLAPD_OBJS)
|
|
|
|
$(LTLINK) -o slapd $(SLAPD_OBJS) $(LIBS) $(WRAP_LIBS) -Wl,--base-file,slapd.base
|
|
|
|
rm -f slapd.exe
|
|
|
|
dlltool --dllname slapd.exe --input-def all.def --base-file slapd.base --output-exp $@
|
|
|
|
$(LTLINK) -o slapd $(SLAPD_OBJS) $(LIBS) $(WRAP_LIBS) $@ -Wl,--base-file,slapd.base
|
|
|
|
rm -f slapd.exe
|
|
|
|
dlltool --dllname slapd.exe --input-def all.def --base-file slapd.base --output-exp $@
|
|
|
|
|
|
|
|
libslapd.a: all.def
|
|
|
|
dlltool --dllname slapd.exe --input-def $< --output-lib $@
|
1999-10-28 15:20:07 +08:00
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
slapd: libbackends.a version.o $(@PLAT@_EXP) $(@PLAT@_DUMMY)
|
|
|
|
$(LTLINK) -o $@ $(@PLAT@_EXP) $(@PLAT@_DUMMY) $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
|
1999-08-07 19:37:43 +08:00
|
|
|
(cd tools; $(MAKE) $(MFLAGS) all)
|
1998-11-22 12:22:28 +08:00
|
|
|
|
1999-07-25 05:40:58 +08:00
|
|
|
sslapd: version.o
|
1999-09-22 23:00:51 +08:00
|
|
|
$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
|
1998-10-25 09:41:42 +08:00
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
.backend: $(@PLAT@_IMPLIB) FORCE
|
1999-07-25 05:40:58 +08:00
|
|
|
@for i in back-*; do \
|
|
|
|
if [ -d $$i ]; then \
|
|
|
|
echo " "; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \
|
|
|
|
( cd $$i; $(MAKE) $(MFLAGS) all ); \
|
|
|
|
fi; \
|
|
|
|
done; \
|
1999-08-07 19:37:43 +08:00
|
|
|
echo " "
|
1999-08-09 09:29:27 +08:00
|
|
|
|
|
|
|
libbackends.a: .backend
|
1998-10-25 09:41:42 +08:00
|
|
|
@$(RM) -r tmp
|
|
|
|
@$(MKDIR) tmp
|
|
|
|
@-for i in back-*/*.a; do \
|
|
|
|
( \
|
|
|
|
cd tmp; \
|
|
|
|
$(AR) x ../$$i; \
|
|
|
|
pre=`echo $$i | sed -e 's/\/.*$$//' -e 's/back-//'`; \
|
|
|
|
for j in *.o; do \
|
|
|
|
mv $$j $${pre}$$j; \
|
|
|
|
done; \
|
|
|
|
$(AR) ruv libbackends.a *.o 2>&1 | grep -v truncated; \
|
|
|
|
$(RM) *.o __.SYMDEF; \
|
|
|
|
echo "added backend library $$i"; \
|
|
|
|
); \
|
|
|
|
done
|
|
|
|
@mv -f tmp/libbackends.a ./libbackends.a
|
|
|
|
@$(RM) -r tmp
|
|
|
|
@if [ ! -z "$(RANLIB)" ]; then \
|
|
|
|
$(RANLIB) libbackends.a; \
|
|
|
|
fi
|
|
|
|
@ls -l libbackends.a
|
|
|
|
|
2000-05-12 04:50:20 +08:00
|
|
|
version.c: $(OBJS) $(SLAPD_LIBDEPEND)
|
1999-04-28 13:40:17 +08:00
|
|
|
@-$(RM) $@
|
1999-04-29 04:39:40 +08:00
|
|
|
$(MKVERSION) -s -n Versionstr slapd > $@
|
1999-07-13 12:13:21 +08:00
|
|
|
|
1998-12-20 08:55:39 +08:00
|
|
|
depend-local-srv: FORCE
|
1998-11-22 14:24:59 +08:00
|
|
|
@for i in back-* shell-backends tools; do \
|
|
|
|
if [ -d $$i ]; then \
|
|
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \
|
|
|
|
( cd $$i; $(MAKE) $(MFLAGS) depend ); \
|
|
|
|
fi; \
|
|
|
|
done
|
1999-10-28 15:20:07 +08:00
|
|
|
@echo ""
|
|
|
|
|
|
|
|
clean-local:
|
2000-05-12 04:50:20 +08:00
|
|
|
rm -f *.exp *.def *.base *.a *.objs symdummy.c
|
1998-11-22 14:24:59 +08:00
|
|
|
|
1998-12-20 08:55:39 +08:00
|
|
|
clean-local-srv: FORCE
|
1998-11-22 14:24:59 +08:00
|
|
|
@for i in back-* shell-backends tools; do \
|
1998-10-25 09:41:42 +08:00
|
|
|
if [ -d $$i ]; then \
|
|
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \
|
|
|
|
( cd $$i; $(MAKE) $(MFLAGS) clean ); \
|
|
|
|
fi; \
|
|
|
|
done
|
1999-03-19 04:36:42 +08:00
|
|
|
rm -f *.tmp all-cffiles
|
1998-10-25 09:41:42 +08:00
|
|
|
|
1999-03-01 01:07:47 +08:00
|
|
|
veryclean-local-srv: FORCE
|
|
|
|
@for i in back-* shell-backends tools; do \
|
|
|
|
if [ -d $$i ]; then \
|
|
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \
|
|
|
|
( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
1999-11-18 05:14:22 +08:00
|
|
|
install-local-srv: install-slapd install-conf install-schema install-tools
|
1998-10-25 09:41:42 +08:00
|
|
|
|
|
|
|
install-slapd: FORCE
|
1999-09-23 05:51:30 +08:00
|
|
|
-$(MKDIR) $(DESTDIR)$(libexecdir)
|
|
|
|
-$(MKDIR) $(DESTDIR)$(localstatedir)
|
2000-05-31 02:23:56 +08:00
|
|
|
$(LTINSTALL) $(INSTALLFLAGS) -s -m 755 \
|
|
|
|
slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
|
1999-08-07 15:58:11 +08:00
|
|
|
@if [ ! -z "$(SLAPD_MODULES)" ]; then \
|
|
|
|
for i in back-* shell-backends tools; do \
|
|
|
|
if [ -d $$i ]; then \
|
|
|
|
echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \
|
|
|
|
( cd $$i; $(MAKE) $(MFLAGS) install ); \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
|
1998-11-30 03:48:28 +08:00
|
|
|
CFFILES=slapd.conf slapd.at.conf slapd.oc.conf
|
|
|
|
|
1999-08-07 19:37:43 +08:00
|
|
|
all-cffiles: slapd
|
1999-03-19 04:36:42 +08:00
|
|
|
@for i in $(CFFILES); do \
|
|
|
|
tmpcf=$$i.tmp; \
|
|
|
|
$(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' \
|
|
|
|
-e 's;%LOCALSTATEDIR%;$(localstatedir);' \
|
2000-04-30 23:01:32 +08:00
|
|
|
-e 's;%MODULEDIR%;$(moduledir);' \
|
1999-03-19 04:36:42 +08:00
|
|
|
$(srcdir)/$$i > $$tmpcf ; \
|
|
|
|
done
|
|
|
|
touch all-cffiles
|
|
|
|
|
1999-11-18 05:14:22 +08:00
|
|
|
install-schema: FORCE
|
|
|
|
@-$(MKDIR) $(DESTDIR)$(sysconfdir)/schema
|
2000-02-13 04:04:45 +08:00
|
|
|
@cd $(srcdir) ; \
|
2000-06-01 23:27:10 +08:00
|
|
|
for i in schema/*.schema ; do \
|
1999-11-18 05:14:22 +08:00
|
|
|
if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
|
|
|
|
echo "installing $$i in $(sysconfdir)"; \
|
2000-06-01 23:27:10 +08:00
|
|
|
echo $(INSTALL) $(INSTALLFLAGS) -m 444 $$i $(DESTDIR)$(sysconfdir)/$$i; \
|
|
|
|
$(INSTALL) $(INSTALLFLAGS) -m 444 $$i $(DESTDIR)$(sysconfdir)/$$i; \
|
1999-11-18 05:14:22 +08:00
|
|
|
else \
|
|
|
|
echo "PRESERVING EXISTING SCHEMA FILE $(DESTDIR)$(sysconfdir)/$$i"; \
|
|
|
|
fi; \
|
|
|
|
$(INSTALL) $(INSTALLFLAGS) $$i $(DESTDIR)$(sysconfdir)/$$i.default ; \
|
|
|
|
done
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
install-conf: FORCE
|
1999-09-23 05:51:30 +08:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(sysconfdir)
|
2000-05-29 13:51:24 +08:00
|
|
|
@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-ldbm
|
1998-11-30 03:48:28 +08:00
|
|
|
@for i in $(CFFILES); do \
|
1999-03-19 04:36:42 +08:00
|
|
|
tmpcf=$$i.tmp ; \
|
1999-01-16 03:57:32 +08:00
|
|
|
if test $$i = slapd.conf ; then \
|
|
|
|
mode=600 ; \
|
|
|
|
else \
|
|
|
|
mode=644 ; \
|
|
|
|
fi ; \
|
1999-09-23 05:51:30 +08:00
|
|
|
if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
|
1998-11-30 03:48:28 +08:00
|
|
|
echo "installing $$i in $(sysconfdir)"; \
|
1999-09-23 05:51:30 +08:00
|
|
|
echo "$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(DESTDIR)$(sysconfdir)/$$i"; \
|
|
|
|
$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(DESTDIR)$(sysconfdir)/$$i; \
|
1998-11-30 03:48:28 +08:00
|
|
|
else \
|
1999-09-23 05:51:30 +08:00
|
|
|
echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/$$i" ; \
|
1998-11-30 03:48:28 +08:00
|
|
|
fi; \
|
1999-09-23 05:51:30 +08:00
|
|
|
$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(DESTDIR)$(sysconfdir)/$$i.default ; \
|
1998-11-30 03:48:28 +08:00
|
|
|
done
|
1998-10-25 09:41:42 +08:00
|
|
|
|
|
|
|
install-tools: FORCE
|
1999-09-23 05:51:30 +08:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(sbindir)
|
1998-10-25 09:41:42 +08:00
|
|
|
(cd tools; $(MAKE) $(MFLAGS) install)
|
1999-07-25 05:40:58 +08:00
|
|
|
|