Index: ./Makefile.in
===================================================================
--- ./SVN/text-base/Makefile.in	Thu Sep 20 04:07:09 2001
+++ ./Makefile.in	Sat Sep 22 02:47:19 2001
@@ -64,13 +64,15 @@
 
 LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(LDFLAGS) -rpath $(libdir)
 
+TEMP_LIBTOOL_FIX = $(top_srcdir)/ac-helpers/libtool-fix-install.sh
+
 INSTALL = @INSTALL@
-INSTALL_LIB = $(LIBTOOL) --mode=install $(INSTALL)
+INSTALL_LIB = $(TEMP_LIBTOOL_FIX) 1 $(LIBTOOL) --mode=install $(INSTALL)
 INSTALL_FS_LIB = $(INSTALL_LIB)
 INSTALL_BIN = $(LIBTOOL) --mode=install $(INSTALL)
 INSTALL_FS_BIN = $(INSTALL_BIN)
 INSTALL_INCLUDE = $(INSTALL) -m 644
-INSTALL_MOD_SHARED = @APXS@ -i -a
+INSTALL_MOD_SHARED = $(TEMP_LIBTOOL_FIX) 0 @APXS@ -i -a
 INSTALL_MOD_STATIC = $(INSTALL) -m 644
 
 PYTHON = @PYTHON@
Index: ./ac-helpers/berkeley-db.m4
===================================================================
--- ./ac-helpers/SVN/text-base/berkeley-db.m4	Thu Sep 20 04:07:43 2001
+++ ./ac-helpers/berkeley-db.m4	Fri Sep 21 23:40:06 2001
@@ -97,13 +97,7 @@
     dbdir=`cd db/dist ; pwd`
     SVN_DB_INCLUDES=-I$dbdir
     svn_lib_berkeley_db=yes
-    if test $enable_shared = yes; then
-        # Once we upgrade to libtool 1.4 we should change this to 
-        # $dbdir/libdb-3.3.la
-        SVN_DB_LIBS=-L$dbdir/.libs -ldb-3.3
-    else
-        SVN_DB_LIBS=-L$dbdir -ldb
-    fi
+    SVN_DB_LIBS=$dbdir/libdb-3.3.la
   elif test $status = skip; then
     svn_lib_berkeley_db=no
   else
@@ -167,7 +161,8 @@
 	  SVN_LIB_BERKELEY_DB_TRY($1, $2, $3)
           eval $cache_id=$svn_have_berkeley_db
         ])
-      AC_MSG_RESULT(`eval echo '$'$cache_id`)
+      result=`eval echo '$'$cache_id`
+      AC_MSG_RESULT($result)
 
       # If we found it, no need to search any more.
       if test `eval echo '$'$cache_id` = yes; then
@@ -197,11 +192,13 @@
 	header=`echo $found | sed -e 's/:.*$//'`
 	lib=`echo $found | sed -e 's/^.*://'`
         SVN_DB_INCLUDES=-I$header
+dnl ### should look for a .la file
         SVN_DB_LIBS=-L$lib -ldb
         svn_lib_berkeley_db=yes
       ;;
       * )
         SVN_DB_INCLUDES=-I$found/include
+dnl ### should look for a .la file
         SVN_DB_LIBS=-L$found/lib -ldb
 	svn_lib_berkeley_db=yes
       ;;
