From: Ben Collins Date: Wed, 29 Sep 1999 00:56:43 +0000 (+0000) Subject: * configure.in: add --enable-dynamic option for linking our local binaries X-Git-Tag: UCDATA_2_4~362 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7dd47c4cbbe26ddc077640432406477d5cfdbf2;p=thirdparty%2Fopenldap.git * configure.in: add --enable-dynamic option for linking our local binaries with the shared libraries instead of static, defaults to no * build/lib-shared.mk: if LINK_BINS_DYNAMIC is set we create a symlink to the .so and .so.# file along with the .a and .la files * build/lib.mk: make sure the above links get removed on clean target * build/top.mk: add define for LINK_BINS_DYNAMIC * tests/scripts/defines.sh: add export for LD_LIBRARY_PATH so that tests will run without requiring installation of libraries when we use --enable-dynamic (LD_LIBRARY_PATH is always set, since it can't really hurt). --- diff --git a/build/lib-shared.mk b/build/lib-shared.mk index 776972ac6d..69a37e50ae 100644 --- a/build/lib-shared.mk +++ b/build/lib-shared.mk @@ -21,5 +21,11 @@ $(LIBRARY): version.lo (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`); \ + fi Makefile: $(top_srcdir)/build/lib-shared.mk diff --git a/build/lib.mk b/build/lib.mk index 9bf542d340..76fb1000e4 100644 --- a/build/lib.mk +++ b/build/lib.mk @@ -24,7 +24,8 @@ lint5: lint5-local FORCE clean-common: FORCE $(RM) $(LIBRARY) ../$(LIBRARY) $(XLIBRARY) \ $(PROGRAMS) $(XPROGRAMS) $(XSRCS) $(XXSRCS) \ - *.o *.lo a.out core version.c .libs/* + *.o *.lo a.out core version.c .libs/* \ + ../`$(BASENAME) $(LIBRARY) .la`.so* depend-common: FORCE $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $(XXSRCS) diff --git a/build/top.mk b/build/top.mk index bbd6b32051..8f6f92efdd 100644 --- a/build/top.mk +++ b/build/top.mk @@ -132,6 +132,7 @@ MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@ MODULES_LIBS = @MODULES_LIBS@ TERMCAP_LIBS = @TERMCAP_LIBS@ SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@ +LINK_BINS_DYNAMIC = @LINK_BINS_DYNAMIC@ LDAPD_LIBS = @LDAPD_LIBS@ SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ diff --git a/configure.in b/configure.in index d496304bb9..775f483145 100644 --- a/configure.in +++ b/configure.in @@ -140,6 +140,7 @@ OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups], auto)dnl OL_ARG_ENABLE(aci,[ --enable-aci enable per-object ACIs], no)dnl OL_ARG_ENABLE(discreteaci,[ --enable-discreteaci enable discrete rights in ACIs], no)dnl OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl +OL_ARG_ENABLE(dynamic,[ --enable-dynamic enable linking built binaries with dynamic libs], no)dnl dnl SLAPD Backend options OL_ARG_ENABLE(bdb2,[ --enable-bdb2 enable bdb2 backend], no)dnl @@ -289,6 +290,7 @@ if test $ol_enable_slapd = no ; then ol_enable_aci=no ol_enable_discreteaci=no ol_enable_wrappers=no + ol_enable_dynamic=no ol_with_ldbm_api=no ol_with_ldbm_type=no @@ -1604,6 +1606,13 @@ if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then ol_enable_ldbm=no fi +dnl ---------------------------------------------------------------- +if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then + LINK_BINS_DYNAMIC="yes" +else + LINK_BINS_DYNAMIC="no" +fi + dnl ---------------------------------------------------------------- if test $ol_enable_wrappers != no ; then AC_CHECK_HEADERS(tcpd.h) @@ -2133,6 +2142,7 @@ AC_SUBST(LTHREAD_LIBS) AC_SUBST(LUTIL_LIBS) AC_SUBST(WRAP_LIBS) AC_SUBST(MOD_TCL_LIB) +AC_SUBST(LINK_BINS_DYNAMIC) AC_SUBST(SLAPD_MODULES_CPPFLAGS) AC_SUBST(SLAPD_MODULES_LDFLAGS) diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index 383657603c..4ac86c5477 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -73,3 +73,5 @@ MODRDNOUTMASTER3=$DATADIR/modrdn.out.master.3 ACLOUTMASTER=$DATADIR/acl.out.master REPLOUTMASTER=$DATADIR/repl.out.master MODSRCHFILTERS=$DATADIR/modify.search.filters +# Just in case we linked the binaries dynamically +export LD_LIBRARY_PATH=`pwd`/../libraries