PROGRAMS=slapd
XPROGRAMS=sslapd libbackends.a .backend
XSRCS=version.c
+
+NT_SRCS = nt_svc.c
+NT_OBJS = nt_svc.o ../../libraries/liblutil/slapdmsg.res
+
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 \
phonetic.c acl.c str2filter.c aclparse.c init.c user.c \
repl.c lock.c controls.c extended.c \
schema.c schemaparse.c monitor.c configinfo.c \
- root_dse.c sasl.c module.c suffixalias.c
+ root_dse.c sasl.c module.c suffixalias.c $(@PLAT@_SRCS)
+
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 \
phonetic.o acl.o str2filter.o aclparse.o init.o user.o \
repl.o lock.o controls.o extended.o \
schema.o schemaparse.o monitor.o configinfo.o \
- root_dse.o sasl.o module.o suffixalias.o
+ root_dse.o sasl.o module.o suffixalias.o $(@PLAT@_OBJS)
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
# $(LTHREAD_LIBS) must be last
-XLIBS = libbackends.a -lavl -lldbm -lldif -lldap_r -llber -llutil
+XLIBS = libbackends.a -lavl -lldbm -lldif -llutil -lldap_r -llber
XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \
$(SLAPD_PERL_LDFLAGS) $(SECURITY_LIBS) \
$(LDIF_LIBS) $(LUTIL_LIBS)
all-local-srv: all-cffiles
-slapd: libbackends.a version.o
- $(LTLINK) -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
+NT_GEN_DEFS = -DLIBLUTIL_DECL=dllexport -DLIBAVL_DECL=dllexport \
+ -DLIBLDBM_DECL=dllexport -DLIBLDIF_DECL=dllexport
+
+NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport $(NT_GEN_DEFS)
+NT_STAT_DEFS = -DLIBLBER_DECL=dllexport -DLIBLDAP_DECL=dllexport $(NT_GEN_DEFS)
+
+DEFINES = $(@PLAT@_@LIB_LINKAGE@_DEFS)
+
+slapd.def: slapd.syms
+ ( \
+ echo EXPORTS > $@; \
+ _hint=1; \
+ for symbol in `cat $<`; do \
+ echo " $$symbol @ $$_hint ; " >> $@; \
+ _hint=`expr 1 + $$_hint`; \
+ done \
+ )
+
+slapd.base: version.o
+ $(LTLINK) -o slapd $(OBJS) version.o $(LIBS) $(WRAP_LIBS) \
+ -Wl,--base-file,$@
+ rm -f slapd
+
+slapd.exp: slapd.def slapd.base
+ dlltool --dllname slapd.exe --def slapd.def --base-file slapd.base \
+ --output-exp $@
+
+libslapd.a: slapd.def
+ dlltool --dllname slapd.exe --def $< --output-lib $@
+
+NT_EXP = slapd.exp
+NT_IMP_LIB = libslapd.a
+
+slapd: $(@PLAT@_IMP_LIB) libbackends.a version.o $(@PLAT@_EXP)
+ $(LTLINK) -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS) $(@PLAT@_EXP)
(cd tools; $(MAKE) $(MFLAGS) all)
sslapd: version.o
( cd $$i; $(MAKE) $(MFLAGS) depend ); \
fi; \
done
+ @echo ""
+
+clean-local:
+ rm -f *.exp *.def *.base *.a
clean-local-srv: FORCE
@for i in back-* shell-backends tools; do \
install-slapd: FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir)
-$(MKDIR) $(DESTDIR)$(localstatedir)
- $(LTINSTALL) $(INSTALLFLAGS) -m 755 slapd $(DESTDIR)$(libexecdir)
+ $(LTINSTALL) $(INSTALLFLAGS) -m 755 slapd$(EXEEXT) \
+ $(DESTDIR)$(libexecdir)
@if [ ! -z "$(SLAPD_MODULES)" ]; then \
for i in back-* shell-backends tools; do \
if [ -d $$i ]; then \
XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
-XLIBS = -lavl -lldif -lldbm -lldap_r -llber -llutil
+XLIBS = -lavl -lldif -lldbm -llutil -lldap_r -llber
XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
$(PERL_LDFLAGS) $(LDBM_LIBS) $(SECURITY_LIBS) \
$(LDIF_LIBS) $(LUTIL_LIBS)
BDB2PROGRAMS=
QUIPUPROGRAMS=chlog2replog edb2ldif
+# CPPFLAGS will include the defines for dynamic libs in Mingw32.
+NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
+CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
+
SRCS = ldif.c mimic.c slapcommon.c
XSRCS = edb2-vers.c
EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o
-all-local: build-progs build-ldbm build-bdb2 build-quipu
+UNIX_PRGS = build-ldbm build-bdb2 build-quipu
+
+all-local: build-progs $(@PLAT@_PRGS)
build-progs: $(PROGRAMS)
clean-local: FORCE
$(RM) $(PROGRAMS) $(LDBMPROGRAMS) $(BDB2PROGRAMS) $(QUIPUPROGRAMS) \
- $(XPROGRAMS) $(XSRCS) *.o core .libs/*
+ $(XPROGRAMS) $(XSRCS) *.o core .libs/* *.exe
depend-local: FORCE
- @DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_QUIPU= ; \
+ DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_QUIPU= ; \
if [ "$(BUILD_LDBM)" != "no" ]; then \
DEPEND_LDBM="$(LDBMSRCS)"; \
fi; \
install-ldbm-yes install-ldbm-mod: FORCE
-$(MKDIR) $(DESTDIR)$(sbindir)
- for bin in slapadd slapcat slapindex centipede ldif; do \
- $(LTINSTALL) $(INSTALLFLAGS) -m 755 $$bin $(DESTDIR)$(sbindir); \
+ @for bin in $(PROGRAMS); do \
+ $(LTINSTALL) $(INSTALLFLAGS) -m 755 $$bin$(EXEEXT) \
+ $(DESTDIR)$(sbindir); \
done
install-bdb2-yes install-bdb2-mod: FORCE