(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
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)
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@
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
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
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)
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)
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