php-src/build
Hans Krentel (hakre) c075546320
Fail early in *nix configuration build script
Adding two exit early safeguards in the *nix configuration build script:

1) Given the initial cd into the build tree fails (the project root),
   the `buildconf` script exits with non-zero status (failure).
2) Given the grep command does not exist or `configure.ac` AC_INIT [1]
   expectations are unmet, the buildconf script exits non-zero.

Additionally quoting the pathname to cd into and the empty CD_PATH
parameter for portability, also for systems that are using a
non-portable pathname [2] for the build tree.

The initial CD safeguard has been applied to the `buildconf` and
four more scripts:

- build/genif.sh
- scripts/dev/credits
- scripts/dev/genfiles
- scripts/dev/makedist

Rationale:

Cd-ing into the project root should always prematurely exit w/ FAILURE
as a required precondition for its invocation has not been met. This
should never go unnoticed as it always requires user intervention.

Similar and more specifically to the PHP build on *nix systems, the
grep command is required early to obtain the `php_extra_version` from
configure.ac.  Previously, if the grep command is missing (or failing
due to not matching the line with the AC_INIT macro [1]), the internal
dev parameter would always be zero (0) which can easily result in the
situation that the configure script is not being rebuilt. This is
cumbersome as the rebuild of a configure script is more likely required
with checked-out dev versions under change rather than an already
properly set-up build environment on a dedicated build or release
system. Missing the fact that either the grep utility is missing or
the expectation of having the AC_INIT macro in configure.ac is unmet
should never go unnoticed as it always requires user intervention.

[1]: https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Initializing-configure.html
[2]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271

Closes GH-16717.
2024-11-09 14:03:04 +01:00
..
ax_check_compile_flag.m4 Upgrade AX_CHECK_COMPILE_FLAG macro to serial 6 2018-07-28 01:40:02 +02:00
ax_func_which_gethostbyname_r.m4 Move Autoconf Archive macros to a common m4 dir 2019-04-23 20:37:31 +02:00
ax_gcc_func_attribute.m4 Fix AX_GCC_FUNC_ATTRIBUTE failure 2024-03-22 11:29:45 +01:00
config-stubs Remove unused Git attributes ident 2018-07-25 00:53:25 +02:00
config.guess Merge branch 'PHP-8.0' into PHP-8.1 2021-10-07 17:03:32 +01:00
config.sub Merge branch 'PHP-8.0' into PHP-8.1 2021-10-07 17:03:32 +01:00
gen_stub.php Fix gen_stub.php errors (#14335) 2024-05-27 22:46:50 +02:00
genif.sh Fail early in *nix configuration build script 2024-11-09 14:03:04 +01:00
libtool.m4 Fix GH-13727: Building with -Werror=strict-prototypes (#14029) 2024-04-22 21:21:40 +02:00
ltmain.sh Fix GH-13727: macro generating invalid call test prototypes fixes. 2024-03-18 06:53:39 +00:00
Makefile.gcov Unbundle ext/xmlrpc 2020-05-29 16:47:44 +02:00
Makefile.global Set libtool tag per command instead of global one 2024-01-10 09:09:45 +01:00
order_by_dep.awk Fix PHP_ADD_EXTENSION_DEP without indentation 2021-06-10 11:48:25 +02:00
php_cxx_compile_stdcxx.m4 Fix erroneous dnl appended in configure (#14013) 2024-04-21 17:23:22 +02:00
php.m4 Do not remove -O0 in the middle of a flag 2024-09-12 13:08:54 +02:00
pkg.m4 Fix FSF address & update year to 2022 2022-03-19 18:25:29 +01:00
print_include.awk
shtool Fix FSF address & update year to 2022 2022-03-19 18:25:29 +01:00