[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: updated autoconf patch

From: Mo DeJong <supermo_at_bayarea.net>
Date: 2001-10-03 04:49:17 CEST

On Thu, 27 Sep 2001 17:23:20 -0700
Mo DeJong <supermo@bayarea.net> wrote:
 
> Here is an updated patch for switching to autoconf 2.52/libtool 1.4.

Ok, here is the most up to date autoconf/libtool upgrade patch.
Now that neon has a autogen.sh script we should be able to use
autoconf 2.5X and libtool 1.4.X with no problems. (I know,
I know, you have heard that one before)

Mo

2001-10-02 Mo DeJong <supermo@bayarea.net>

        Upgrade subversion to libtool 1.4 and autoconf 2.50.

        * ac-helpers/berkeley-db.m4: Link to the db .la file
        when building a shared version.
        * autogen.sh: Run local buildcheck.sh script instead of
        depending on the apr provided one. We now require a minimum
        or autoconf 2.50 and libtool 1.4 so the apr provided script
        is no longer sufficient.
        Run libtoolize without the --automake flag since we
        no longer use automake. Remove generated libtool files
        before running libtoolize to avoid libtool error when
        regenerated with libtool 1.4 after being generated with 1.3.
        * gen-make.py: Avoid linking in libtool .libs directories,
        instead link to the .la files directly. This .libs hack
        was needed since libtool 1.3 did not support dependencies
        correctly. Do a cd before installing .la files to work
        around a bug in libtool 1.4.2 which can cause a relink
        of a .la file to fail.
        * build.conf: Avoid linking in libtool .libs directories,
        link to the .la file instead.
        * configure.in: Avoid linking in libtool .libs directories,
        link to the .la file instead. Require autoconf 2.50 or newer.
        * buildcheck.sh: Adapt apr/build/buildcheck.sh script
        to require autoconf 2.50 and libtool 1.4 or newer.

Index: ./ac-helpers/berkeley-db.m4
===================================================================
--- ./ac-helpers/SVN/text-base/berkeley-db.m4 Thu Sep 27 16:26:10 2001
+++ ./ac-helpers/berkeley-db.m4 Tue Oct 2 18:47:33 2001
@@ -97,10 +97,10 @@
     dbdir=`cd db/dist ; pwd`
     SVN_DB_INCLUDES="-I$dbdir"
     svn_lib_berkeley_db=yes
+ # Linking directly to the .la is broken with --disable-shared
+ # because Berkeley db does not seem to generate a .la library.
     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"
+ SVN_DB_LIBS="$dbdir/libdb-3.3.la"
     else
         SVN_DB_LIBS="-L$dbdir -ldb"
     fi
@@ -167,7 +167,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 +198,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 27 13:10:13 2001
+++ ./gen-make.py Thu Sep 27 16:16:34 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),
@@ -197,12 +189,16 @@
       for file in la_tweaked:
         dirname, fname = os.path.split(file)
         base = os.path.splitext(fname)[0]
+ # cd to dirname before install to work around libtool 1.4.2 bug.
         ofile.write('\t$(INSTALL_MOD_STATIC) %s %s\n'
- '\t$(INSTALL_MOD_STATIC) %s %s\n'
+ '\tcd %s ; $(INSTALL_MOD_STATIC) %s %s\n'
                     % (os.path.join(dirname, '.libs', base + '.a'),
                        os.path.join('$(APACHE_TARGET)', '.libs', base + '.a'),
- file,
+ dirname,
+ (base + '.la'),
                        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)',
@@ -215,10 +211,13 @@
                   '\t$(MKDIR) $(%sdir)\n'
                   % (area, string.join(files), area_var))
       for file in files:
- ofile.write('\t$(INSTALL_%s) %s %s\n'
- % (string.upper(area_var), file,
- os.path.join('$(%sdir)' % area_var,
- os.path.basename(file))))
+ # cd to dirname before install to work around libtool 1.4.2 bug.
+ dirname, fname = os.path.split(file)
+ ofile.write('\tcd %s ; $(INSTALL_%s) %s %s\n'
+ % (dirname,
+ string.upper(area_var),
+ fname,
+ os.path.join('$(%sdir)' % area_var, fname)))
       ofile.write('\n')
 
   includes, i_errors = _collect_paths(parser.get('includes', 'paths'))
Index: ./autogen.sh
===================================================================
--- ./SVN/text-base/autogen.sh Tue Oct 2 18:14:28 2001
+++ ./autogen.sh Tue Oct 2 12:39:33 2001
@@ -5,6 +5,7 @@
 # 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 \
@@ -65,10 +66,8 @@
 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
 
 
 #
@@ -85,7 +84,11 @@
     exit 1
 fi
 
-$libtoolize --copy --automake
+# Remove libtool generated files to avoid warning about
+# overwriting and to avoid leaving old libtool 1.3 files
+# lying around after upgrading to libtool 1.4.
+(cd ac-helpers ; rm -f ltconfig ltmain.sh libtool.m4)
+$libtoolize --copy
 
 ltpath=`dirname $libtoolize`
 ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4
@@ -95,7 +98,6 @@
     exit 1
 fi
 
-rm -f ac-helpers/libtool.m4
 cp $ltfile ac-helpers/libtool.m4
 
 # This is just temporary until people's workspaces are cleared -- remove
Index: ./build.conf
===================================================================
--- ./SVN/text-base/build.conf Thu Sep 27 13:10:12 2001
+++ ./build.conf Thu Sep 27 15:56:28 2001
@@ -103,7 +103,7 @@
 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 27 13:10:11 2001
+++ ./configure.in Tue Oct 2 18:13:21 2001
@@ -4,6 +4,10 @@
 
 dnl General Setup -----------------------
 
+dnl Ensure that subversion is configured with autoconf 2.50 or newer.
+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)
@@ -279,14 +283,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/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/libsvn_ra_local.la \
+ \$(abs_builddir)/subversion/libsvn_repos/libsvn_repos.la \
+ \$(abs_builddir)/subversion/libsvn_fs/libsvn_fs.la \$(SVN_DB_LIBS)"
   fi
 
 fi
Index: ./buildcheck.sh
===================================================================
--- SVN/text-base/buildcheck.sh Tue Oct 2 19:35:10 2001
+++ buildcheck.sh Thu Sep 27 15:30:41 2001
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+echo "buildcheck: 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 "buildcheck: 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 "buildcheck: autoconf version $ac_version found."
+echo " You need autoconf version 2.50 or newer installed."
+exit 1
+else
+echo "buildcheck: 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 "buildcheck: 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 "buildcheck: libtool version $lt_pversion (ok)"
+else
+ echo "buildcheck: libtool version $lt_pversion found."
+ echo " You need libtool version 1.4 or newer installed"
+ exit 1
+fi
+
+exit 0

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:44 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.