summaryrefslogtreecommitdiff
path: root/buildconf
diff options
context:
space:
mode:
Diffstat (limited to 'buildconf')
-rwxr-xr-xbuildconf42
1 files changed, 36 insertions, 6 deletions
diff --git a/buildconf b/buildconf
index 87fda4fc59..f3ce3e6ca5 100755
--- a/buildconf
+++ b/buildconf
@@ -78,6 +78,42 @@ if test "$dev" = "0" -a "$force" = "0"; then
fi
fi
+if test "$force" = "1"; then
+ echo "buildconf: Forcing buildconf"
+ echo "buildconf: Removing configure caches and files"
+ rm -rf autom4te.cache config.cache configure
+fi
+
+echo "buildconf: Checking installation"
+
+# Get minimum required autoconf version from the configure.ac file.
+min_version=$(sed -n 's/AC_PREREQ(\[\(.*\)\])/\1/p' configure.ac)
+
+# Check if autoconf exists.
+ac_version=$($PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//')
+
+if test -z "$ac_version"; then
+ echo "buildconf: autoconf not found." >&2
+ echo " You need autoconf version $min_version or newer installed" >&2
+ echo " to build PHP from Git." >&2
+ exit 1
+fi
+
+# Check autoconf version.
+set -f; IFS='.'; set -- $ac_version; set +f; IFS=' '
+ac_version_num="$(expr ${1} \* 10000 + ${2} \* 100)"
+set -f; IFS='.'; set -- $min_version; set +f; IFS=' '
+min_version_num="$(expr ${1} \* 10000 + ${2} \* 100)"
+
+if test "$ac_version_num" -lt "$min_version_num"; then
+ echo "buildconf: autoconf version $ac_version found." >&2
+ echo " You need autoconf version $min_version or newer installed" >&2
+ echo " to build PHP from Git." >&2
+ exit 1
+else
+ echo "buildconf: autoconf version $ac_version (ok)"
+fi
+
# Check if make exists.
if ! test -x "$(command -v $MAKE)"; then
echo "buildconf: make not found." >&2
@@ -85,12 +121,6 @@ if ! test -x "$(command -v $MAKE)"; then
exit 1
fi
-if test "$force" = "1"; then
- echo "buildconf: Forcing buildconf"
- echo "buildconf: Removing configure caches and files"
- rm -rf autom4te.cache config.cache configure
-fi
-
echo "buildconf: Building configure files"
if test "$debug" = "1"; then