Commit 28a671d1 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

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.
parent 2a220163
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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) $@
......
......@@ -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)
......
......@@ -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)
......@@ -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)
......
......@@ -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)
......
......@@ -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 \
......
......@@ -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)
......@@ -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)
......@@ -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}|" \
......
......@@ -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@
......
......@@ -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
......
......@@ -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)
......
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