--------------------- PatchSet 5980 Date: 2007/10/18 17:11:40 Author: rousskov Branch: ecap Tag: (none) Log: Added basic support for Libtool ltdl. Libltdl directory is not committed yet because I want to investigate whether it can be moved from root to lib/. Bootstrap.sh currently strips a large copying file from that directory but does not attempt to move the directory itself. The configure options will need to be changed according to squid-dev discussion: we should assume that ltdl is always used if modules are used, and we should have a --disable-modules option. The code works with a dummy module: Squid was able to load and unload using LoadableModule, an ltdl wrapper class from Spicer. I have not committed that wrapper yet. Members: Makefile.am:1.12->1.12.30.1 acinclude.m4:1.9->1.9.40.1 bootstrap.sh:1.22->1.22.2.1 configure.in:1.159->1.159.2.1 src/Makefile.am:1.131->1.131.2.1 Index: squid3/Makefile.am =================================================================== RCS file: /cvsroot/squid-sf//squid3/Makefile.am,v retrieving revision 1.12 retrieving revision 1.12.30.1 diff -u -r1.12 -r1.12.30.1 --- squid3/Makefile.am 12 May 2006 13:49:56 -0000 1.12 +++ squid3/Makefile.am 18 Oct 2007 17:11:40 -0000 1.12.30.1 @@ -1,11 +1,21 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am,v 1.12 2006/05/12 13:49:56 squidadm Exp $ +# $Id: Makefile.am,v 1.12.30.1 2007/10/18 17:11:40 rousskov Exp $ # AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5 foreign -DIST_SUBDIRS = lib snmplib scripts src icons errors contrib doc helpers test-suite tools -SUBDIRS = lib @makesnmplib@ scripts src icons errors doc helpers test-suite tools + +if WITH_LIBLTDL +DIST_SUBDIRS = libltdl +SUBDIRS = libltdl +else +DIST_SUBDIRS = +SUBDIRS = +endif + +DIST_SUBDIRS += lib snmplib scripts src icons errors contrib doc helpers test-suite tools +SUBDIRS += lib @makesnmplib@ scripts src icons errors doc helpers test-suite tools + DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]* DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'` Index: squid3/acinclude.m4 =================================================================== RCS file: /cvsroot/squid-sf//squid3/acinclude.m4,v retrieving revision 1.9 retrieving revision 1.9.40.1 diff -u -r1.9 -r1.9.40.1 --- squid3/acinclude.m4 21 Dec 2004 03:14:15 -0000 1.9 +++ squid3/acinclude.m4 18 Oct 2007 17:11:40 -0000 1.9.40.1 @@ -87,3 +87,6 @@ HUGE_OBJECT_FLAG="" fi ]) # end of AC_DEFUN of AC_TEST_CHECKFORHUGEOBJECTS + + +m4_include(cfgaux/libtool.m4) Index: squid3/bootstrap.sh =================================================================== RCS file: /cvsroot/squid-sf//squid3/bootstrap.sh,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -u -r1.22 -r1.22.2.1 --- squid3/bootstrap.sh 4 Oct 2007 02:52:27 -0000 1.22 +++ squid3/bootstrap.sh 18 Oct 2007 17:11:40 -0000 1.22.2.1 @@ -52,6 +52,32 @@ fi } +bootstrap_libtoolize() { + ltver=$1 + + if egrep -q '^[[:space:]]*AC_LIBLTDL_' configure.in + then + extras="--ltdl" + else + extras="" + fi + + bootstrap libtoolize$ltver $extras --force --copy --automake + + if egrep -q '^[[:space:]]*AC_LIBLTDL_' configure.in + then + # do not bundle with the huge standard license text + rm -fv libltdl/COPYING.LIB + makefile=libltdl/Makefile.in + sed 's/COPYING.LIB/ /g' $makefile > $makefile.new; + chmod u+w $makefile + mv $makefile.new $makefile + chmod u-w $makefile + fi + + echo "Warning: libtoolize 1.x does not update libtool.m4." +} + # Adjust paths of required autool packages amver=`find_version automake ${amversions}` acver=`find_version autoconf ${acversions}` @@ -81,7 +107,7 @@ # Bootstrap the autotool subsystems bootstrap aclocal$amver bootstrap autoheader$acver - bootstrap libtoolize$ltver --force --copy --automake + bootstrap_libtoolize $ltver bootstrap automake$amver --foreign --add-missing --copy -f bootstrap autoconf$acver --force fi ); then Index: squid3/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid3/configure.in,v retrieving revision 1.159 retrieving revision 1.159.2.1 diff -u -r1.159 -r1.159.2.1 --- squid3/configure.in 1 Oct 2007 05:51:11 -0000 1.159 +++ squid3/configure.in 18 Oct 2007 17:11:41 -0000 1.159.2.1 @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.159 2007/10/01 05:51:11 squidadm Exp $ +dnl $Id: configure.in,v 1.159.2.1 2007/10/18 17:11:41 rousskov Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.159 $)dnl +AC_REVISION($Revision: 1.159.2.1 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -29,9 +29,57 @@ AC_LANG_C AC_PROG_CXX AC_CANONICAL_HOST -AC_DISABLE_SHARED + +dnl TODO: we need an --enable-modules option as well +AC_MSG_CHECKING(whether to use embedded libltdl) +AC_ARG_WITH(libltdl, + [ + AC_HELP_STRING( + [--with-libltdl], + [handle loadable modules using libltdl]) + ], + [ + case "${withval}" in + yes) libltdl=yes ;; + no) libltdl=no ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-libltdl) ;; + esac + AC_MSG_RESULT([$libltdl, explicitly]) + ], + [ + libltdl=yes; + AC_MSG_RESULT([$libltdl, implicitly]) + ] +) + +AM_CONDITIONAL(WITH_LIBLTDL, test "x$libltdl" = xyes) + +if test "x$libltdl" = xyes +then + AC_ENABLE_SHARED +else + AC_DISABLE_SHARED +fi +AC_LIBTOOL_DLOPEN +if test "x$libltdl" = xyes +then + AC_LIBLTDL_CONVENIENCE +fi AC_PROG_LIBTOOL AC_LTDL_DLLIB + +# must configure the subdir unconditionally for "make distcheck" to work +AC_SUBST(INCLTDL) +AC_SUBST(LIBLTDL) +AC_CONFIG_SUBDIRS(libltdl) + +if test "x$libltdl" != "xyes" +then + # Why is this needed? Should not libtool's AC_LIBTOOL_DLOPEN do that? + LIBADD_DL=${lt_cv_dlopen_libs} + AC_SUBST([LIBADD_DL]) +fi + AC_PROG_RANLIB Index: squid3/src/Makefile.am =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Makefile.am,v retrieving revision 1.131 retrieving revision 1.131.2.1 diff -u -r1.131 -r1.131.2.1 --- squid3/src/Makefile.am 19 Sep 2007 09:50:44 -0000 1.131 +++ squid3/src/Makefile.am 18 Oct 2007 17:11:42 -0000 1.131.2.1 @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.131 2007/09/19 09:50:44 squidadm Exp $ +# $Id: Makefile.am,v 1.131.2.1 2007/10/18 17:11:42 rousskov Exp $ # # Uncomment and customize the following to suit your needs: # @@ -392,6 +392,7 @@ IPInterception.cc \ IPInterception.h + # authentication framework libauth_la_SOURCES = \ AuthConfig.cc \ @@ -670,6 +671,18 @@ @AUTH_OBJS@ \ @ICAP_LIBS@ +if WITH_LIBLTDL +squid_LDADD += \ + @LIBLTDL@ +squid_LDFLAGS = \ + -export-dynamic -dlopen force +# when static module linking is supported and enabled: +# squid_LDFLAGS = \ +# -all-static -dlopen self +# +endif + + ICAP_libicap_a_SOURCES = \ ICAP/AsyncJob.cc \ ICAP/AsyncJob.h \