]> granicus.if.org Git - php/commit
Disable PACKAGE_* preprocessor symbols
authorPeter Kokot <peterkokot@gmail.com>
Tue, 9 Apr 2019 23:04:02 +0000 (01:04 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Sat, 13 Apr 2019 05:00:17 +0000 (07:00 +0200)
commit69b20f51e15d535da77f830709a4f1b5a682c265
treec9819130681eca73f1c9d03dbb3a2dad277c3d15
parent769db42341845544eebd4c939ecdaf87ce711d85
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.
build/build2.mk
ext/mbstring/libmbfl/config.h.in
ext/pcre/pcre2lib/config.h
ext/pcre/upgrade-pcre.php
ext/pdo_pgsql/pdo_pgsql.c
ext/pdo_pgsql/pgsql_driver.c
ext/pgsql/pgsql.c
scripts/phpize.in