Skip to content

Commit 16e218a

Browse files
authored
Autotools: Obsolete PHP_TEST_BUILD, PHP_BUILD_THREAD_SAFE, and PHP_DEF_HAVE (#15802)
The PHP_BUILD_THREAD_SAFE macro is a simple wrapper around setting the enable_zts variable and can't be used in PHP extensions realistically. The PHP_TEST_BUILD macro might produce warnings on certain compiler configurations and default AC_* macros like AC_LINK_IFELSE, AC_CHECK_LIB, or AC_CHECK_FUNC are better suited for such checks. Also, a quick browse through the open-source PHP extensions doesn't find usages of this macro except in imap extension where patch is was already sent: php/pecl-mail-imap#11 PHP_DEF_HAVE is a wrapper around AC_DEFINE and using AC_DEFINE_UNQUOTED and AS_TR_CPP are better suited for this task where also help text can be passed. Usages in the open source PHP extensions have been checked and patches sent where found.
1 parent dfdec2d commit 16e218a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

UPGRADING.INTERNALS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ PHP 8.4 INTERNALS UPGRADE NOTES
192192
- Autoconf macro PHP_AP_EXTRACT_VERSION is obsolete (use the
193193
'apxs -q HTTPD_VERSION').
194194
- Autoconf macro PHP_OUTPUT is obsolete (use AC_CONFIG_FILES).
195+
- Autoconf macro PHP_TEST_BUILD is obsolete (use AC_* macros).
196+
- Autoconf macro PHP_BUILD_THREAD_SAFE is obsolete (set enable_zts manually).
197+
- Autoconf macro PHP_DEF_HAVE is obsolete (use AC_DEFINE).
195198
- Autoconf macro PHP_PROG_SETUP now accepts an argument to set the minimum
196199
required PHP version during the build.
197200
- Autoconf macro PHP_INSTALL_HEADERS arguments can now be also

build/php.m4

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ dnl PHP_DEF_HAVE(what)
3131
dnl
3232
dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [ ])'.
3333
dnl
34-
AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___), 1, [ ])])
34+
AC_DEFUN([PHP_DEF_HAVE], [m4_warn([obsolete],
35+
[The macro 'PHP_DEF_HAVE' is obsolete. Use AC_DEFINE.])
36+
AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___), 1, [ ])])
3537

3638
dnl
3739
dnl PHP_RUN_ONCE(namespace, variable, code)
@@ -744,7 +746,9 @@ dnl ----------------------------------------------------------------------------
744746
dnl
745747
dnl PHP_BUILD_THREAD_SAFE
746748
dnl
747-
AC_DEFUN([PHP_BUILD_THREAD_SAFE], [enable_zts=yes])
749+
AC_DEFUN([PHP_BUILD_THREAD_SAFE], [m4_warn([obsolete],
750+
[The macro 'PHP_BUILD_THREAD_SAFE' is obsolete. Set 'enable_zts' manually.])
751+
enable_zts=yes])
748752

749753
dnl
750754
dnl PHP_REQUIRE_CXX
@@ -1510,7 +1514,8 @@ dnl PHP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs [, ext
15101514
dnl
15111515
dnl This macro checks whether build works and given function exists.
15121516
dnl
1513-
AC_DEFUN([PHP_TEST_BUILD], [
1517+
AC_DEFUN([PHP_TEST_BUILD], [m4_warn([obsolete],
1518+
[The macro 'PHP_TEST_BUILD' is obsolete. Use AC_* macros.])
15141519
old_LIBS=$LIBS
15151520
LIBS="$4 $LIBS"
15161521
AC_LINK_IFELSE([AC_LANG_SOURCE([

sapi/apache2handler/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ if test "$PHP_APXS2" != "no"; then
122122

123123
AS_IF([$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes' >/dev/null 2>&1], [
124124
APACHE_THREADED_MPM=yes
125-
PHP_BUILD_THREAD_SAFE
125+
enable_zts=yes
126126
], [APACHE_THREADED_MPM=no])
127127

128128
AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,

0 commit comments

Comments
 (0)