Update libtool usage

s/-L.../libraries -lldap/.../libraries/libldap/libldap.la/
This commit is contained in:
Kurt Zeilenga 2002-02-10 22:42:51 +00:00
parent 93af86ec6f
commit ce07fb958e
20 changed files with 71 additions and 106 deletions

View File

@ -14,40 +14,8 @@ MKDEPFLAG = -l
.c.lo:
$(LTCOMPILE_LIB) $<
#
# symlinks for libraries: UNIX and Windows (a.k.a. NT) need to be handled
# differently. In UNIX, the static and shared libraries, as well as shared
# library symlinks, can all be symlinked in the 'libraries' directory. In
# Windows, only the static library (.a file) or the shared library (.dll)
# file should be present. The current mingw linker (i.e. ld) WILL look
# for a .dll file at link time and internally generate an import library
# for it. However, ld will not do this if a static library is present.
# That doesn't seem very correct, but that's the behavior, like it or not.
#
# Note that there doesn't seem to be a true need for the .la file at
# this level, so it is left out.
#
# The set of symlinks are determined by examining the library's .la file.
#
$(LIBRARY): version.lo
$(LTLINK_LIB) -o $@ $(OBJS) version.lo $(LINK_LIBS)
@d=`$(PWD)`; b=`$(BASENAME) $$d`; \
echo cd ..; \
cd ..; \
arlib=`grep '^old_library=' $$b/$@`; \
arlib=`expr "$$arlib" : "[^']*'\(.*\)'"`; \
libs=$$arlib; \
if test "$(BUILD_LIBS_DYNAMIC)" = "shared"; then \
shlibs=`grep '^library_names' $$b/$@`; \
shlibs=`expr "$$shlibs" : "[^']*'\(.*\)'"`; \
libs="$$libs $$shlibs"; \
fi; \
for i in $$libs; do \
echo $(RM) $$i; \
$(RM) $$i; \
echo $(LN_S) $$b/.libs/$$i $$i; \
$(LN_S) $$b/.libs/$$i $$i; \
done
Makefile: $(top_srcdir)/build/lib-shared.mk

View File

@ -9,8 +9,6 @@
$(LIBRARY): version.o
$(AR) ru $@ $(OBJS) version.o
@$(RANLIB) $@; \
$(RM) ../$@; \
(d=`$(PWD)` ; cd .. ; $(LN_S) `$(BASENAME) $$d`/$@ $@)
@$(RANLIB) $@
Makefile: $(top_srcdir)/build/lib-static.mk

View File

