Skip to content

Commit c79eb10

Browse files
committed
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.
1 parent b931dac commit c79eb10

File tree

6 files changed

+39
-92
lines changed

6 files changed

+39
-92
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@
3838
# Standard object files generated during build process
3939
*.o
4040

41-
# Cache directories generated by Autoconf tools - autoconf, autoreconf...
41+
# Cache directories created by Autoconf tools
4242
autom4te.cache/
4343

44-
# Stamp file generated by `./buildconf` to run `./build/buildcheck.sh`
45-
/buildmk.stamp
46-
4744
# Cache file(s) generated by Autoconf's configure when run as `configure -C`
4845
config.cache
4946

build/Makefile.global

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ clean:
118118
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
119119

120120
distclean: clean
121-
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
121+
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
122122
rm -f main/build-defs.h scripts/phpize
123123
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
124124
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

build/build.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919
#
2020

2121
subdirs = Zend TSRM
22-
stamp = buildmk.stamp
2322
config_h_in = main/php_config.h.in
2423
PHP_AUTOCONF = autoconf
2524
PHP_AUTOHEADER = autoheader
2625
PHP_AUTOCONF_FLAGS = -f
2726

28-
all: $(stamp) configure $(config_h_in)
29-
30-
$(stamp): build/buildcheck.sh
31-
@build/buildcheck.sh $@
27+
all: configure $(config_h_in)
3228

3329
configure: configure.ac $(PHP_M4_FILES)
3430
# Remove aclocal.m4 if present. It is automatically included by autoconf but

build/buildcheck.sh

Lines changed: 0 additions & 72 deletions
This file was deleted.

buildconf

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,49 @@ if test "$dev" = "0" -a "$force" = "0"; then
7878
fi
7979
fi
8080

81+
if test "$force" = "1"; then
82+
echo "buildconf: Forcing buildconf"
83+
echo "buildconf: Removing configure caches and files"
84+
rm -rf autom4te.cache config.cache configure
85+
fi
86+
87+
echo "buildconf: Checking installation"
88+
89+
# Get minimum required autoconf version from the configure.ac file.
90+
min_version=$(sed -n 's/AC_PREREQ(\[\(.*\)\])/\1/p' configure.ac)
91+
92+
# Check if autoconf exists.
93+
ac_version=$($PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//')
94+
95+
if test -z "$ac_version"; then
96+
echo "buildconf: autoconf not found." >&2
97+
echo " You need autoconf version $min_version or newer installed" >&2
98+
echo " to build PHP from Git." >&2
99+
exit 1
100+
fi
101+
102+
# Check autoconf version.
103+
set -f; IFS='.'; set -- $ac_version; set +f; IFS=' '
104+
ac_version_num="$(expr ${1} \* 10000 + ${2} \* 100)"
105+
set -f; IFS='.'; set -- $min_version; set +f; IFS=' '
106+
min_version_num="$(expr ${1} \* 10000 + ${2} \* 100)"
107+
108+
if test "$ac_version_num" -lt "$min_version_num"; then
109+
echo "buildconf: autoconf version $ac_version found." >&2
110+
echo " You need autoconf version $min_version or newer installed" >&2
111+
echo " to build PHP from Git." >&2
112+
exit 1
113+
else
114+
echo "buildconf: autoconf version $ac_version (ok)"
115+
fi
116+
81117
# Check if make exists.
82118
if ! test -x "$(command -v $MAKE)"; then
83119
echo "buildconf: make not found." >&2
84120
echo " You need to have make installed to build PHP." >&2
85121
exit 1
86122
fi
87123

88-
if test "$force" = "1"; then
89-
echo "buildconf: Forcing buildconf"
90-
echo "buildconf: Removing configure caches and files"
91-
rm -rf autom4te.cache config.cache configure
92-
fi
93-
94124
echo "buildconf: Building configure files"
95125

96126
if test "$debug" = "1"; then

scripts/dev/makedist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ done
7878
set -x
7979
./buildconf --force
8080

81-
# remove buildmk.stamp. Otherwise, buildcheck.sh might not be run,
82-
# when a user runs buildconf in the distribution.
83-
rm -f buildmk.stamp
84-
8581
# Generate lexer and parser files
8682
./scripts/dev/genfiles
8783
exit_code=$?

0 commit comments

Comments
 (0)