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: ./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 14:09:34 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/install.sh \
+                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
@@ -97,6 +99,15 @@
 
 rm -f ac-helpers/libtool.m4
 cp $ltfile ac-helpers/libtool.m4
+
+### patch the damned libtool relink-on-install code. this will tweak
+### what goes right into the .la files' relink_command=...
+### we want to add parens around the whole command to get it to run
+### in a subshell so that the "cd" is not permanent, and the rest of
+### the install can progress properly.
+echo "Patching ltmain.sh..."
+sed '/relink_command=.*[^(]cd.*mode=relink/s/"\(.*\)"/"(\1)"/' ac-helpers/ltmain.sh > ac-helpers/ltmain.sh.new
+mv ac-helpers/ltmain.sh.new ac-helpers/ltmain.sh
 
 # This is just temporary until people's workspaces are cleared -- remove
 # any old aclocal.m4 left over from prior build so it doesn't cause errors.
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 14:06:37 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)
@@ -120,6 +124,10 @@
   else
      args="--disable-shared"
   fi
+
+  # neon uses an old autoconf which does not understand the -C and
+  # --config-cache arguments. strip them from the args passed down.
+  ac_configure_args="`echo $ac_configure_args | sed 's/-C//' | sed 's/--config-cache//'`"
   APR_SUBDIR_CONFIG(neon, $args --with-expat="$abs_srcdir/expat-lite/libexpat.la")
 
   AC_MSG_CHECKING([for any extra libraries neon needs])
@@ -136,7 +144,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 +290,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