Index: ./ac-helpers/libtool-fix-install.sh
===================================================================
--- ./ac-helpers/SVN/text-base/libtool-fix-install.sh	Sat Sep 22 03:16:13 2001
+++ ./ac-helpers/libtool-fix-install.sh	Sat Sep 22 02:46:37 2001
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# USAGE: libtool-fix-install.sh arg-adjust libtool ... filename
+#
+idx=$[$# - $1]
+fname=`eval echo '$'$idx`
+echo FIXING: $fname
+sed '/^relink/s/\([^(].*\)/(\1)/' $fname  $fname.new
+mv $fname.new $fname
+shift
+$*
Index: ./gen-make.py
===================================================================
--- ./SVN/text-base/gen-make.py	Thu Sep 20 04:07:10 2001
+++ ./gen-make.py	Fri Sep 21 20:25:14 2001
@@ -108,19 +108,9 @@
         target_ob.deps.append(tlib)
         deps.append(tlib.output)
 
-        dep_path = tlib.path
-        if bldtype == 'lib':
-          # we need to hack around a libtool problem: it cannot record a
-          # dependency of one shared lib on another shared lib.
-          ### fix this by upgrading to the new libtool 1.4 release...
-          # strip lib from the front so we have -lsvn_foo
-          if lib[:3] == 'lib':
-            lib = lib[3:]
-          libs.append('-L%s -l%s'
-                      % (retreat + os.path.join(dep_path, '.libs'), lib))
-        else:
-          # linking executables can refer to .la files
-          libs.append(retreat + os.path.join(dep_path, lib + '.la'))
+        # link in the library by simply referring to the .la file
+        ### hmm. use join() for retreat + ... ?
+        libs.append(retreat + os.path.join(tlib.path, lib + '.la'))
       else:
         # something we don't know, so just include it directly
         libs.append(lib)
@@ -190,6 +180,8 @@
       s_files, s_errors = _collect_paths(parser.get('static-apache', 'paths'))
       errors = errors or s_errors
 
+      # Construct a .libs directory within the Apache area and populate it
+      # with the appropriate files. Also drop the .la file in the target dir.
       ofile.write('\ninstall-mods-static: %s\n'
                   '\t$(MKDIR) %s\n'
                   % (string.join(la_tweaked + s_files),
@@ -203,6 +195,8 @@
                        os.path.join('$(APACHE_TARGET)', '.libs', base + '.a'),
                        file,
                        os.path.join('$(APACHE_TARGET)', base + '.la')))
+
+      # copy the other files to the target dir
       for file in s_files:
         ofile.write('\t$(INSTALL_MOD_STATIC) %s %s\n'
                     % (file, os.path.join('$(APACHE_TARGET)',
Index: ./autogen.sh
===================================================================
--- ./SVN/text-base/autogen.sh	Thu Sep 20 04:07:10 2001
+++ ./autogen.sh	Sat Sep 22 02:35:48 2001
@@ -5,14 +5,15 @@
 # Ensure some permissions for executables used by this script
 for execfile in gen-make.py \
                 dist.sh \
+                buildcheck.sh \
                 ac-helpers/get-neon-ver.sh \
                 ac-helpers/gnu-diff.sh \
                 ac-helpers/gnu-patch.sh \
                 ac-helpers/install.sh; do
+                ac-helpers/libtool-fix-install.sh; do
   chmod +x $execfile                
 done
 
-
 # Make sure the APR directory is present
 if [ ! -d apr ]; then
   echo You don't have an apr/ subdirectory here.  Please get one:
@@ -65,11 +66,12 @@
 fi
 
 
-# Run a quick test to ensure APR is kosher.
-(cd apr  build/buildcheck.sh) || exit 1
-
-
+# Run a quick test to ensure that our autoconf and libtool verison are ok
+./buildcheck.sh || exit 1
 
+### temporary cleanup during transition to libtool 1.4
+rm -f ac-helpers/ltmain.sh ac-helpers/ltconfig apr/build/ltconfig \
+	apr/build/ltmain.sh
 
 #
 # Handle some libtool helper files
Index: ./build.conf
===================================================================
--- ./SVN/text-base/build.conf	Thu Sep 20 04:07:09 2001
+++ ./build.conf	Fri Sep 21 20:25:56 2001
@@ -102,8 +102,7 @@
 [libsvn_ra_dav]
 type = lib
 path = subversion/libsvn_ra_dav
-### hack to deal with libtool's busted intra-library dependencies
-libs = -L$(abs_builddir)/neon/src/.libs -lneon
+libs = $(abs_builddir)/neon/src/libneon.la
 
 # Accessing repositories via direct libsvn_fs
 [libsvn_ra_local]
Index: ./configure.in
===================================================================
--- ./SVN/text-base/configure.in	Thu Sep 20 04:07:07 2001
+++ ./configure.in	Sat Sep 22 00:09:39 2001
@@ -4,6 +4,10 @@
 
 dnl General Setup -----------------------
 
+dnl Ensure that subversion is configured with autoconf 2.50
+dnl Don't even think about removing this check!
+AC_PREREQ(2.50)
+
 dnl First line is *required*;  sanity-checks that the our src dir exists.
 AC_INIT(subversion/include/svn_types.h)
 AC_CONFIG_AUX_DIR(ac-helpers)
@@ -136,7 +140,10 @@
 SVN_FIND_APACHE
 
 dnl ### should we ever bother with the system install?
-INSTALL=\$(top_srcdir)/apr/build/install.sh -c
+dnl use abs_srcdir. sometimes during installation, libtool will relink the
+dnl library. when it does this, it does a cd, so a relative use of
+dnl install.sh will not work.
+INSTALL=\$(abs_srcdir)/apr/build/install.sh -c
 AC_SUBST(INSTALL)
 
 dnl use APR's mkdir to enable creating intervening directories
@@ -279,14 +286,20 @@
   AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_DAV, 1,
         [Defined if libsvn_client should link against libsvn_ra_dav])
   SVN_RA_LIB_DEPS=subversion/libsvn_ra_dav/libsvn_ra_dav.la
-  SVN_RA_LIB_LINK=-L\$(abs_builddir)/subversion/libsvn_ra_dav/.libs -lsvn_ra_dav \
-	-L\$(abs_builddir)/neon/src/.libs -lneon $NEON_LIBS
+  SVN_RA_LIB_LINK=\$(abs_builddir)/subversion/libsvn_ra_dav.la \
+	\$(abs_builddir)/neon/src/libneon.la $NEON_LIBS
 
   if test $svn_lib_berkeley_db = yes; then
     AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL, 1,
         [Defined if libsvn_client should link against libsvn_ra_local])
-    SVN_RA_LIB_DEPS=$SVN_RA_LIB_DEPS subversion/libsvn_ra_local/libsvn_ra_local.la subversion/libsvn_repos/libsvn_repos.la subversion/libsvn_fs/libsvn_fs.la
-    SVN_RA_LIB_LINK=$SVN_RA_LIB_LINK -L\$(abs_builddir)/subversion/libsvn_ra_local/.libs -lsvn_ra_local -L\$(abs_builddir)/subversion/libsvn_repos/.libs -lsvn_repos -L\$(abs_builddir)/subversion/libsvn_fs/.libs -lsvn_fs \$(SVN_DB_LIBS)
+    SVN_RA_LIB_DEPS=$SVN_RA_LIB_DEPS \
+	subversion/libsvn_ra_local/libsvn_ra_local.la \
+	subversion/libsvn_repos/libsvn_repos.la \
+	subversion/libsvn_fs/libsvn_fs.la
+    SVN_RA_LIB_LINK=$SVN_RA_LIB_LINK \
+	\$(abs_builddir)/subversion/libsvn_ra_local.la \
+	\$(abs_builddir)/subversion/libsvn_repos.la \
+	\$(abs_builddir)/subversion/libsvn_fs.la \$(SVN_DB_LIBS)
   fi
 
 fi
Index: ./buildcheck.sh
===================================================================
--- ./SVN/text-base/buildcheck.sh	Sat Sep 22 03:15:58 2001
+++ ./buildcheck.sh	Fri Sep 21 20:18:32 2001
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+echo buildconf: checking installation...
+
+# autoconf 2.50 or newer
+ac_version=`autoconf --version 2/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
+if test -z $ac_version; then
+echo buildconf: autoconf not found.
+echo            You need autoconf version 2.50 or newer installed
+echo            to build Apache from CVS.
+exit 1
+fi
+IFS=.; set $ac_version; IFS=' '
+if test $1 = 2 -a $2 -lt 50 || test $1 -lt 2; then
+echo buildconf: autoconf version $ac_version found.
+echo            You need autoconf version 2.50 or newer installed.
+exit 1
+else
+echo buildconf: autoconf version $ac_version (ok)
+fi
+
+# libtool 1.4 or newer
+libtool=`apr/build/PrintPath glibtool libtool`
+lt_pversion=`$libtool --version 2/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
+if test -z $lt_pversion; then
+echo buildconf: libtool not found.
+echo            You need libtool version 1.4 or newer installed
+exit 1
+fi
+lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
+IFS=.; set $lt_version; IFS=' '
+lt_status=good
+if test $1 = 1; then
+   if test $2 -lt 4; then
+      lt_status=bad
+   fi
+fi
+if test $lt_status = good; then
+   echo buildconf: libtool version $lt_pversion (ok)
+   exit 0
+fi
+
+echo buildconf: libtool version $lt_pversion found.
+echo            You need libtool version 1.4 or newer installed
+
+exit 1


