diff options
author | Peter Kokot <peterkokot@gmail.com> | 2019-04-27 17:21:56 +0200 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-04-29 01:30:27 +0200 |
commit | c79eb107a0f5f4de085b50df5990842bc8202325 (patch) | |
tree | 7929628e0f36deaaf840f8ccdfbed60b985b6ce5 | |
parent | b931dacc888ed59ccae6598338fe604030c251d6 (diff) | |
download | php-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.
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | build/Makefile.global | 2 | ||||
-rw-r--r-- | build/build.mk | 6 | ||||
-rwxr-xr-x | build/buildcheck.sh | 72 | ||||
-rwxr-xr-x | buildconf | 42 | ||||
-rwxr-xr-x | scripts/dev/makedist | 4 |
6 files changed, 39 insertions, 92 deletions
diff --git a/.gitignore b/.gitignore index d0aa3b394a..72b591fd69 100644 --- a/.gitignore +++ b/.gitignore @@ -38,12 +38,9 @@ # Standard object files generated during build process *.o -# Cache directories generated by Autoconf tools - autoconf, autoreconf... +# Cache directories created by Autoconf tools autom4te.cache/ -# Stamp file generated by `./buildconf` to run `./build/buildcheck.sh` -/buildmk.stamp - # Cache file(s) generated by Autoconf's configure when run as `configure -C` config.cache diff --git a/build/Makefile.global b/build/Makefile.global index acb9edcff7..4790e75d37 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -118,7 +118,7 @@ clean: rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/* distclean: clean - rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h + rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h rm -f main/build-defs.h scripts/phpize rm -f ext/date/lib/timelib_config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1 diff --git a/build/build.mk b/build/build.mk index 678cbe90af..b246fa7c10 100644 --- a/build/build.mk +++ b/build/build.mk @@ -19,16 +19,12 @@ # subdirs = Zend TSRM -stamp = buildmk.stamp config_h_in = main/php_config.h.in PHP_AUTOCONF = autoconf PHP_AUTOHEADER = autoheader PHP_AUTOCONF_FLAGS = -f -all: $(stamp) configure $(config_h_in) - -$(stamp): build/buildcheck.sh - @build/buildcheck.sh $@ +all: configure $(config_h_in) configure: configure.ac $(PHP_M4_FILES) # Remove aclocal.m4 if present. It is automatically included by autoconf but diff --git a/build/buildcheck.sh b/build/buildcheck.sh deleted file mode 100755 index 6b07f3ae33..0000000000 --- a/build/buildcheck.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -# -# +----------------------------------------------------------------------+ -# | PHP Version 7 | -# +----------------------------------------------------------------------+ -# | Copyright (c) The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.txt | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Authors: Stig Bakken <ssb@php.net> | -# | Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# Check PHP build system tools such as autoconf and their versions. -# -# SYNOPSIS: -# buildcheck.sh [stampfile] -# -# DESCRIPTION: -# Optional stampfile is for Makefile to check build system only once. -# -# ENVIRONMENT: -# The following optional variables are supported: -# -# PHP_AUTOCONF Overrides the path to autoconf tool. -# PHP_AUTOCONF=/path/to/autoconf buildcheck.sh - -echo "buildconf: checking installation..." - -stamp=$1 - -# Allow the autoconf executable to be overridden by $PHP_AUTOCONF. -PHP_AUTOCONF=${PHP_AUTOCONF:-autoconf} - -# Go to project root. -cd $(CDPATH= cd -- "$(dirname -- "$0")/../" && pwd -P) - -# 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 - -test -n "$stamp" && touch $stamp @@ -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 diff --git a/scripts/dev/makedist b/scripts/dev/makedist index 588a7e344b..2bea7c5e80 100755 --- a/scripts/dev/makedist +++ b/scripts/dev/makedist @@ -78,10 +78,6 @@ done set -x ./buildconf --force -# remove buildmk.stamp. Otherwise, buildcheck.sh might not be run, -# when a user runs buildconf in the distribution. -rm -f buildmk.stamp - # Generate lexer and parser files ./scripts/dev/genfiles exit_code=$? |