Skip to content

Commit 84656f1

Browse files
committed
add checks for autoconf, automake and whether libzend/TSRM is around
1 parent f5bfd16 commit 84656f1

File tree

1 file changed

+71
-7
lines changed

1 file changed

+71
-7
lines changed

buildconf

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,85 @@
11
#!/bin/sh
22

3+
# do some version checking for the tools we use
4+
if test "$1" = "--force"; then
5+
shift
6+
else
7+
echo "buildconf: checking installation..."
8+
9+
# autoconf 2.13 or newer
10+
ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
11+
if test "$ac_version" = ""; then
12+
echo "buildconf: autoconf not found."
13+
echo " You need autoconf version 2.13 or newer installed"
14+
echo " to build PHP from CVS."
15+
exit 1
16+
fi
17+
IFS=.; set $ac_version; IFS=' '
18+
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
19+
echo "buildconf: autoconf version $ac_version found."
20+
echo " You need autoconf version 2.13 or newer installed"
21+
echo " to build PHP from CVS."
22+
exit 1
23+
else
24+
echo "buildconf: autoconf version $ac_version (ok)"
25+
fi
26+
27+
# automake 1.4 or newer
28+
am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
29+
if test "$am_version" = ""; then
30+
echo "buildconf: automake not found."
31+
echo " You need automake version 1.4 or newer installed"
32+
echo " to build PHP from CVS."
33+
exit 1
34+
fi
35+
IFS=.; set $am_version; IFS=' '
36+
if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
37+
echo "buildconf: automake version $ac_version found."
38+
echo " You need automake version 1.4 or newer installed"
39+
echo " to build PHP from CVS."
40+
exit 1
41+
else
42+
echo "buildconf: automake version $am_version (ok)"
43+
fi
44+
45+
# The stuff from libtool we need is in CVS right now, so it is
46+
# not required to run buildconf.
47+
fi
48+
349
if test "$1" = "--copy"; then
4-
automake_flags=--copy
50+
automake_flags=--copy
551
fi
652

7-
test -d libzend || ln -s ../libzend .
8-
test -d TSRM || ln -s ../TSRM .
53+
if ! test -d libzend; then
54+
if test -d ../libzend; then
55+
echo "buildconf: linking ../libzend to ./libzend"
56+
ln -s ../libzend .
57+
else
58+
echo "buildconf: can not find libzend"
59+
echo " libzend should be installed in . or .."
60+
exit 1
61+
fi
62+
fi
63+
if ! test -d TSRM; then
64+
if test -d ../TSRM; then
65+
echo "buildconf: linking ../TSRM to ./TSRM"
66+
ln -s ../TSRM .
67+
else
68+
echo "buildconf: can not find TSRM"
69+
echo " TSRM should be installed in . or .."
70+
exit 1
71+
fi
72+
fi
973

1074
./scripts/preconfig
1175

1276
mv aclocal.m4 aclocal.m4.old 2>/dev/null
1377
aclocal
1478
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
15-
echo keeping aclocal.m4
79+
echo "buildconf: keeping aclocal.m4"
1680
mv aclocal.m4.old aclocal.m4
1781
else
18-
echo created or modified aclocal.m4
82+
echo "buildconf: created or modified aclocal.m4"
1983
fi
2084

2185
autoheader
@@ -25,10 +89,10 @@ automake --add-missing --include-deps $automake_flags
2589
mv configure configure.old 2>/dev/null
2690
autoconf
2791
if cmp configure.old configure > /dev/null 2>&1; then
28-
echo keeping configure
92+
echo "buildconf: keeping configure"
2993
mv configure.old configure
3094
else
31-
echo created or modified configure
95+
echo "buildconf: created or modified configure"
3296
fi
3397

3498
(cd libzend; ./buildconf libzend/)

0 commit comments

Comments
 (0)