Commit e99eab78 authored by Howard Chu's avatar Howard Chu
Browse files

Use new macros from configure.in to accomodate NT/Mingw32 environment.

See README 1.27 log
parent 5438e045
......@@ -7,7 +7,16 @@
## Makefile Template for Shared Libraries
##
COMPILE = $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c
NT_LTFLAGS = --only-$(LINKAGE)
LTFLAGS = $(@PLAT@_LTFLAGS)
NT_DYN_LT_NO_UNDEF = -no-undefined
LT_NO_UNDEF = $(@PLAT@_@LIB_LINKAGE@_LT_NO_UNDEF)
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) $(EXTRA_DEFS) -c
LTLIBLINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
$(LTVERSION) $(LT_NO_UNDEF)
MKDEPFLAG = -l
.SUFFIXES: .c .o .lo
......@@ -15,17 +24,26 @@ MKDEPFLAG = -l
.c.lo:
$(COMPILE) $<
# DYN_EXT (@DYN_EXT@) describes the extension assoicated with a
# dynamic library, e.g. so, dll
DYN_EXT=@DYN_EXT@
$(LIBRARY): version.lo
$(LTLIBLINK) -rpath $(libdir) -o $@ $(OBJS) version.lo
$(RM) ../$@; \
$(LTLIBLINK) -rpath $(libdir) -o $@ $(OBJS) version.lo $(EXTRA_LIBS)
$(RM) ../$@
(d=`$(PWD)` ; $(LN_S) `$(BASENAME) $$d`/$@ ../$@)
$(RM) ../`$(BASENAME) $@ .la`.a; \
(d=`$(PWD)`; t=`$(BASENAME) $@ .la`.a; $(LN_S) `$(BASENAME) $$d`/.libs/$$t ../$$t)
# If we want our binaries to link dynamically with libldap{,_r} liblber...
# We also symlink the .so.# so we can run the tests without installing
if test "$(LINK_BINS_DYNAMIC)" = "yes"; then \
(d=`$(PWD)`; t=`$(BASENAME) $@ .la`.so; $(LN_S) `$(BASENAME) $$d`/.libs/$$t ../$$t); \
(d=`$(PWD)`; b=`$(BASENAME) $@ .la`; t=`ls $$d/.libs/$$b.so.?`; $(LN_S) `$(BASENAME) $$d`/.libs/`$(BASENAME) $$t` ../`$(BASENAME) $$t`); \
(d=`$(PWD)`; b=`$(BASENAME) $@ .la`; t=`ls $$d/.libs/$$b*.$(DYN_EXT)`; t=`$(BASENAME) $$t`; $(LN_S) `$(BASENAME) $$d`/.libs/$$t ../$$t); \
if test "$(DYN_EXT)" != dll; then \
(d=`$(PWD)`; b=`$(BASENAME) $@ .la`; t=`ls $$d/.libs/$$b.$(DYN_EXT).?`; $(LN_S) `$(BASENAME) $$d`/.libs/`$(BASENAME) $$t` ../`$(BASENAME) $$t`); \
fi \
fi
Makefile: $(top_srcdir)/build/lib-shared.mk
......@@ -25,7 +25,8 @@ clean-common: FORCE
$(RM) $(LIBRARY) ../$(LIBRARY) $(XLIBRARY) \
$(PROGRAMS) $(XPROGRAMS) $(XSRCS) $(XXSRCS) \
*.o *.lo a.out core version.c .libs/* \
../`$(BASENAME) $(LIBRARY) .la`.so*
../`$(BASENAME) $(LIBRARY) .la`.so* \
../`$(BASENAME) $(LIBRARY) .la`*.dll *.exe
depend-common: FORCE
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $(XXSRCS)
......
......@@ -9,8 +9,20 @@
LIBRARY = $(LIBBASE).la
LIBSTAT = lib$(LIBBASE).a
LTFLAGS = --only-$(LINKAGE)
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) $(MODDEFS) -c
LTLIBLINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
$(LTVERSION) $(LT_NO_UNDEF)
MKDEPFLAG = -l
.SUFFIXES: .c .o .lo
.c.lo:
$(COMPILE) $<
all-no lint-no 5lint-no depend-no install-no: FORCE
@echo "run configure with $(BUILD_OPT) to make $(LIBBASE)"
......@@ -20,8 +32,9 @@ version.c: $(OBJS)
$(RM) $@
$(MKVERSION) $(LIBBASE) > $@
$(LIBRARY): version.lo
$(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo $(MODLIBS)
$(LIBRARY): $(MODDEPS) version.lo
$(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo \
$(MODLIBS)
$(LIBSTAT): version.lo
$(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o
......@@ -71,12 +84,5 @@ depend-yes depend-mod: depend-local-lib FORCE
veryclean-local-lib:
veryclean-lib: clean-lib veryclean-local-lib
COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) -c
MKDEPFLAG = -l
.SUFFIXES: .c .o .lo
.c.lo:
$(COMPILE) $<
Makefile: $(top_srcdir)/build/mod.mk
......@@ -10,7 +10,8 @@
all-common: $(PROGRAMS) FORCE
clean-common: FORCE
$(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o *.lo a.out core *.core .libs/*
$(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o *.lo a.out core *.core \
.libs/* *.exe
depend-common: FORCE
$(MKDEP) $(DEFS) $(DEFINES) $(SRCS)
......
......@@ -38,7 +38,7 @@ lint-yes: lint-local-srv FORCE
clean-local-srv:
clean-srv: clean-local-srv FORCE
$(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o a.out core .libs/*
$(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o a.out core .libs/* *.exe
depend-local-srv:
depend-yes: depend-local-srv FORCE
......
......@@ -56,7 +56,6 @@ MKVERSION = $(top_srcdir)/build/mkversion -v "$(VERSION)"
LIBTOOL = @LIBTOOL@
LIBVERSION = 0:0:0
LTVERSION = -version-info $(LIBVERSION)
LTLIBLINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LTVERSION)
LTLINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS)
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
......@@ -179,3 +178,4 @@ Makefile: Makefile.in $(top_srcdir)/build/top.mk
FORCE:
##---------------------------------------------------------------------------
# $OpenLDAP$
PROGRAMS= rp500 fax500 xrpcomp.tmp
UNIX_PRGS = rp500 fax500
EXEPRGS = $(@PLAT@_PRGS)
PROGRAMS = xrpcomp.tmp $(EXEPRGS)
SRCS= main.c faxtotpc.c rp500.c
XSRCS=fax5version.c rpversion.c
......@@ -33,6 +35,11 @@ xrpcomp.tmp: xrpcomp
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 rp500 $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 fax500 $(DESTDIR)$(libexecdir)
$(INSTALL) $(INSTALLFLAGS) -m 755 xrpcomp.tmp $(DESTDIR)$(libexecdir)/xrpcomp
@( \
for prg in $(EXEPRGS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(libexecdir); \
done \
)
$(INSTALL) $(INSTALLFLAGS) -m 755 xrpcomp.tmp \
$(DESTDIR)$(libexecdir)/xrpcomp
......@@ -3,7 +3,9 @@
SRCS= main.c
XSRCS= version.c
OBJS= main.o
PROGRAMS= in.xfingerd
UNIX_PRGS = in.xfingerd
PROGRAMS = $(@PLAT@_PRGS)
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
......@@ -20,4 +22,10 @@ version.c: ${OBJS} ${LDAP_LIBDEPEND}
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 in.xfingerd $(DESTDIR)$(libexecdir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(libexecdir); \
done \
)
......@@ -2,9 +2,12 @@
##
## Makefile for gopher clients
##
PROGRAMS= go500gw go500
UNIX_PRGS= go500gw go500
PROGRAMS = $(@PLAT@_PRGS)
SRCS= go500.c go500gw.c
XSRCS= gwversion.c goversion.c
GOOBJS = go500.o
GWOBJS = go500gw.o
......@@ -31,7 +34,12 @@ gwversion.c: ${GWOBJS} $(LDAP_LIBDEPEND)
install-local: $(PROGRAMS) go500gw.help FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir) $(DESTDIR)$(datadir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500 $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500gw $(DESTDIR)$(libexecdir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(libexecdir); \
done \
)
-$(MV) $(DESTDIR)$(datadir)/go500gw.help $(DESTDIR)$(datadir)/go500gw.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/go500gw.help $(DESTDIR)$(datadir)
# $OpenLDAP$
PROGRAMS= mail500
UNIX_PRGS = mail500
PROGRAMS = $(@PLAT@_PRGS)
SRCS= main.c
XSRCS= version.c
......@@ -21,4 +22,10 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 mail500 $(DESTDIR)$(libexecdir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(libexecdir); \
done \
)
# $OpenLDAP$
PROGRAMS= rcpt500
UNIX_PRGS = rcpt500
PROGRAMS = $(@PLAT@_PRGS)
SRCS= main.c cmds.c help.c query.c
XSRCS= version.c
OBJS= main.o cmds.o help.o query.o
......@@ -21,6 +23,12 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
install-local: $(PROGRAMS) rcpt500.help FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir) $(DESTDIR)$(datadir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 rcpt500 $(DESTDIR)$(libexecdir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(libexecdir); \
done \
)
-$(MV) $(DESTDIR)$(datadir)/rcpt500.help $(DESTDIR)$(datadir)/rcpt500.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/rcpt500.help $(DESTDIR)$(datadir)
......@@ -8,7 +8,10 @@ OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o ldappasswd.o
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldif -lldap -llber -llutil
NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
XLIBS = -llutil -lldif -lldap -llber
XXLIBS = $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
XSRCS = ldsversion.c ldmversion.c lddversion.c ldrversion.c ldpversion.c
......@@ -56,10 +59,12 @@ ldrversion.c: ldapmodrdn.o $(LDAP_LIBDEPEND)
install-local: FORCE
-$(MKDIR) $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapsearch $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodify $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldappasswd $(DESTDIR)$(bindir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(bindir); \
done \
)
$(RM) $(DESTDIR)$(bindir)/ldapadd$(EXEEXT)
$(LN) $(DESTDIR)$(bindir)/ldapmodify$(EXEEXT) $(DESTDIR)$(bindir)/ldapadd$(EXEEXT)
......@@ -11,7 +11,10 @@ PROGRAMS= ud
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldif -lldap -llber -llutil
NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
XLIBS = -llutil -lldif -lldap -llber
XXLIBS = $(TERMCAP_LIBS) $(SECURITY_LIBS) $(LUTIL_LIBS)
ud : version.o
......@@ -24,4 +27,10 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
install-local: FORCE
-$(MKDIR) $(DESTDIR)$(bindir)
-mv -f $(DESTDIR)$(bindir)/ud $(DESTDIR)$(bindir)/ud-
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ud $(DESTDIR)$(bindir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(bindir); \
done \
)
......@@ -22,6 +22,18 @@ LDAP_LIBDIR= ../../libraries
XLIBS = -llber
XXLIBS =
LINKAGE = @LT_LIB_LINKAGE@
NT_DYN_LIB_DEFS = -DLIBLBER_DECL=dllexport
NT_DYN_TEST_DEFS = -DLIBLBER_DECL=dllimport
# Extras for building the library
EXTRA_DEFS = $(@PLAT@_@LIB_LINKAGE@_LIB_DEFS)
EXTRA_LIBS =
# Only the test programs will pick up these defs.
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_TEST_DEFS)
dtest: $(LIBRARY) dtest.o
$(LTLINK) $(LDFLAGS) -o $@ dtest.o $(LIBS)
etest: $(LIBRARY) etest.o
......
......@@ -31,9 +31,22 @@ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldap -llber
XLIBS = -lldap -llber -llutil
XXLIBS = $(SECURITY_LIBS) $(TLS_LIBS)
LINKAGE = @LT_LIB_LINKAGE@
NT_DYN_LIB_LIBS = -llber $(AC_LIBS)
NT_DYN_LIB_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllexport
NT_DYN_TEST_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
# Extras for building the library
EXTRA_DEFS = $(@PLAT@_@LIB_LINKAGE@_LIB_DEFS)
EXTRA_LIBS = $(@PLAT@_@LIB_LINKAGE@_LIB_LIBS)
# Only the test programs will pick up these defs.
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_TEST_DEFS)
apitest: $(LIBRARY) apitest.o $(LDAP_LIBLBER_DEPEND)
$(LTLINK) $(LDFLAGS) -o $@ apitest.o $(LIBS)
ltest: $(LIBRARY) test.o $(LDAP_LIBLBER_DEPEND)
......
......@@ -35,10 +35,23 @@ LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XDEFS = -DLDAP_R_COMPILE -I$(XXDIR)
XLIBS = -lldap_r -llber
XLIBS = -lldap_r -llber -llutil
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)
LINKAGE = @LT_LIB_LINKAGE@
NT_DYN_LIB_LIBS = -llber $(AC_LIBS)
NT_DYN_LIB_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllexport
NT_DYN_TEST_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
# Extras for building the library
EXTRA_DEFS = $(@PLAT@_@LIB_LINKAGE@_LIB_DEFS)
EXTRA_LIBS = $(@PLAT@_@LIB_LINKAGE@_LIB_LIBS)
# Only the test programs will pick up these defs.
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_TEST_DEFS)
.links :
@for i in $(XXSRCS); do \
$(RM) $$i ; \
......
......@@ -4,12 +4,31 @@
##
LIBRARY = liblutil.a
SRCS = base64.c debug.c detach.c entropy.c \
md5.c passwd.c sha1.c getpass.c lockf.c utils.c sockpair.c
OBJS = base64.o debug.o detach.o entropy.o \
NT_SRCS = nt_err.c ntservice.c
NT_OBJS = nt_err.o ntservice.o slapdmsg.res
UNIX_SRCS = detach.c
UNIX_OBJS = detach.o
SRCS = base64.c debug.c entropy.c \
md5.c passwd.c sha1.c getpass.c lockf.c utils.c sockpair.c \
@LIBSRCS@ $(@PLAT@_SRCS)
OBJS = base64.o debug.o entropy.o \
md5.o passwd.o sha1.o getpass.o lockf.o utils.o sockpair.o \
@LIBOBJS@
@LIBOBJS@ $(@PLAT@_OBJS)
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
# These rules are for a Mingw32 build, specifically.
# It's ok for them to be here because the clean rule is harmless, and
# slapdmsg.res won't get built unless it's declared in OBJS.
slapdmsg.res: slapdmsg.rc slapdmsg.bin
windres $< -O coff -o $@
clean-local:
$(RM) *.res
......@@ -3,7 +3,9 @@
## Makefile.in for slurpd
##
PROGRAMS = slurpd
UNIX_PRGS = slurpd
PROGRAMS = $(@PLAT@_PRGS)
XPROGRAMS = sslurpd
XSRCS = version.c
......@@ -21,7 +23,7 @@ LDAP_LIBDIR= ../../libraries
BUILD_OPT = "--enable-slurpd"
BUILD_SRV = @BUILD_SLURPD@
all-local-srv: slurpd
all-local-srv: $(PROGRAMS)
# $(LTHREAD_LIBS) must be last!
XLIBS = -lldif -lldap_r -llber -llutil
......@@ -41,4 +43,10 @@ version.c: $(OBJS) $(LDAP_LIBDEPEND) $(LDAP_LIBTHREAD_DEPEND)
install-local-srv: FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 slurpd $(DESTDIR)$(libexecdir)
@( \
for prg in $(PROGRAMS); do \
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT) \
$(DESTDIR)$(libexecdir); \
done \
)
......@@ -4,7 +4,9 @@
##
## tests Makefile.in for OpenLDAP
PROGRAMS = slapd-tester slapd-search slapd-read slapd-addel
UNIX_PRGS = slapd-tester slapd-search slapd-read slapd-addel
PROGRAMS = $(@PLAT@_PRGS)
SRCS = slapd-tester.c slapd-search.c slapd-read.c slapd-addel.c
LDAP_INCDIR= ../../include
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment