]> git.sur5r.net Git - openldap/commitdiff
* configure.in: add --enable-dynamic option for linking our local binaries
authorBen Collins <bcollins@openldap.org>
Wed, 29 Sep 1999 00:56:43 +0000 (00:56 +0000)
committerBen Collins <bcollins@openldap.org>
Wed, 29 Sep 1999 00:56:43 +0000 (00:56 +0000)
  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).

build/lib-shared.mk
build/lib.mk
build/top.mk
configure.in
tests/scripts/defines.sh

index 776972ac6d86bb4686769e883ec8f22f73ba0ec8..69a37e50aedd1e9084fc4fa7fc471103839ee957 100644 (file)
@@ -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
index 9bf542d340c7e15963696c2882bb3b887716c4d5..76fb1000e4c5389e9076a206ce199a963867f2fe 100644 (file)
@@ -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)
index bbd6b32051f4c8785c3c091f07e1b6b9dea2cc6e..8f6f92efddd7e07b409a094d82e95cb220e7ad1e 100644 (file)
@@ -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@
index d496304bb933f54ae493f0f1d94787ce2c083e6a..775f4831459d30eab231d4c95fa62b8d37babc12 100644 (file)
@@ -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)
index 383657603c1c54d06dfaacd28eabbcd508d005fa..4ac86c547736495a7677f897736c66dae78c7fda 100755 (executable)
@@ -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