summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2019-04-10 01:04:02 +0200
committerPeter Kokot <peterkokot@gmail.com>2019-04-13 07:00:17 +0200
commit69b20f51e15d535da77f830709a4f1b5a682c265 (patch)
treec9819130681eca73f1c9d03dbb3a2dad277c3d15 /scripts
parent769db42341845544eebd4c939ecdaf87ce711d85 (diff)
downloadphp-git-69b20f51e15d535da77f830709a4f1b5a682c265.tar.gz
Disable PACKAGE_* preprocessor symbols
Autoconf defines PACKAGE_* symbols: - PACKAGE_NAME - PACKAGE_VERSION - PACKAGE_TARNAME - PACKAGE_STRING - PACKAGE_BUGREPORT - PACKAGE_URL and appends them to the generated config.h.in files. With AC_INIT change via afd52f9d9986d92dd0c63832a07ab1a16bf11d53 where package version, URL, bug report location and similar meta data are defined, these preprocessor macros are then non empty strings in the generated configuration header file. When using phpize, PHP shares the config files in extensions, warnings of redefined macros appear, such as: - `warning: 'PACKAGE_NAME' macro redefined` This patch now disables these non utilized symbols in the generated config header files. Better practice would be to include only API specific headers where needed but this would require even more refactorings. Some extensions such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some of these symbols before including the library configuration headers in the code also. Because these symbols can be defined by any library which uses Autotools. Additionally, the unused PACKAGE_* symbols were cleaned for the bundled libmbfl library and with this patch not needed undef code removed.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/phpize.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/phpize.in b/scripts/phpize.in
index 57c09555d2..ccb9357574 100644
--- a/scripts/phpize.in
+++ b/scripts/phpize.in
@@ -160,6 +160,10 @@ phpize_autotools()
{
$PHP_AUTOCONF || exit 1
$PHP_AUTOHEADER || exit 1
+
+ # Disable PACKAGE_* symbols in config.h.in
+ $SED -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < config.h.in > config.h.in.tmp
+ mv config.h.in.tmp config.h.in
}
# Main script