From 28a671d10de22b45cd9007b0953468b5bbd02bc3 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 14 Jan 1999 01:31:43 +0000 Subject: [PATCH] Revamp build system yet again to move all external libraries to end of link. Basic order is: $LDFLAGS internal-libs external-libs $LIBS $LTHREAD_LIBS LTHREAD_LIBS is last as -lpthread (or equiv) must be last on many systems. LIBS is next to last as some user might have put -lpthread (or equiv) in $LIBS. --- build/top.mk | 15 ++++----------- clients/fax500/Makefile.in | 4 ++-- clients/finger/Makefile.in | 4 ++-- clients/gopher/Makefile.in | 4 ++-- clients/mail500/Makefile.in | 4 ++-- clients/rcpt500/Makefile.in | 4 ++-- clients/tools/Makefile.in | 6 +++--- clients/ud/Makefile.in | 4 ++-- libraries/libavl/Makefile.in | 3 ++- libraries/liblber/Makefile.in | 3 ++- libraries/libldap/Makefile.in | 3 ++- libraries/libldap_r/Makefile.in | 3 ++- libraries/libldbm/Makefile.in | 3 ++- libraries/liblthread/Makefile.in | 4 ++-- servers/ldapd/Makefile.in | 7 ++++--- servers/slapd/Makefile.in | 9 +++++---- servers/slapd/tools/Makefile.in | 6 ++++-- servers/slurpd/Makefile.in | 5 +++-- 18 files changed, 47 insertions(+), 44 deletions(-) diff --git a/build/top.mk b/build/top.mk index 2ca2a0524e..a237a36ea9 100644 --- a/build/top.mk +++ b/build/top.mk @@ -85,12 +85,9 @@ LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR) LDAP_LIBADIR= $(top_builddir)/libraries LDAP_LIBPATH= -L$(LDAP_LIBADIR) -LDAP_LIBLBER = -llber -LDAP_LIBLDAP = -lldap -LDAP_LIBLDIF = -lldif -LDAP_LIBLUTIL = -llutil @LUTIL_LIBS@ -LDAP_LIBLDBM = -lldbm @LDBM_LIBS@ -LDAP_LIBLTHREAD = -llthread @LTHREAD_LIBS@ +LUTIL_LIBS = @LUTIL_LIBS@ +LDBM_LIBS = @LDBM_LIBS@ +LTHREAD_LIBS = @LTHREAD_LIBS@ LDAP_LIBLBER_DEPEND = $(LDAP_LIBDIR)/liblber/liblber.la LDAP_LIBLDAP_DEPEND = $(LDAP_LIBDIR)/libldap/libldap.la @@ -99,10 +96,6 @@ LDAP_LIBLUTIL_DEPEND = $(LDAP_LIBDIR)/liblutil/liblutil.a LDAP_LIBLDBM_DEPEND = $(LDAP_LIBDIR)/libldbm/libldbm.a LDAP_LIBLTHREAD_DEPEND = $(LDAP_LIBDIR)/liblthread/liblthread.a -LDAP_LIBS = $(LDAP_LIBPATH) $(LDAP_LIBLDIF) \ - $(LDAP_LIBLDAP) $(LDAP_LIBLBER) \ - $(LDAP_LIBLUTIL) - LDAP_LIBDEPEND = $(LDAP_LIBLDAP_DEPEND) $(LDAP_LIBLBER_DEPEND) \ $(LDAP_LIBLDIF_DEPEND) $(LDAP_LIBLUTIL_DEPEND) @@ -123,7 +116,7 @@ SLURPD_LIBS = @SLURPD_LIBS@ # Our Defaults CC = $(AC_CC) DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES) -LIBS = $(XLIBS) $(AC_LIBS) $(XXLIBS) +LIBS = $(LDAP_LIBPATH) $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS) CFLAGS = $(AC_CFLAGS) $(DEFS) LDFLAGS = $(AC_LDFLAGS) $(XLDFLAGS) diff --git a/clients/fax500/Makefile.in b/clients/fax500/Makefile.in index ba3d600a71..1499ab5a7c 100644 --- a/clients/fax500/Makefile.in +++ b/clients/fax500/Makefile.in @@ -9,8 +9,8 @@ RPOBJS = rp500.o faxtotpc.o LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) +XLIBS = -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) rp500 : rpversion.o $(LTLINK) -o $@ $(RPOBJS) rpversion.o $(LIBS) diff --git a/clients/finger/Makefile.in b/clients/finger/Makefile.in index 78c6e16535..20a1e0334b 100644 --- a/clients/finger/Makefile.in +++ b/clients/finger/Makefile.in @@ -6,8 +6,8 @@ PROGRAMS= in.xfingerd LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) +XLIBS = -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) in.xfingerd : version.o $(LTLINK) -o $@ version.o $(OBJS) $(LIBS) diff --git a/clients/gopher/Makefile.in b/clients/gopher/Makefile.in index f663f0328b..588d958f20 100644 --- a/clients/gopher/Makefile.in +++ b/clients/gopher/Makefile.in @@ -11,8 +11,8 @@ GWOBJS = go500gw.o LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) +XLIBS = -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) go500 : goversion.o $(LTLINK) -o $@ $(GOOBJS) goversion.o $(LIBS) diff --git a/clients/mail500/Makefile.in b/clients/mail500/Makefile.in index da058124bd..0ee8742bfb 100644 --- a/clients/mail500/Makefile.in +++ b/clients/mail500/Makefile.in @@ -7,8 +7,8 @@ OBJS= main.o LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) +XLIBS = -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) mail500 : version.o $(LTLINK) -o $@ version.o $(OBJS) $(LIBS) diff --git a/clients/rcpt500/Makefile.in b/clients/rcpt500/Makefile.in index 8a7edd87da..d81d5327e3 100644 --- a/clients/rcpt500/Makefile.in +++ b/clients/rcpt500/Makefile.in @@ -7,8 +7,8 @@ HDRS= rcpt500.h LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) +XLIBS = -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) rcpt500 : version.o $(LTLINK) -o $@ version.o $(OBJS) $(LIBS) diff --git a/clients/tools/Makefile.in b/clients/tools/Makefile.in index 8c2624c4f0..e5a01c0365 100644 --- a/clients/tools/Makefile.in +++ b/clients/tools/Makefile.in @@ -7,8 +7,8 @@ OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o ldappasswd.o LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) +XLIBS = -lldif -lldap -llber -llutil +XXLIBS = $(KRB_LIBS) $(LUTIL_LIBS) XSRCS = ldsversion.c ldmversion.c lddversion.c ldrversion.c @@ -27,7 +27,7 @@ ldapmodrdn: ldrversion.o $(LTLINK) -o $@ ldapmodrdn.o ldrversion.o $(LIBS) ldappasswd: ldappasswd.o - $(LTLINK) -o $@ ldappasswd.o $(LUTIL_LIBS) $(LIBS) + $(LTLINK) -o $@ ldappasswd.o $(LIBS) ldapadd: ldapmodify $(RM) $@ diff --git a/clients/ud/Makefile.in b/clients/ud/Makefile.in index 3e2fdcb233..a6b94a0ae4 100644 --- a/clients/ud/Makefile.in +++ b/clients/ud/Makefile.in @@ -9,8 +9,8 @@ PROGRAMS= ud LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LDAP_LIBS) -XXLIBS = $(TERMCAP_LIBS) $(KRB_LIBS) +XLIBS = -lldif -lldap -llber -llutil +XXLIBS = $(TERMCAP_LIBS) $(KRB_LIBS) $(LUTIL_LIBS) ud : version.o $(LTLINK) -o $@ version.o $(OBJS) $(LIBS) diff --git a/libraries/libavl/Makefile.in b/libraries/libavl/Makefile.in index f6cd83d530..893c780639 100644 --- a/libraries/libavl/Makefile.in +++ b/libraries/libavl/Makefile.in @@ -11,6 +11,7 @@ LDAP_LIBDIR= ../../libraries LIBRARY = libavl.a PROGRAMS = testavl +XLIBS = -lavl testavl: $(LIBRARY) testavl.o - $(LTLINK) $(LDFLAGS) -o $@ testavl.o $(LDAP_LIBPATH) -lavl $(LIBS) + $(LTLINK) $(LDFLAGS) -o $@ testavl.o $(LIBS) diff --git a/libraries/liblber/Makefile.in b/libraries/liblber/Makefile.in index 7bad9f2eda..ef1f8a02c9 100644 --- a/libraries/liblber/Makefile.in +++ b/libraries/liblber/Makefile.in @@ -16,7 +16,8 @@ PROGRAMS= dtest etest idtest LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XXLIBS = $(LDAP_LIBPATH) $(LDAP_LIBLBER) +XLIBS = -llber +XXLIBS = dtest: $(LIBRARY) dtest.o $(LTLINK) $(LDFLAGS) -o $@ dtest.o $(LIBS) diff --git a/libraries/libldap/Makefile.in b/libraries/libldap/Makefile.in index 1747fc7cdc..c1ae6a27af 100644 --- a/libraries/libldap/Makefile.in +++ b/libraries/libldap/Makefile.in @@ -28,7 +28,8 @@ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \ LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XXLIBS = $(LDAP_LIBPATH) $(LDAP_LIBLDAP) $(LDAP_LIBLBER) +XLIBS = -lldap -llber +XXLIBS = apitest: $(LIBRARY) apitest.o $(LDAP_LIBLBER_DEPEND) $(LTLINK) $(LDFLAGS) -o $@ apitest.o $(LIBS) diff --git a/libraries/libldap_r/Makefile.in b/libraries/libldap_r/Makefile.in index cb28f83d41..044805a25b 100644 --- a/libraries/libldap_r/Makefile.in +++ b/libraries/libldap_r/Makefile.in @@ -27,7 +27,8 @@ LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries XDEFS = -DLDAP_R_COMPILE -I$(XXDIR) -XXLIBS = $(LDAP_LIBPATH) $(LDAP_LIBLDAP) $(LDAP_LIBLBER) +XLIBS = -lldap_r -llber +XXLIBS = .links : FORCE @for i in $(XXSRCS); do \ diff --git a/libraries/libldbm/Makefile.in b/libraries/libldbm/Makefile.in index 2aa551c2bc..c27b26042f 100644 --- a/libraries/libldbm/Makefile.in +++ b/libraries/libldbm/Makefile.in @@ -10,7 +10,8 @@ OBJS = ldbm.o LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XXLIBS = $(LDBM_LIBS) -lavl +XLIBS = -lldbm -lavl +XXLIBS = $(LDBM_LIBS) testldbm: libldbm.a testldbm.o $(CC) $(LDFLAGS) -o $@ testldbm.o $(LIBS) diff --git a/libraries/liblthread/Makefile.in b/libraries/liblthread/Makefile.in index ee31b5f17c..63da618a70 100644 --- a/libraries/liblthread/Makefile.in +++ b/libraries/liblthread/Makefile.in @@ -10,6 +10,6 @@ OBJS = rdwr.o thread.o stack.o LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = $(LTHREAD_LIBS) - +XLIBS = -lthread +XXLIBS = $(LTHREAD_LIBS) diff --git a/servers/ldapd/Makefile.in b/servers/ldapd/Makefile.in index f82c68b3ab..1584054cea 100644 --- a/servers/ldapd/Makefile.in +++ b/servers/ldapd/Makefile.in @@ -18,15 +18,16 @@ LDAP_LIBDIR= ../../libraries BUILD_OPT = "--enable-ldapd" BUILD_SRV = @BUILD_LDAPD@ -XLIBS= $(LDAPD_LIBS) $(KRB_LIBS) $(LUTIL_LIBS) +XLIBS= -llber -llutil +XXLIBS= $(LDAPD_LIBS) $(KRB_LIBS) $(LUTIL_LIBS) ldapd: version.o $(LDLINK) -o $@ $(OBJS) version.o $(LIBS) sldapd: version.o - $(LDLINK) -static -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) -lresolv + $(LDLINK) -static -o $@ $(OBJS) version.o $(LIBS) -version.c: $(OBJS) $(LDAP_LIBDIR)/liblber/liblber.a +version.c: $(OBJS) $(LDAP_LIBLBER_DEPEND) $(RM) $@ (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in index 9766a6d57e..7e84bc69be 100644 --- a/servers/slapd/Makefile.in +++ b/servers/slapd/Makefile.in @@ -22,10 +22,11 @@ OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \ LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -# $(LTHREAD_LIBS) must be last! -XLIBS = libbackends.a $(SLAPD_LIBS) $(LDAP_LIBS) \ - -lavl $(LDAP_LIBLDBM) -XXLIBS = $(KRB_LIBS) $(LDAP_LIBLTHREAD) +# $(LTHREAD_LIBS) must be last +XLIBS = libbackends.a -lavl -lldbm -lldif -lldap -llber -llthread -llutil +XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \ + $(KRB_LIBS) $(LUTIL_LIBS) +XXXLIBS = $(LTHREAD_LIBS) BUILD_OPT = "--enable-slapd" BUILD_SRV = @BUILD_SLAPD@ diff --git a/servers/slapd/tools/Makefile.in b/servers/slapd/tools/Makefile.in index f4725a0dfb..b9fd8e41ce 100644 --- a/servers/slapd/tools/Makefile.in +++ b/servers/slapd/tools/Makefile.in @@ -18,8 +18,10 @@ BUILD_LDBM = @BUILD_LDBM@ LDAP_INCDIR= ../../../include LDAP_LIBDIR= ../../../libraries -XLIBS = $(LDAP_LIBS) $(SLAPD_LIBS) -lavl $(LDAP_LIBLDBM) -XXLIBS = $(KRB_LIBS) $(LDAP_LIBLTHREAD) +XLIBS = -lavl -lldif -lldap -llber -lldbm -llthread -llutil +XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \ + $(LDBM_LIBS) $(KRB_LIBS) $(LUTIL_LIBS) +XXXLIBS = $(LTHREAD_LIBS) PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \ ldif2id2children centipede ldbmtest ldif diff --git a/servers/slurpd/Makefile.in b/servers/slurpd/Makefile.in index f14cc2507e..335ff224d6 100644 --- a/servers/slurpd/Makefile.in +++ b/servers/slurpd/Makefile.in @@ -25,8 +25,9 @@ BUILD_SRV = @BUILD_SLURPD@ all-local-srv: slurpd # $(LTHREAD_LIBS) must be last! -XLIBS = $(SLURPD_LIBS) $(LDAP_LIBS) -XXLIBS = $(KRB_LIBS) $(LDAP_LIBLTHREAD) +XLIBS = -lldif -lldap -llber -llthread -llutil +XXLIBS = $(SLURPD_LIBS) $(KRB_LIBS) $(LUTIL_LIBS) +XXXLIBS = $(LTHREAD_LIBS) slurpd: version.o $(LTLINK) -o $@ $(OBJS) version.o $(LIBS) -- 2.39.5