blob: 0cbc0e07a97b644d7ea1dfdd23458f6c7e5f8c90 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
--- ./apr-0.9.20/buildconf.orig 2006-09-20 16:04:09.000000000 +0000
+++ ./apr-0.9.20/buildconf 2010-10-20 21:08:11.863623823 +0000
@@ -23,7 +23,7 @@
#
build/buildcheck.sh || exit 1
-libtoolize=`build/PrintPath glibtoolize libtoolize`
+libtoolize="${LIBTOOLIZE}"
if [ "x$libtoolize" = "x" ]; then
echo "libtoolize not found in path"
exit 1
@@ -35,29 +35,48 @@
# Note: APR supplies its own config.guess and config.sub -- we do not
# rely on libtool's versions
#
-echo "Copying libtool helper files ..."
+echo "buildconf: copying libtool helper files using $libtoolize"
# Remove any libtool files so one can switch between libtool 1.3
# and libtool 1.4 by simply rerunning the buildconf script.
-(cd build ; rm -f ltconfig ltmain.sh libtool.m4)
-
-$libtoolize --copy --automake
-
-ltpath=`dirname $libtoolize`
-ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
+(cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4)
-if [ ! -f $ltfile ]; then
+lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
+lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
+IFS=.; set $lt_version; IFS=' '
+if test "$1" = "1"; then
+ $libtoolize --copy --automake
+ if [ -f libtool.m4 ]; then
+ ltfile=`pwd`/libtool.m4
+ else
+ ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \
+ < $libtoolize`"
+ ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`}
+ # Expecting the code above to be very portable, but just in case...
+ if [ -z "$ltfile" -o ! -f "$ltfile" ]; then
+ ltpath=`dirname $libtoolize`
+ ltfile=${LIBTOOL_M4}
+ fi
+ fi
+ if [ ! -f $ltfile ]; then
echo "$ltfile not found"
exit 1
+ fi
+ # Do we need this anymore?
+ echo "buildconf: Using libtool.m4 at ${ltfile}."
+ cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
+fi
+if test "$1" = "2"; then
+ $libtoolize --copy
+ # Wouldn't it just be better to define top_builddir??
+ mv build/libtool.m4 build/libtool.m4.$$
+ cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
+ chmod 664 build/libtool.m4.$$
+ rm build/libtool.m4.$$
fi
-echo "buildconf: Using libtool.m4 at ${ltfile}."
-
-cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
-
-# 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.
-rm -f aclocal.m4
+# Clean up any leftovers
+rm -f aclocal.m4 libtool.m4
#
# Generate the autoconf header and ./configure
|