You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Greg Hudson <gh...@mit.edu> on 2001/01/27 06:22:17 UTC

APR buildconf and libtool

APR's buildconf has (Greg Stein wrote this):

	ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4

This doesn't work for me; I have libtool installed with exec_prefix
different from prefix.

Here is my proposed fix.  It's much grosser in that it parses
human-readable libtoolize output which could easily change form in a
future version of libtool (libtoolize really ought to have a way of
asking for it in machine-readable form), but it's much cleaner in that
it doesn't make assumptions about how libtool was installed.

Incidentally, perhaps buildconf should nuke ltconfig and ltmain.sh
before running libtoolize, to ensure consistency.  (Then again,
buildconf shouldn't have to know the list of files which will be
copied, especially since ltconfig is going away in the next version of
libtool.)

Index: buildconf
===================================================================
RCS file: /home/cvspublic/apr/buildconf,v
retrieving revision 1.6
diff -u -r1.6 buildconf
--- buildconf	2001/01/09 11:05:34	1.6
+++ buildconf	2001/01/27 05:17:20
@@ -1,25 +1,23 @@
 #!/bin/sh
 
 #
-# Build aclocal.m4 from libtool's libtool.m4 and our own M4 files.
-#
-ltpath=`helpers/PrintPath libtoolize`
-ltpath=`dirname $ltpath`
-ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4
-echo "Incorporating $ltfile into aclocal.m4 ..."
-echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf" > aclocal.m4
-echo "dnl edits here will be lost" >> aclocal.m4
-cat helpers/apr-conf.m4 apr_common.m4 hints.m4 $ltfile >> aclocal.m4
-
-#
 # Create the libtool helper files
+# Remember where it says libtool.m4 is (there ought to be a better way...)
 #
 # Note: we copy (rather than link) them to simplify distribution.
 # Note: APR supplies its own config.guess and config.sub -- we do not
 #       rely on libtool's versions
 #
 echo "Copying libtool helper files ..."
-$ltpath/libtoolize --copy
+ltfile=`libtoolize --copy | sed -ne '1s,^[^/]*\(/.*libtool.m4\).*$,\1,p'`
+
+#
+# Build aclocal.m4 from libtool's libtool.m4 and our own M4 files.
+#
+echo "Incorporating $ltfile into aclocal.m4 ..."
+echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf" > aclocal.m4
+echo "dnl edits here will be lost" >> aclocal.m4
+cat helpers/apr-conf.m4 apr_common.m4 hints.m4 $ltfile >> aclocal.m4
 
 #
 # Generate the autoconf header and ./configure