.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
$(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
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
$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_MOD)
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
+LTFINISH = $(LIBTOOL) --mode=finish
# Misc UNIX commands used in build environment
AR = @AR@
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_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_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_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_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_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
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 > $@
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 > $@
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 > $@
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 \
$(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 > $@
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 > $@
/* 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
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)
##
LIBRARY = liblber.la
-XLIBRARY = ../liblber.a
NT_SRCS = nt_err.c
NT_OBJS = nt_err.lo
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
## Makefile.in for LDAP -lldap
##
LIBRARY = libldap.la
-XLIBRARY = ../libldap.a
PROGRAMS = apitest dntest ftest ltest
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
## Makefile.in for LDAP -lldap
##
LIBRARY = libldap_r.la
-XLIBRARY = ../libldap_r.a
PROGRAMS = apitest ltest
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 \
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
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
-XLIBS = -lldbm -lavl
+XLIBS = $(LIBRARY)
XXLIBS = $(LDBM_LIBS)
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
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)
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)
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)
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)
#
# 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
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)
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 > $@
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
-XLIBS = -lldap -llber
+XLIBS = $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
# build-tools: FORCE
# 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)