From ed75be1b3cfdbc25320926d727b400601ef5b49e Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Thu, 23 Sep 1999 05:32:10 +0000 Subject: [PATCH] * configure.in: add tcl8.2 to list of tcl libs to search for, also added new MOD_TCL_LIB and related AC_SUBST() so that when back-tcl is compiled as a dynamic module we link -ltcl to the module and not slapd (this is the correct way to do this since the .la file handles giving the correct libs when we pass the module to it in the linker line with -dlopen). Also modified the perl backend in a similar way except that the PERL_CPPFLAGS always go to the module and never to slapd (slapd doesn't need them). * build/mod.mk: added $(MODLIBS) to the dynamic module link line to accomodate module specific libraries. These should be defined in the back-*/Makefile.in file for each module (so far only back-tcl and back-perl need it). * build/top.mk: modified the perl ldflags and cppflags slightly * servers/slapd/Makefile.in: same here * servers/slapd/back-perl/Makefile.in: added MODLIBS=$(MOD_PERL_LDFLAGS) for when we are using a dynamic module (problem, libtool wont allow linking static libs into a libtool lib, so unless perl's libs are compiled dynamic, then back-perl can't be a dynamic module. We need a test for this on perl and tcl). * servers/slapd/back-tcl/Makefile.in: added MODLIBS=$(MOD_TCL_LIB) * back-perl and back-tcl now compile --- build/mod.mk | 2 +- build/top.mk | 7 +++-- configure.in | 41 +++++++++++++++-------------- servers/slapd/Makefile.in | 2 +- servers/slapd/back-perl/Makefile.in | 2 ++ servers/slapd/back-tcl/Makefile.in | 2 +- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/build/mod.mk b/build/mod.mk index ce88c5ceec..7a9c45925f 100644 --- a/build/mod.mk +++ b/build/mod.mk @@ -21,7 +21,7 @@ version.c: $(OBJS) $(MKVERSION) $(LIBBASE) > $@ $(LIBRARY): version.lo - $(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo + $(LTLIBLINK) -module -rpath $(moduledir) -o $@ $(OBJS) version.lo $(MODLIBS) $(LIBSTAT): version.lo $(AR) ruv $@ `echo $(OBJS) | sed 's/\.lo/.o/g'` version.o diff --git a/build/top.mk b/build/top.mk index 519708a216..c146c7ee25 100644 --- a/build/top.mk +++ b/build/top.mk @@ -129,13 +129,12 @@ SECURITY_LIBS = @SASL_LIBS@ @KRB_LIBS@ @TLS_LIBS@ MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@ MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@ -MODULES_LIBS = @MODULES_LIBS@ -PERL_CPPFLAGS = @SLAPD_PERL_CPPFLAGS@ -PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@ +MODULES_LIBS = @MODULES_LIBS@ @SLAPD TERMCAP_LIBS = @TERMCAP_LIBS@ +SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@ LDAPD_LIBS = @LDAPD_LIBS@ -SLAPD_LIBS = @SLAPD_LIBS@ +SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ SLURPD_LIBS = @SLURPD_LIBS@ # Our Defaults diff --git a/configure.in b/configure.in index c24e643757..d496304bb9 100644 --- a/configure.in +++ b/configure.in @@ -418,8 +418,10 @@ SLAPD_MODULES_CPPFLAGS= SLAPD_MODULES_LIST= SLAPD_PERL_LDFLAGS= -SLAPD_PERL_CPPFLAGS= +MOD_PERL_LDFLAGS= +PERL_CPPFLAGS= +MOD_TCL_LIB= KRB_LIBS= READLINE_LIBS= SASL_LIBS= @@ -516,9 +518,12 @@ if test $ol_enable_perl != no ; then fi else - SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`" - SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`" - + PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`" + if test x"$ol_with_perl_module" == "xstatic" ; then + SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`" + else + MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`" + fi dnl should check perl version ol_link_perl=yes fi @@ -1654,21 +1659,15 @@ if test $ol_enable_tcl != no ; then if test $ac_cv_header_tcl_h != yes ; then have_tcl=no else - AC_CHECK_LIB(tcl,main, - [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"], - [have_tcl=no]) - - if test $have_tcl != yes; then - AC_CHECK_LIB(tcl7.6,main, - [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"], - [have_tcl=no]) - fi - - if test $have_tcl != yes; then - AC_CHECK_LIB(tcl8.0,main, - [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"], - [have_tcl=no]) - fi + for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do + AC_CHECK_LIB($lib,main, + [have_tcl=yes + if test x"$ol_with_tcl_module" == "xstatic" ; then + SLAPD_LIBS="$SLAPD_LIBS -l${lib}" + else + MOD_TCL_LIB="-l${lib}" + fi;break],[have_tcl=no]) + done fi if test $have_tcl != yes ; then @@ -2133,13 +2132,15 @@ AC_SUBST(LDBM_LIBS) AC_SUBST(LTHREAD_LIBS) AC_SUBST(LUTIL_LIBS) AC_SUBST(WRAP_LIBS) +AC_SUBST(MOD_TCL_LIB) AC_SUBST(SLAPD_MODULES_CPPFLAGS) AC_SUBST(SLAPD_MODULES_LDFLAGS) AC_SUBST(SLAPD_MODULES_LIST) -AC_SUBST(SLAPD_PERL_CPPFLAGS) +AC_SUBST(PERL_CPPFLAGS) AC_SUBST(SLAPD_PERL_LDFLAGS) +AC_SUBST(MOD_PERL_LDFLAGS) AC_SUBST(KRB_LIBS) AC_SUBST(READLINE_LIBS) diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in index 61eb507b3e..e5cbecad42 100644 --- a/servers/slapd/Makefile.in +++ b/servers/slapd/Makefile.in @@ -33,7 +33,7 @@ XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES) # $(LTHREAD_LIBS) must be last XLIBS = libbackends.a -lavl -lldbm -lldif -lldap_r -llber -llutil XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \ - $(PERL_LDFLAGS) $(SECURITY_LIBS) \ + $(SLAPD_PERL_LDFLAGS) $(SECURITY_LIBS) \ $(LDIF_LIBS) $(LUTIL_LIBS) XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS) diff --git a/servers/slapd/back-perl/Makefile.in b/servers/slapd/back-perl/Makefile.in index aaaf32df41..0041ddf05a 100644 --- a/servers/slapd/back-perl/Makefile.in +++ b/servers/slapd/back-perl/Makefile.in @@ -21,8 +21,10 @@ LDAP_LIBDIR= ../../../libraries BUILD_OPT = "--enable-perl" BUILD_MOD = @BUILD_PERL@ LINKAGE = @BUILD_PERL_DYNAMIC@ +PERL_CPPFLAGS = @PERL_CPPFLAGS@ LIBBASE = back_perl +MODLIBS = @MOD_PERL_LDFLAGS@ XINCPATH = -I.. -I$(srcdir)/.. XDEFS = $(PERL_CPPFLAGS) $(MODULES_CPPFLAGS) diff --git a/servers/slapd/back-tcl/Makefile.in b/servers/slapd/back-tcl/Makefile.in index 6a565402e6..5559b92763 100644 --- a/servers/slapd/back-tcl/Makefile.in +++ b/servers/slapd/back-tcl/Makefile.in @@ -25,6 +25,7 @@ BUILD_MOD = @BUILD_TCL@ LINKAGE = @BUILD_TCL_DYNAMIC@ LIBBASE = back_tcl +MODLIBS = @MOD_TCL_LIB@ XDEFS = $(MODULES_CPPFLAGS) XLDFLAGS = $(MODULES_LDFLAGS) @@ -34,4 +35,3 @@ all-local-lib: ../.backend ../.backend: lib$(LIBBASE).a @touch $@ - -- 2.39.5