@ -91,7 +91,7 @@ LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD)
LINK_LIBS = $(@PLAT@_LINK_LIBS)
LTLINK = $(LIBTOOL) --mode=link \
$(CC) $(LT_CFLAGS) -static $(LDFLAGS) $(LTFLAGS)
$(CC) -static $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS)
LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=compile \
$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
@ -106,6 +106,7 @@ LTLINK_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=link \
$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_MOD)
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
LTFINISH = $(LIBTOOL) --mode=finish
# Misc UNIX commands used in build environment
AR = @AR@
@ -139,27 +140,31 @@ MANCOMPRESSSUFFIX=
INCLUDEDIR= $(top_srcdir)/include
LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
LDAP_LIBADIR= $(top_builddir)/libraries
LDAP_LIBPATH= -L$(LDAP_LIBADIR)/libldap -L$(LDAP_LIBADIR)/liblber -L$(LDAP_LIBADIR)
LDAP_LIBDIR= $(top_builddir)/libraries
LUTIL_LIBS = @LUTIL_LIBS@
LDIF_LIBS = @LDIF_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
LDAP_LIBLDIF_DEPEND = $(LDAP_LIBDIR)/libldif/libldif.a
LDAP_LIBLUTIL_DEPEND = $(LDAP_LIBDIR)/liblutil/liblutil.a
LDAP_LIBLBER_LA = $(LDAP_LIBDIR)/liblber/liblber.la
LDAP_LIBLDAP_LA = $(LDAP_LIBDIR)/libldap/libldap.la
LDAP_LIBLDAP_R_LA = $(LDAP_LIBDIR)/libldap_r/libldap_r.la
LDAP_LIBAVL_DEPEND = $(LDAP_LIBDIR)/libavl/libavl.a
LDAP_LIBLDBM_DEPEND = $(LDAP_LIBDIR)/libldbm/libldbm.a
LDAP_LIBLTHREAD_DEPEND = $(LDAP_LIBDIR)/libldap_r/libldap_r.la
LDAP_LIBAVL_A = $(LDAP_LIBDIR)/libavl/libavl.a
LDAP_LIBLDBM_A = $(LDAP_LIBDIR)/libldbm/libldbm.a
LDAP_LIBLDIF_A = $(LDAP_LIBDIR)/libldif/libldif.a
LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a
LDAP_LIBDEPEND = $(LDAP_LIBLDAP_DEPEND) $(LDAP_LIBLBER_DEPEND) \
$(LDAP_LIBLDIF_DEPEND) $(LDAP_LIBLUTIL_DEPEND)
SLAPD_LIBDEPEND = $(LDAP_LIBDEPEND) $(LDAP_LIBAVL_DEPEND) \
$(LDAP_LIBLDBM_DEPEND) $(LDAP_LIBLTHREAD_DEPEND)
LDAP_L = $(LDAP_LIBLUTIL_A) $(LDAP_LIBLDIF_A) \
$(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
SLURPD_L = $(LDAP_LIBLDIF_A) $(LDAP_LIBLUTIL_A) \
$(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
SLAPD_L = $(LDAP_LIBAVL_A) $(LDAP_LIBLDBM_A) \
$(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
$(SLURPD_L)
WRAP_LIBS = @WRAP_LIBS@
# AutoConfig generated

View File

@ -10,13 +10,13 @@ PROGRAMS = $(@PLAT@_PRGS)
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldap -llber -llutil
XLIBS = $(LDAP_L)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
in.xfingerd : version.o
$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
version.c: ${OBJS} ${LDAP_LIBDEPEND}
version.c: $(OBJS) $(XLIBS)
@-$(RM) $@
$(MKVERSION) in.xfingerd > $@

View File

@ -10,13 +10,13 @@ OBJS= main.o
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldap -llber -llutil
XLIBS = $(LDAP_L)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
mail500 : version.o
$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
version.c: ${OBJS} $(LDAP_LIBDEPEND)
version.c: $(OBJS) $(XLIBS)
@-$(RM) $@
$(MKVERSION) mail500 > $@

View File

@ -10,13 +10,13 @@ OBJS= main.o
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldap -llber -llutil
XLIBS = $(LDAP_L)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
maildap : version.o
$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
version.c: ${OBJS} $(LDAP_LIBDEPEND)
version.c: $(OBJS) $(XLIBS)
@-$(RM) $@
$(MKVERSION) maildap > $@

View File

@ -10,7 +10,7 @@ OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o \
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -llutil -lldif -lldap -llber
XLIBS = $(LDAP_LIBLDIF_A) $(LDAP_L)
XXLIBS = $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
XSRCS = ldsversion.c ldmversion.c lddversion.c ldrversion.c \
@ -46,31 +46,31 @@ ldapadd: ldapmodify
$(LN_H) ldapmodify$(EXEEXT) ldapadd$(EXEEXT)
ldsversion.c: ldapsearch.o $(LDAP_LIBDEPEND)
ldsversion.c: ldapsearch.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldapsearch > $@
ldmversion.c: ldapmodify.o $(LDAP_LIBDEPEND)
ldmversion.c: ldapmodify.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldapmodify > $@
lddversion.c: ldapdelete.o $(LDAP_LIBDEPEND)
lddversion.c: ldapdelete.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldapdelete > $@
ldpversion.c: ldappasswd.o $(LDAP_LIBDEPEND)
ldpversion.c: ldappasswd.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldappasswd > $@
ldrversion.c: ldapmodrdn.o $(LDAP_LIBDEPEND)
ldrversion.c: ldapmodrdn.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldapmodrdn > $@
ldwversion.c: ldapwhoami.o $(LDAP_LIBDEPEND)
ldwversion.c: ldapwhoami.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldapwhoami > $@
ldcversion.c: ldapcompare.o $(LDAP_LIBDEPEND)
ldcversion.c: ldapcompare.o $(XLIBS)
@-$(RM) $@
$(MKVERSION) ldapcompare > $@

View File

@ -13,13 +13,13 @@ PROGRAMS = $(@PLAT@_PRGS)
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -llutil -lldif -lldap -llber
XLIBS = $(LDAP_L)
XXLIBS = $(TERMCAP_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
ud : version.o
$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
version.c: ${OBJS} $(LDAP_LIBDEPEND)
version.c: ${OBJS} $(XLIBS)
@-$(RM) $@
$(MKVERSION) -s -c -n Version UserDirectory > $@

View File

@ -350,9 +350,6 @@
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H

View File

@ -14,7 +14,7 @@ LDAP_LIBDIR= ../../libraries
LIBRARY = libavl.a
PROGRAMS = testavl
XLIBS = -lavl -llber
XLIBS = $(LIBRARY) $(LDAP_LIBLBER_LA)
testavl: $(LIBRARY) testavl.o
testavl: $(XLIBS) testavl.o
$(LTLINK) -o $@ testavl.o $(LIBS)

View File

@ -6,7 +6,6 @@
##
LIBRARY = liblber.la
XLIBRARY = ../liblber.a
NT_SRCS = nt_err.c
NT_OBJS = nt_err.lo
@ -24,15 +23,15 @@ PROGRAMS= dtest etest idtest
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -llber
XLIBS = $(LIBRARY)
XXLIBS =
NT_LINK_LIBS = $(AC_LIBS)
dtest: $(LIBRARY) dtest.o
dtest: $(XLIBS) dtest.o
$(LTLINK) -o $@ dtest.o $(LIBS)
etest: $(LIBRARY) etest.o
etest: $(XLIBS) etest.o
$(LTLINK) -o $@ etest.o $(LIBS)
idtest: $(LIBRARY) idtest.o
idtest: $(XLIBS) idtest.o
$(LTLINK) -o $@ idtest.o $(LIBS)
install-local: FORCE

View File

@ -5,7 +5,6 @@
## Makefile.in for LDAP -lldap
##
LIBRARY = libldap.la
XLIBRARY = ../libldap.a
PROGRAMS = apitest dntest ftest ltest
@ -33,17 +32,17 @@ LDAP_LIBDIR= ../../libraries
LIB_DEFS = -DLDAP_LIBRARY
XLIBS = -lldap -llber -llutil
XLIBS = $(LIBRARY) $(LDAP_LIBLBER_LA) $(LDAP_LIBLUTIL_A)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
NT_LINK_LIBS = -llber $(AC_LIBS) $(SECURITY_LIBS)
apitest: $(LIBRARY) apitest.o $(LDAP_LIBLBER_DEPEND)
apitest: $(XLIBS) apitest.o
$(LTLINK) -o $@ apitest.o $(LIBS)
dntest: $(LIBRARY) dntest.o $(LDAP_LIBLBER_DEPEND)
dntest: $(XLIBS) dntest.o
$(LTLINK) -o $@ dntest.o $(LIBS)
ftest: $(LIBRARY) ftest.o $(LDAP_LIBLBER_DEPEND)
ftest: $(XLIBS) ftest.o
$(LTLINK) -o $@ ftest.o $(LIBS)
ltest: $(LIBRARY) test.o $(LDAP_LIBLBER_DEPEND)
ltest: $(XLIBS) test.o
$(LTLINK) -o $@ test.o $(LIBS)
CFFILES=ldap.conf ldapfilter.conf

View File

@ -5,7 +5,6 @@
## Makefile.in for LDAP -lldap
##
LIBRARY = libldap_r.la
XLIBRARY = ../libldap_r.a
PROGRAMS = apitest ltest
@ -41,10 +40,10 @@ LDAP_LIBDIR= ../../libraries
LIB_DEFS = -DLDAP_LIBRARY
XDEFS = -DLDAP_R_COMPILE -I$(XXDIR)
XLIBS = -lldap_r -llber -llutil
XLIBS = $(LIBRARY) $(LDAP_LIBLBER_LA) $(LDAP_LIBLUTIL_A)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)
NT_LINK_LIBS = -llber $(AC_LIBS) $(SECURITY_LIBS)
NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
.links : Makefile
@for i in $(XXSRCS); do \
@ -60,9 +59,9 @@ clean-local: FORCE
depend-common: .links
apitest: $(LIBRARY) apitest.o $(LDAP_LIBLBER_DEPEND)
apitest: $(XLIBS) apitest.o
$(LTLINK) -o $@ apitest.o $(LIBS)
ltest: $(LIBRARY) test.o $(LDAP_LIBLBER_DEPEND)
ltest: $(XLIBS) test.o
$(LTLINK) -o $@ test.o $(LIBS)
install-local: $(CFFILES) FORCE

View File

@ -12,6 +12,6 @@ OBJS = ldbm.o
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldbm -lavl
XLIBS = $(LIBRARY)
XXLIBS = $(LDBM_LIBS)

View File

@ -13,13 +13,13 @@ XXSRCS = ucdata.c ucgendat.c ure.c urestubs.c
SRCS = ucstr.c
OBJS = ucdata.o ure.o urestubs.o ucstr.o
XLIB = -llunicode
XLIB = $(LIBRARY)
PROGRAMS = ucgendat
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
ucgendat: $(LIBRARY) ucgendat.o
ucgendat: $(XLIBS) ucgendat.o
$(LTLINK) -o $@ ucgendat.o $(LIBS)
./ucgendat $(srcdir)/UnicodeData.txt -x $(srcdir)/CompositionExclusions.txt

View File

@ -19,9 +19,10 @@ LDAP_LIBDIR= ../../libraries
LIBRARY = librewrite.a
PROGRAMS = rewrite
XLIBS = -lrewrite -lavl -llutil -lldap_r -llber
XLIBS = $(LIBRARY) $(LDAP_LIBAVL_A) $(LDAP_LIBLUTIL_A) \
$(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
XXLIBS = $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)
rewrite: $(LIBRARY) rewrite.o parse.o
rewrite: $(XLIBS) rewrite.o parse.o
$(LTLINK) -o $@ rewrite.o parse.o $(LIBS)

View File

@ -46,8 +46,7 @@ SLAPD_DYNAMIC_BACKENDS=@SLAPD_DYNAMIC_BACKENDS@
XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
# $(LTHREAD_LIBS) must be last
XLIBS = libbackends.a -lavl @LDBM_LIB@ -lldif -llutil -llunicode -lldap_r -llber
XLIBS = libbackends.a $(SLAPD_L)
XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS)
@ -59,7 +58,7 @@ all-local-srv: all-cffiles
NT_SLAPD_DEPENDS = slapd.exp
NT_SLAPD_OBJECTS = slapd.exp symdummy.o $(OBJS) version.o
UNIX_SLAPD_DEPENDS = libbackends.a version.o
UNIX_SLAPD_DEPENDS = libbackends.a version.o $(SLAP_L)
UNIX_SLAPD_OBJECTS = $(OBJS) version.o
SLAPD_DEPENDS = $(@PLAT@_SLAPD_DEPENDS)

View File

@ -25,7 +25,7 @@ SLAPD_MODULES = @SLAPD_MODULES_LIST@
XDEFS = $(MODULES_CPPFLAGS)
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
XLIBS = -lavl -lldif @LDBM_LIB@ -llutil -llunicode -lldap_r -llber
XLIBS = $(SLAPD_L) $(LDBM_LIBS)
XXLIBS = $(SLAPD_LIBS) \
$(LDBM_LIBS) $(SECURITY_LIBS) \
$(LDIF_LIBS) $(LUTIL_LIBS)
@ -55,16 +55,16 @@ build-progs: $(PROGRAMS)
#
# SLAP Tools
#
slapadd: slapadd.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND)
slapadd: slapadd.o ../libbackends.a $(SLAPOBJS) $(SLAPD_L)
$(LTLINK) -o $@ slapadd.o $(SLAPOBJS) ../libbackends.a $(LIBS)
slapcat: slapcat.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND)
slapcat: slapcat.o ../libbackends.a $(SLAPOBJS) $(SLAPD_L)
$(LTLINK) -o $@ slapcat.o $(SLAPOBJS) ../libbackends.a $(LIBS)
slapindex: slapindex.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND)
slapindex: slapindex.o ../libbackends.a $(SLAPOBJS) $(SLAPD_L)
$(LTLINK) -o $@ slapindex.o $(SLAPOBJS) ../libbackends.a $(LIBS)
slappasswd: slappasswd.o $(SLAPD_LIBDEPEND)
slappasswd: slappasswd.o $(SLAPD_L)
$(LTLINK) -o $@ slappasswd.o $(LIBS)
clean-local: FORCE

