summaryrefslogtreecommitdiff
path: root/buildconf
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2019-04-27 17:21:56 +0200
committerPeter Kokot <peterkokot@gmail.com>2019-04-29 01:30:27 +0200
commitc79eb107a0f5f4de085b50df5990842bc8202325 (patch)
tree7929628e0f36deaaf840f8ccdfbed60b985b6ce5 /buildconf
parentb931dacc888ed59ccae6598338fe604030c251d6 (diff)
downloadphp-git-c79eb107a0f5f4de085b50df5990842bc8202325.tar.gz
Simplify checking of *nix build tools
The buildmk.stamp file has been created by the *nix build checking step to run the check step only once. Instead of poluting the project root directory, the stamp file can be also omitted. Performance difference is very minimal to not justify having the stamp check at all today anymore. This patch integrates the buildcheck.sh to buildconf script directly.
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