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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
#!/bin/sh
force=
autoreconfprog=autoreconf
localdir=.
autoreconfoptions=""
verbose=false
localdirarg=
autoreconf="/bin/sh $autoreconfprog"
# This should prevent autoreconf -- at least, the Debian version -- from
# running aclocal in directories with configure.in but not aclocal.m4, so
# that we can find the top-level one via the --include option.
ACLOCAL=true ; export ACLOCAL
usage="Usage: $0 [--force] [--verbose] [--help]"
for option
do
case "$option" in
--force | -f)
echo "Remaking all configuration files"
force=--force ;;
-help | --help | --hel | --he | --h)
echo "$usage"; exit 0 ;;
-v | --verbose)
verbose=true ;;
*) echo "$usage"; exit 1 ;;
esac
done
# Currently (2003-04-24) we need 2.52 or later.
patb="2.(1[0-9][0-9])|(5[2-9])|([6-9][0-9])"
# sedcmd1 recognizes the older 2.12 version, and sedcmd2 the newer 2.49
sedcmd1="s,.*version \(.*\)$,\1,"
sedcmd2="s,.*) \(.*\)$,\1,;1q"
if autoreconf --version | sed -e "$sedcmd1" -e "$sedcmd2" | egrep "$patb" >/dev/null && \
autoconf --version | sed -e "$sedcmd1" -e "$sedcmd2" | egrep "$patb" >/dev/null && \
autoheader --version | sed -e "$sedcmd1" -e "$sedcmd2" | egrep "$patb" >/dev/null; then
autoreconf=autoreconf
autoreconfoptions=
autoconfversion=`autoconf --version | sed -e "$sedcmd1" -e "$sedcmd2"`
echo "Using autoconf version $autoconfversion found in your path..."
localdir=`pwd`
# Determine if we need to patch autoreconf for 2.53
case "$autoconfversion" in
2.52)
echo "WARNING: autoconf 2.52 is known to generate buggy configure scripts!"
;;
2.53)
echo "Patching autoreconf"
# Walk the path to find autoreconf
autoreconfpath=
for i in `echo $PATH | sed -e 's/:/ /g'` ; do
if test -r $i/autoreconf; then
autoreconfpath=$i/autoreconf
break
fi
done
if test "x$autoreconfpath" = "x" ; then
echo "Could not find autoreconf executable!!!"
exit
fi
echo "About to patch $autoreconfpath to ..."
TMPCMD=/tmp/autoreconf$$
sed -e 's/push @ARGV, $_;/push @ARGV, catfile ($directory, $_);/' $autoreconfpath > $TMPCMD
autoreconf="/bin/sh $TMPCMD"
trap "rm $TMPCMD" 0
;;
*)
;;
esac
# Determine the proper argument to autoreconf
case "$autoconfversion" in
2.1*)
localdirarg="-l"
;;
2.5[23])
localdirarg="-l"
;;
*)
localdirarg="-I"
;;
esac
else
echo "Couldn't find autoconf 2.52 or higher in your path."
echo " "
echo "Please install or add to your path and re-run ./util/reconf"
exit 1
fi
if $verbose ; then
echo $autoreconf $autoreconfoptions $localdirarg $localdir --verbose $force
fi
$autoreconf $autoreconfoptions $localdirarg $localdir --verbose $force || exit 1
if test $? = 0 ; then
if test ! -d include/autoconf.stmp ; then
cp /dev/null include/autoconf.stmp
fi
fi
find . -name autom4te.cache -print | xargs rm -rf
|