Jeff (and anyone else interested),
Can you please test out this patch on AIX and report on what you
get back? Per your earlier email, this tries to separate out any
libexpat.la's so that it is not specified when linking libaprutil.la.
This *may* work around the bug you are seeing in libtool. If you
want to compile a program with libaprutil.la, we'll still have to
specify any libexpat.la's, but this should remove the -ldb... crap.
This patch is against httpd-2.0 and a srclib/apr-util. (Works here
on Linux 2.4.)
This also moves the acquisiton of the apr-util libraries to much
earlier on in httpd's configure. We would still need
APRUTIL_EXPORT_LIBS during configure-time, but we wouldn't need
them once configure is complete. -- justin
Index: configure.in
===================================================================
RCS file: /home/cvs/httpd-2.0/configure.in,v
retrieving revision 1.196
diff -u -r1.196 configure.in
--- configure.in 30 Dec 2001 14:05:55 -0000 1.196
+++ configure.in 6 Jan 2002 22:55:33 -0000
@@ -81,6 +81,12 @@
EXTRA_LIBS=
EXTRA_INCLUDES=
+dnl get the exported vars from APRUTIL
+. ./srclib/apr-util/export_vars.sh
+APR_ADDTO(LIBS, $APRUTIL_EXPORT_LIBS)
+APR_ADDTO(LIBTOOL_LIBS, $APRUTIL_EXPORT_LIBTOOL_LIBS)
+APACHE_SUBST(LIBTOOL_LIBS)
+
dnl Absolute source/build directory
abs_srcdir=`(cd $srcdir && pwd)`
abs_builddir=`pwd`
@@ -402,10 +428,10 @@
APACHE_FAST_OUTPUT(test/Makefile)
fi
-dnl get the exported vars from APRUTIL
-. ./srclib/apr-util/export_vars.sh
-APR_ADDTO(LIBS, $APRUTIL_EXPORT_LIBS)
+dnl These are special libtool-only libraries that must be added after all
+dnl configure tests. This may potentially invalidate some configure
+dnl tests if there are useful things here (such as Expat).
AP_LIBS="$AP_LIBS $LIBTOOL_LIBS"
dnl ## Finalize the variables
echo $ac_n "${nl}Restore user-defined environment settings...${nl}"
Index: srclib/apr-util/Makefile.in
===================================================================
RCS file: /home/cvs/apr-util/Makefile.in,v
retrieving revision 1.56
diff -u -r1.56 Makefile.in
--- srclib/apr-util/Makefile.in 4 Jan 2002 21:54:49 -0000 1.56
+++ srclib/apr-util/Makefile.in 6 Jan 2002 22:55:39 -0000
@@ -9,6 +9,8 @@
INCLUDES=-I./include -I$(srcdir)/include @APR_INCLUDES@
TARGET_LIB = libaprutil.la
+DEPEND_LIBS = @APRUTIL_EXPORT_LIBS@
+DEPEND_LIBTOOL_LIBS = @APRUTIL_EXPORT_LIBTOOL_LIBS@
INSTALL_SUBDIRS = @APR_XML_DIR@
TARGETS = delete-lib $(TARGET_LIB) delete-exports aprutil.exp export_vars.h
@@ -61,7 +63,7 @@
$(TARGET_LIB):
@objects="`find $(SUBDIRS) -name expat -prune -o -name
'gen_uri_delims.@so_ext@' -prune -o -name '*.@so_ext@' -print`"; \
- tmpcmd="$(LINK) @lib_target@ @EXTRA_OS_LINK@"; \
+ tmpcmd="$(LINK) @lib_target@ @EXTRA_OS_LINK@ $(DEPEND_LIBS)"; \
echo $$tmpcmd; \
$$tmpcmd
Index: srclib/apr-util/configure.in
===================================================================
RCS file: /home/cvs/apr-util/configure.in,v
retrieving revision 1.41
diff -u -r1.41 configure.in
--- srclib/apr-util/configure.in 4 Jan 2002 21:54:49 -0000 1.41
+++ srclib/apr-util/configure.in 6 Jan 2002 22:55:39 -0000
@@ -82,8 +82,10 @@
APR_ADDTO(LIBS, [$APR_EXPORT_LIBS])
AC_SUBST(APRUTIL_EXPORT_LIBS)
+AC_SUBST(APRUTIL_EXPORT_LIBTOOL_LIBS)
AC_SUBST(LDFLAGS)
APR_ADDTO(LIBS,[$APRUTIL_EXPORT_LIBS])
+APR_ADDTO(LIBS,[$APRUTIL_EXPORT_LIBTOOL_LIBS])
dnl
dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
Index: srclib/apr-util/export_vars.sh.in
===================================================================
RCS file: /home/cvs/apr-util/export_vars.sh.in,v
retrieving revision 1.1
diff -u -r1.1 export_vars.sh.in
--- srclib/apr-util/export_vars.sh.in 12 Dec 2000 09:44:52 -0000 1.1
+++ srclib/apr-util/export_vars.sh.in 6 Jan 2002 22:55:39 -0000
@@ -9,3 +9,4 @@
#
APRUTIL_EXPORT_LIBS="@APRUTIL_EXPORT_LIBS@"
+APRUTIL_EXPORT_LIBTOOL_LIBS="@APRUTIL_EXPORT_LIBTOOL_LIBS@"
Index: srclib/apr-util/build/apu-conf.m4
===================================================================
RCS file: /home/cvs/apr-util/build/apu-conf.m4,v
retrieving revision 1.24
diff -u -r1.24 apu-conf.m4
--- srclib/apr-util/build/apu-conf.m4 2 Jan 2002 23:59:26 -0000 1.24
+++ srclib/apr-util/build/apu-conf.m4 6 Jan 2002 22:55:39 -0000
@@ -454,6 +454,7 @@
expat_include_dir=$top_builddir/$bundled_subdir/lib
expat_libs=$top_builddir/$bundled_subdir/lib/libexpat.la
APR_XML_SUBDIRS="`echo $bundled_subdir | sed -e 's%xml/%%'`"
+ APR_ADDTO(APRUTIL_EXPORT_LIBTOOL_LIBS, [$expat_libs])
else
if test "$expat_include_dir" = "$srcdir/xml/expat/include" -o "$expat_include_dir" =
"$srcdir/xml/expat/lib"; then
dnl This is a bit of a hack. This only works because we know that
@@ -463,6 +464,10 @@
expat_include_dir=$top_builddir/$bundled_subdir/lib
expat_libs=$top_builddir/$bundled_subdir/lib/libexpat.la
APR_XML_SUBDIRS="`echo $bundled_subdir | sed -e 's%xml/%%'`"
+ APR_ADDTO(APRUTIL_EXPORT_LIBTOOL_LIBS, [$expat_libs])
+else
+ dnl We do hope that this isn't a libtool lib.
+ APR_ADDTO(APRUTIL_EXPORT_LIBS, [$expat_libs])
fi
fi
APR_XML_DIR=$bundled_subdir
@@ -471,7 +476,6 @@
APR_ADDTO(INCLUDES, [-I$expat_include_dir])
APR_ADDTO(LIBS, [$expat_libs])
-APR_ADDTO(APRUTIL_EXPORT_LIBS, [$expat_libs])
dnl ### export the Expat includes?
])
Index: support/Makefile.in
===================================================================
RCS file: /home/cvs/httpd-2.0/support/Makefile.in,v
retrieving revision 1.31
diff -u -r1.31 Makefile.in
--- support/Makefile.in 15 Dec 2001 13:56:36 -0000 1.31
+++ support/Makefile.in 6 Jan 2002 22:55:39 -0000
@@ -4,7 +4,7 @@
PROGRAMS = htpasswd htdigest rotatelogs logresolve ab checkgid
TARGETS = $(PROGRAMS)
-PROGRAM_LDADD = $(EXTRA_LDFLAGS) $(UTIL_LDFLAGS) $(PROGRAM_DEPENDENCIES)
$(EXTRA_LIBS)
+PROGRAM_LDADD = $(EXTRA_LDFLAGS) $(UTIL_LDFLAGS) $(PROGRAM_DEPENDENCIES)
+$(EXTRA_LIBS) $(LIBTOOL_LIBS)
PROGRAM_DEPENDENCIES = \
$(top_builddir)/srclib/apr-util/libaprutil.la \
$(top_builddir)/srclib/apr/libapr.la