From 4851ac2e08aaa43933fcc62be293f487bf555c5e Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 18 May 2024 01:22:08 +0200 Subject: [PATCH 1/2] Sync HAVE_* definitions for extensions This syncs missing build system gaps of some extensions' definitions being defined on Windows and some on *nix. To not cause too much divergence with the current default ext/skeleton template, they weren't removed even though they aren't used. Help texts are also synced a bit where possible. * HAVE_INTL (added to Autotools also) * HAVE_PDO_DBLIB (added to Windows build also) * HAVE_PDO_FIREBIRD (added to Windows build also) * HAVE_TOKENIZER (added to Autotools also) --- ext/intl/config.m4 | 2 ++ ext/intl/config.w32 | 2 +- ext/pdo_dblib/config.m4 | 2 +- ext/pdo_dblib/config.w32 | 1 + ext/pdo_firebird/config.m4 | 2 +- ext/pdo_firebird/config.w32 | 1 + ext/tokenizer/config.m4 | 1 + ext/tokenizer/config.w32 | 2 +- 8 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index 78396dc416926..fed465f0fc455 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -117,4 +117,6 @@ if test "$PHP_INTL" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/spoofchecker) PHP_ADD_BUILD_DIR($ext_builddir/breakiterator) PHP_ADD_BUILD_DIR($ext_builddir/uchar) + + AC_DEFINE([HAVE_INTL], [1], [Whether the intl extension is available.]) fi diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index ab7dc42b66246..2d94c20b29715 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -126,7 +126,7 @@ if (PHP_INTL != "no") { } ADD_FLAG("CFLAGS_INTL", "/EHsc /DUNISTR_FROM_CHAR_EXPLICIT=explicit /DUNISTR_FROM_STRING_EXPLICIT=explicit /DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 /DU_HIDE_OBSOLETE_UTF_OLD_H=1"); - AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled"); + AC_DEFINE("HAVE_INTL", 1, "Whether the intl extension is available."); } else { WARNING("intl not enabled; libraries and/or headers not found"); } diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4 index 694c44c7e7ab2..45b3c97a83188 100644 --- a/ext/pdo_dblib/config.m4 +++ b/ext/pdo_dblib/config.m4 @@ -45,7 +45,7 @@ if test "$PHP_PDO_DBLIB" != "no"; then PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_DBLIB_DEFS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) - AC_DEFINE(HAVE_PDO_DBLIB,1,[ ]) + AC_DEFINE([HAVE_PDO_DBLIB], [1], [Whether the pdo_dblib extension is available.]) PHP_SUBST(PDO_DBLIB_SHARED_LIBADD) PHP_ADD_EXTENSION_DEP(pdo_dblib, pdo) diff --git a/ext/pdo_dblib/config.w32 b/ext/pdo_dblib/config.w32 index 4b1c76130f525..edf546dd6005c 100644 --- a/ext/pdo_dblib/config.w32 +++ b/ext/pdo_dblib/config.w32 @@ -13,6 +13,7 @@ if (PHP_PDO_DBLIB != "no") { EXTENSION("pdo_dblib", "pdo_dblib.c dblib_driver.c dblib_stmt.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_FLAG('CFLAGS_PDO_DBLIB', "/D PDO_DBLIB_FLAVOUR=\\\"freetds\\\""); ADD_EXTENSION_DEP('pdo_dblib', 'pdo'); + AC_DEFINE('HAVE_PDO_DBLIB', 1, 'Whether the pdo_dblib extension is available.'); } else { WARNING("pdo_dblib not enabled, libraries or headers not found") } diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index 594e7c220ecf1..5be5a528d9051 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -60,7 +60,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then PHP_CHECK_PDO_INCLUDES - AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ]) + AC_DEFINE([HAVE_PDO_FIREBIRD], [1], [Whether the pdo_firebird extension is available.]) PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_cv_inc_path) PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD) PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo) diff --git a/ext/pdo_firebird/config.w32 b/ext/pdo_firebird/config.w32 index 634ac4c8e984c..90215cc91b0dc 100644 --- a/ext/pdo_firebird/config.w32 +++ b/ext/pdo_firebird/config.w32 @@ -11,6 +11,7 @@ if (PHP_PDO_FIREBIRD != "no") { ) { EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c"); + AC_DEFINE('HAVE_PDO_FIREBIRD', 1, 'Whether the pdo_firebird extension is available.'); } else { WARNING("pdo_firebird not enabled; libraries and headers not found"); } diff --git a/ext/tokenizer/config.m4 b/ext/tokenizer/config.m4 index e607fe50fc3e0..2945ec1e0a96f 100644 --- a/ext/tokenizer/config.m4 +++ b/ext/tokenizer/config.m4 @@ -7,4 +7,5 @@ PHP_ARG_ENABLE([tokenizer], if test "$PHP_TOKENIZER" != "no"; then PHP_NEW_EXTENSION(tokenizer, tokenizer.c tokenizer_data.c, $ext_shared) PHP_ADD_MAKEFILE_FRAGMENT + AC_DEFINE([HAVE_TOKENIZER], [1], [Whether the tokenizer extension is available.]) fi diff --git a/ext/tokenizer/config.w32 b/ext/tokenizer/config.w32 index ee98c0cc138a4..f461d7b69de81 100644 --- a/ext/tokenizer/config.w32 +++ b/ext/tokenizer/config.w32 @@ -4,5 +4,5 @@ ARG_ENABLE("tokenizer", "tokenizer support", "yes"); if (PHP_TOKENIZER == "yes") { EXTENSION("tokenizer", "tokenizer.c tokenizer_data.c"); - AC_DEFINE("HAVE_TOKENIZER", 1, "Tokenizer support"); + AC_DEFINE("HAVE_TOKENIZER", 1, "Whether the tokenizer extension is available."); } From ddeae9a2c8e47d72864ad7426ee253788496dd5e Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 18 May 2024 01:52:21 +0200 Subject: [PATCH 2/2] Remove unsynced and unused HAVE_ defines This syncs build system gaps of some extensions' definitions being defined on Windows and some on *nix. These are not used anywhere and are only defined in some build system and not the other: * HAVE_INTL (was present only on Windows) * HAVE_PDO_DBLIB (was present only on Autotools) * HAVE_PDO_FIREBIRD (was present only on Autotools) * HAVE_TOKENIZER (was present only on Windows) --- ext/intl/config.m4 | 2 -- ext/intl/config.w32 | 1 - ext/pdo_dblib/config.m4 | 1 - ext/pdo_dblib/config.w32 | 1 - ext/pdo_firebird/config.m4 | 1 - ext/pdo_firebird/config.w32 | 1 - ext/tokenizer/config.m4 | 1 - ext/tokenizer/config.w32 | 1 - 8 files changed, 9 deletions(-) diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index fed465f0fc455..78396dc416926 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -117,6 +117,4 @@ if test "$PHP_INTL" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/spoofchecker) PHP_ADD_BUILD_DIR($ext_builddir/breakiterator) PHP_ADD_BUILD_DIR($ext_builddir/uchar) - - AC_DEFINE([HAVE_INTL], [1], [Whether the intl extension is available.]) fi diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index 2d94c20b29715..dec7180e62174 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -126,7 +126,6 @@ if (PHP_INTL != "no") { } ADD_FLAG("CFLAGS_INTL", "/EHsc /DUNISTR_FROM_CHAR_EXPLICIT=explicit /DUNISTR_FROM_STRING_EXPLICIT=explicit /DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 /DU_HIDE_OBSOLETE_UTF_OLD_H=1"); - AC_DEFINE("HAVE_INTL", 1, "Whether the intl extension is available."); } else { WARNING("intl not enabled; libraries and/or headers not found"); } diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4 index 45b3c97a83188..993ca3d6033af 100644 --- a/ext/pdo_dblib/config.m4 +++ b/ext/pdo_dblib/config.m4 @@ -45,7 +45,6 @@ if test "$PHP_PDO_DBLIB" != "no"; then PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_DBLIB_DEFS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) - AC_DEFINE([HAVE_PDO_DBLIB], [1], [Whether the pdo_dblib extension is available.]) PHP_SUBST(PDO_DBLIB_SHARED_LIBADD) PHP_ADD_EXTENSION_DEP(pdo_dblib, pdo) diff --git a/ext/pdo_dblib/config.w32 b/ext/pdo_dblib/config.w32 index edf546dd6005c..4b1c76130f525 100644 --- a/ext/pdo_dblib/config.w32 +++ b/ext/pdo_dblib/config.w32 @@ -13,7 +13,6 @@ if (PHP_PDO_DBLIB != "no") { EXTENSION("pdo_dblib", "pdo_dblib.c dblib_driver.c dblib_stmt.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_FLAG('CFLAGS_PDO_DBLIB', "/D PDO_DBLIB_FLAVOUR=\\\"freetds\\\""); ADD_EXTENSION_DEP('pdo_dblib', 'pdo'); - AC_DEFINE('HAVE_PDO_DBLIB', 1, 'Whether the pdo_dblib extension is available.'); } else { WARNING("pdo_dblib not enabled, libraries or headers not found") } diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index 5be5a528d9051..d4a245d5a904b 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -60,7 +60,6 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then PHP_CHECK_PDO_INCLUDES - AC_DEFINE([HAVE_PDO_FIREBIRD], [1], [Whether the pdo_firebird extension is available.]) PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_cv_inc_path) PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD) PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo) diff --git a/ext/pdo_firebird/config.w32 b/ext/pdo_firebird/config.w32 index 90215cc91b0dc..634ac4c8e984c 100644 --- a/ext/pdo_firebird/config.w32 +++ b/ext/pdo_firebird/config.w32 @@ -11,7 +11,6 @@ if (PHP_PDO_FIREBIRD != "no") { ) { EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c"); - AC_DEFINE('HAVE_PDO_FIREBIRD', 1, 'Whether the pdo_firebird extension is available.'); } else { WARNING("pdo_firebird not enabled; libraries and headers not found"); } diff --git a/ext/tokenizer/config.m4 b/ext/tokenizer/config.m4 index 2945ec1e0a96f..e607fe50fc3e0 100644 --- a/ext/tokenizer/config.m4 +++ b/ext/tokenizer/config.m4 @@ -7,5 +7,4 @@ PHP_ARG_ENABLE([tokenizer], if test "$PHP_TOKENIZER" != "no"; then PHP_NEW_EXTENSION(tokenizer, tokenizer.c tokenizer_data.c, $ext_shared) PHP_ADD_MAKEFILE_FRAGMENT - AC_DEFINE([HAVE_TOKENIZER], [1], [Whether the tokenizer extension is available.]) fi diff --git a/ext/tokenizer/config.w32 b/ext/tokenizer/config.w32 index f461d7b69de81..5d933c3c31b77 100644 --- a/ext/tokenizer/config.w32 +++ b/ext/tokenizer/config.w32 @@ -4,5 +4,4 @@ ARG_ENABLE("tokenizer", "tokenizer support", "yes"); if (PHP_TOKENIZER == "yes") { EXTENSION("tokenizer", "tokenizer.c tokenizer_data.c"); - AC_DEFINE("HAVE_TOKENIZER", 1, "Whether the tokenizer extension is available."); }