View File

@ -28,7 +28,7 @@ BUILD_SRV = @BUILD_SLURPD@
all-local-srv: $(PROGRAMS)
# $(LTHREAD_LIBS) must be last!
XLIBS = -lldif -lldap_r -llber -llutil
XLIBS = $(SLURPD_L)
XXLIBS = $(SLURPD_LIBS) $(SECURITY_LIBS) \
$(LDIF_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)
@ -39,7 +39,7 @@ slurpd: version.o
sslurpd: version.o
$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS)
version.c: $(OBJS) $(LDAP_LIBDEPEND) $(LDAP_LIBTHREAD_DEPEND)
version.c: $(OBJS) $(SLURPD_L)
@-$(RM) $@
$(MKVERSION) slurpd > $@

View File

@ -12,7 +12,7 @@ SRCS = slapd-tester.c slapd-search.c slapd-read.c slapd-addel.c
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -lldap -llber
XLIBS = $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
# build-tools: FORCE
@ -20,16 +20,16 @@ XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
# load-tools: $(PROGRAMS)
slapd-tester: slapd-tester.o
slapd-tester: slapd-tester.o $(XLIBS)
$(LTLINK) -o $@ slapd-tester.o $(LIBS)
slapd-search: slapd-search.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND)
slapd-search: slapd-search.o $(XLIBS)
$(LTLINK) -o $@ slapd-search.o $(LIBS)
slapd-read: slapd-read.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND)
slapd-read: slapd-read.o $(XLIBS)
$(LTLINK) -o $@ slapd-read.o $(LIBS)
slapd-addel: slapd-addel.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND)
slapd-addel: slapd-addel.o $(XLIBS)
$(LTLINK) -o $@ slapd-addel.o $(LIBS)