Joe Orton 6b92a8
--- apr-1.4.2/buildconf.libtool
Joe Orton 6b92a8
+++ apr-1.4.2/buildconf
Joe Orton 6b92a8
@@ -40,25 +40,20 @@ fi
Joe Orton 6b92a8
 # Note: APR supplies its own config.guess and config.sub -- we do not
Joe Orton 6b92a8
 #       rely on libtool's versions
Joe Orton 6b92a8
 #
Joe Orton 6b92a8
-echo "Copying libtool helper files ..."
Joe Orton 6b92a8
+echo "buildconf: copying libtool helper files using $libtoolize"
Joe Orton 6b92a8
 
Joe Orton 6b92a8
 # Remove any libtool files so one can switch between libtool 1.3
Joe Orton 6b92a8
 # and libtool 1.4 by simply rerunning the buildconf script.
Joe Orton 6b92a8
-(cd build ; rm -f ltconfig ltmain.sh libtool.m4)
Joe Orton 6b92a8
+(cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4)
Joe Orton 6b92a8
 
Joe Orton 6b92a8
-$libtoolize --copy --automake --force $verbose
Joe Orton 6b92a8
-
Joe Orton 6b92a8
-if [ -f libtool.m4 ]; then 
Joe Orton 6b92a8
-   ltfile=`pwd`/libtool.m4
Joe Orton 6b92a8
-elif grep all_pkgmacro_files $libtoolize > /dev/null; then
Joe Orton 6b92a8
-    # libtool 2.x
Joe Orton 6b92a8
-   aclocal_dir=`sed -n '/^aclocaldir=/{s/.*=//;p;q;}' < $libtoolize`
Joe Orton 6b92a8
-   ltfiles=`sed -n '/^all_pkgmacro_files=/{s/.*=//;;s/"//;p;q;}' < $libtoolize`
Joe Orton 6b92a8
-   for f in $ltfiles; do
Joe Orton 6b92a8
-       test -f "$aclocal_dir/$f" && cp "$aclocal_dir/$f" build
Joe Orton 6b92a8
-   done
Joe Orton 6b92a8
-   ltfile=$aclocal_dir/libtool.m4
Joe Orton 6b92a8
-else
Joe Orton 6b92a8
+lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
Joe Orton 6b92a8
+lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
Joe Orton 6b92a8
+IFS=.; set $lt_version; IFS=' '
Joe Orton 6b92a8
+if test "$1" = "1"; then
Joe Orton 6b92a8
+  $libtoolize --copy --automake $verbose
Joe Orton 6b92a8
+  if [ -f libtool.m4 ]; then 
Joe Orton 6b92a8
+    ltfile=`pwd`/libtool.m4
Joe Orton 6b92a8
+  else
Joe Orton 6b92a8
    ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \
Joe Orton 6b92a8
                    < $libtoolize`"
Joe Orton 6b92a8
    ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`}
Joe Orton 6b92a8
@@ -67,21 +62,22 @@ else
Joe Orton 6b92a8
      ltpath=`dirname $libtoolize`
Joe Orton 6b92a8
      ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4
Joe Orton 6b92a8
    fi
Joe Orton 6b92a8
-fi
Joe Orton 6b92a8
-  
Joe Orton 6b92a8
-if [ ! -f $ltfile ]; then
Joe Orton 6b92a8
+  fi
Joe Orton 6b92a8
+  if [ ! -f $ltfile ]; then
Joe Orton 6b92a8
     echo "$ltfile not found"
Joe Orton 6b92a8
     exit 1
Joe Orton 6b92a8
+  fi
Joe Orton 6b92a8
+  # Do we need this anymore?
Joe Orton 6b92a8
+  echo "buildconf: Using libtool.m4 at ${ltfile}."
Joe Orton 6b92a8
+  rm -f build/libtool.m4
Joe Orton 6b92a8
+  cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
Joe Orton 6b92a8
 fi
Joe Orton 6b92a8
-
Joe Orton 6b92a8
-echo "buildconf: Using libtool.m4 at ${ltfile}."
Joe Orton 6b92a8
-
Joe Orton 6b92a8
-cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
Joe Orton 6b92a8
-
Joe Orton 6b92a8
-# libtool.m4 from 1.6 requires ltsugar.m4
Joe Orton 6b92a8
-if [ -f ltsugar.m4 ]; then
Joe Orton 6b92a8
-   rm -f build/ltsugar.m4
Joe Orton 6b92a8
-   mv ltsugar.m4 build/ltsugar.m4
Joe Orton 6b92a8
+if test "$1" = "2"; then
Joe Orton 6b92a8
+  $libtoolize --copy --automake $verbose
Joe Orton 6b92a8
+  # Wouldn't it just be better to define top_builddir??
Joe Orton 6b92a8
+  mv build/libtool.m4 build/libtool.m4.$$
Joe Orton 6b92a8
+  cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
Joe Orton 6b92a8
+  rm -f build/libtool.m4.$$
Joe Orton 6b92a8
 fi
Joe Orton 6b92a8
 
Joe Orton 6b92a8
 # Clean up any leftovers
Joe Orton 6b92a8
@@ -90,22 +86,22 @@ rm -f aclocal.m4 libtool.m4
Joe Orton 6b92a8
 #
Joe Orton 6b92a8
 # Generate the autoconf header and ./configure
Joe Orton 6b92a8
 #
Joe Orton 6b92a8
-echo "Creating include/arch/unix/apr_private.h.in ..."
Joe Orton 6b92a8
+echo "buildconf: creating include/arch/unix/apr_private.h.in ..."
Joe Orton 6b92a8
 ${AUTOHEADER:-autoheader} $verbose
Joe Orton 6b92a8
 
Joe Orton 6b92a8
-echo "Creating configure ..."
Joe Orton 6b92a8
+echo "buildconf: creating configure ..."
Joe Orton 6b92a8
 ### do some work to toss config.cache?
Joe Orton 6b92a8
 ${AUTOCONF:-autoconf} $verbose
Joe Orton 6b92a8
 
Joe Orton 6b92a8
 # Remove autoconf 2.5x's cache directory
Joe Orton 6b92a8
 rm -rf autom4te*.cache
Joe Orton 6b92a8
 
Joe Orton 6b92a8
-echo "Generating 'make' outputs ..."
Joe Orton 6b92a8
+echo "buildconf: generating 'make' outputs ..."
Joe Orton 6b92a8
 build/gen-build.py $verbose make
Joe Orton 6b92a8
 
Joe Orton 6b92a8
 # Create RPM Spec file
Joe Orton 6b92a8
 if [ -f `which cut` ]; then
Joe Orton 6b92a8
-  echo rebuilding rpm spec file
Joe Orton 6b92a8
+  echo "buildconf: rebuilding rpm spec file"
Joe Orton 6b92a8
   ( REVISION=`build/get-version.sh all include/apr_version.h APR`
Joe Orton 6b92a8
     VERSION=`echo $REVISION | cut -d- -s -f1`
Joe Orton 6b92a8
     RELEASE=`echo $REVISION | cut -d- -s -f2`