Skip to content

Commit a3b1e04

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 4b2e2a1 + d37140d commit a3b1e04

File tree

8 files changed

+66
-38
lines changed

8 files changed

+66
-38
lines changed

cmake/cmake/modules/FindCdb.cmake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ find_package(Cdb)
2727
```
2828
#]=============================================================================]
2929

30-
include(CheckLibraryExists)
30+
include(CheckSymbolExists)
31+
include(CMakePushCheckState)
3132
include(FeatureSummary)
3233
include(FindPackageHandleStandardArgs)
3334

@@ -69,10 +70,16 @@ if(NOT Cdb_LIBRARY)
6970
endif()
7071

7172
# Sanity check.
72-
if(Cdb_LIBRARY)
73-
check_library_exists("${Cdb_LIBRARY}" cdb_read "" _cdb_sanity_check)
73+
if(Cdb_INCLUDE_DIR AND Cdb_LIBRARY)
74+
cmake_push_check_state(RESET)
75+
set(CMAKE_REQUIRED_INCLUDES ${Cdb_INCLUDE_DIR})
76+
set(CMAKE_REQUIRED_LIBRARIES ${Cdb_LIBRARY})
77+
set(CMAKE_REQUIRED_QUIET TRUE)
7478

75-
if(NOT _cdb_sanity_check)
79+
check_symbol_exists(cdb_read cdb.h _Cdb_SANITY_CHECK)
80+
cmake_pop_check_state()
81+
82+
if(NOT _Cdb_SANITY_CHECK)
7683
string(APPEND _reason "Sanity check failed: cdb_read not found. ")
7784
endif()
7885
endif()
@@ -97,7 +104,7 @@ find_package_handle_standard_args(
97104
REQUIRED_VARS
98105
Cdb_LIBRARY
99106
Cdb_INCLUDE_DIR
100-
_cdb_sanity_check
107+
_Cdb_SANITY_CHECK
101108
VERSION_VAR Cdb_VERSION
102109
HANDLE_VERSION_RANGE
103110
REASON_FAILURE_MESSAGE "${_reason}"

cmake/cmake/modules/FindFreeTDS.cmake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ find_package(FreeTDS)
2626
```
2727
#]=============================================================================]
2828

29-
include(CheckLibraryExists)
29+
include(CheckSymbolExists)
30+
include(CMakePushCheckState)
3031
include(FeatureSummary)
3132
include(FindPackageHandleStandardArgs)
3233

@@ -61,10 +62,16 @@ if(NOT FreeTDS_LIBRARY)
6162
endif()
6263

6364
# Sanity check.
64-
if(FreeTDS_LIBRARY)
65-
check_library_exists("${FreeTDS_LIBRARY}" dbsqlexec "" _freetds_sanity_check)
65+
if(FreeTDS_INCLUDE_DIR AND FreeTDS_LIBRARY)
66+
cmake_push_check_state(RESET)
67+
set(CMAKE_REQUIRED_INCLUDES ${FreeTDS_INCLUDE_DIR})
68+
set(CMAKE_REQUIRED_LIBRARIES ${FreeTDS_LIBRARY})
69+
set(CMAKE_REQUIRED_QUIET TRUE)
6670

67-
if(NOT _freetds_sanity_check)
71+
check_symbol_exists(dbsqlexec sybdb.h _FreeTDS_SANITY_CHECK)
72+
cmake_pop_check_state()
73+
74+
if(NOT _FreeTDS_SANITY_CHECK)
6875
string(APPEND _reason "Sanity check failed: dbsqlexec not found. ")
6976
endif()
7077
endif()
@@ -76,7 +83,7 @@ find_package_handle_standard_args(
7683
REQUIRED_VARS
7784
FreeTDS_LIBRARY
7885
FreeTDS_INCLUDE_DIR
79-
_freetds_sanity_check
86+
_FreeTDS_SANITY_CHECK
8087
REASON_FAILURE_MESSAGE "${_reason}"
8188
)
8289

cmake/cmake/modules/FindLMDB.cmake

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ find_package(LMDB)
2727
```
2828
#]=============================================================================]
2929

30-
include(CheckLibraryExists)
30+
include(CheckSymbolExists)
31+
include(CMakePushCheckState)
3132
include(FeatureSummary)
3233
include(FindPackageHandleStandardArgs)
3334

3435
set_package_properties(
3536
LMDB
3637
PROPERTIES
37-
URL "https://www.symas.com/lmdb"
38+
URL "https://www.symas.com/mdb"
3839
DESCRIPTION "Lightning Memory-Mapped Database library"
3940
)
4041

@@ -69,10 +70,16 @@ if(NOT LMDB_LIBRARY)
6970
endif()
7071

7172
# Sanity check.
72-
if(LMDB_LIBRARY)
73-
check_library_exists("${LMDB_LIBRARY}" mdb_env_open "" _lmdb_sanity_check)
73+
if(LMDB_INCLUDE_DIR AND LMDB_LIBRARY)
74+
cmake_push_check_state(RESET)
75+
set(CMAKE_REQUIRED_INCLUDES ${LMDB_INCLUDE_DIR})
76+
set(CMAKE_REQUIRED_LIBRARIES ${LMDB_LIBRARY})
77+
set(CMAKE_REQUIRED_QUIET TRUE)
7478

75-
if(NOT _lmdb_sanity_check)
79+
check_symbol_exists(mdb_env_open lmdb.h _LMDB_SANITY_CHECK)
80+
cmake_pop_check_state()
81+
82+
if(NOT _LMDB_SANITY_CHECK)
7683
string(APPEND _reason "Sanity check failed: mdb_env_open not found. ")
7784
endif()
7885
endif()
@@ -111,7 +118,7 @@ find_package_handle_standard_args(
111118
REQUIRED_VARS
112119
LMDB_LIBRARY
113120
LMDB_INCLUDE_DIR
114-
_lmdb_sanity_check
121+
_LMDB_SANITY_CHECK
115122
VERSION_VAR LMDB_VERSION
116123
HANDLE_VERSION_RANGE
117124
REASON_FAILURE_MESSAGE "${_reason}"

cmake/cmake/modules/FindTokyoCabinet.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ find_package(TokyoCabinet)
2727
```
2828
#]=============================================================================]
2929

30-
include(CheckLibraryExists)
30+
include(CheckSymbolExists)
31+
include(CMakePushCheckState)
3132
include(FeatureSummary)
3233
include(FindPackageHandleStandardArgs)
3334

@@ -69,15 +70,16 @@ if(NOT TokyoCabinet_LIBRARY)
6970
endif()
7071

7172
# Sanity check.
72-
if(TokyoCabinet_LIBRARY)
73-
check_library_exists(
74-
"${TokyoCabinet_LIBRARY}"
75-
tcadbopen
76-
""
77-
_tokyocabinet_sanity_check
78-
)
73+
if(TokyoCabinet_INCLUDE_DIR AND TokyoCabinet_LIBRARY)
74+
cmake_push_check_state(RESET)
75+
set(CMAKE_REQUIRED_INCLUDES ${TokyoCabinet_INCLUDE_DIR})
76+
set(CMAKE_REQUIRED_LIBRARIES ${TokyoCabinet_LIBRARY})
77+
set(CMAKE_REQUIRED_QUIET TRUE)
78+
79+
check_symbol_exists(tcadbopen tcadb.h _TokyoCabinet_SANITY_CHECK)
80+
cmake_pop_check_state()
7981

80-
if(NOT _tokyocabinet_sanity_check)
82+
if(NOT _TokyoCabinet_SANITY_CHECK)
8183
string(APPEND _reason "Sanity check failed: tcadbopen not found. ")
8284
endif()
8385
endif()
@@ -102,7 +104,7 @@ find_package_handle_standard_args(
102104
REQUIRED_VARS
103105
TokyoCabinet_LIBRARY
104106
TokyoCabinet_INCLUDE_DIR
105-
_tokyocabinet_sanity_check
107+
_TokyoCabinet_SANITY_CHECK
106108
VERSION_VAR TokyoCabinet_VERSION
107109
HANDLE_VERSION_RANGE
108110
REASON_FAILURE_MESSAGE "${_reason}"

cmake/cmake/modules/PHP/SearchLibraries.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ If `<variable>` is given, check result is stored in an internal cache variable.
4949
* `LIBRARIES`
5050
5151
If symbol is not found in the default libraries (C library), then the
52-
`LIBRARIES` list is iterated. Instead of using the `check_library_exists()` or
53-
`check_function_exists()`, the `check_symbol_exists()` is used, since it also
54-
works when symbol might be a macro definition. It would not be found using the
55-
other two commands because they don't include required headers.
52+
`LIBRARIES` list is iterated. Instead of using the `check_function_exists()`,
53+
the `check_symbol_exists()` is used, since it also works when symbol might be
54+
a macro definition. It would not be found using the other two commands because
55+
they don't include required headers.
5656
5757
* `VARIABLE`
5858

cmake/ext/hash/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ target_sources(
105105
xxhash/xxhash.h
106106
)
107107

108+
target_compile_definitions(
109+
php_ext_hash
110+
PRIVATE
111+
ZEND_ENABLE_STATIC_TSRMLS_CACHE
112+
)
113+
108114
if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
109115
set(HAVE_SLOW_HASH3 TRUE)
110116
message(WARNING "Using slow SHA3 implementation on big-endian")
@@ -118,9 +124,9 @@ else()
118124
php_check_compiler_flag(
119125
C
120126
-Wno-implicit-fallthrough
121-
_HAVE_WNO_IMPLICIT_FALLTHROUGH_C
127+
_PHP_HAVE_WNO_IMPLICIT_FALLTHROUGH_C
122128
)
123-
if(_HAVE_WNO_IMPLICIT_FALLTHROUGH_C)
129+
if(_PHP_HAVE_WNO_IMPLICIT_FALLTHROUGH_C)
124130
set_property(
125131
SOURCE ${sha3Dir}/KeccakP-1600-inplace32BI.c
126132
APPEND
@@ -153,7 +159,6 @@ else()
153159
KeccakP200_excluded
154160
KeccakP400_excluded
155161
KeccakP800_excluded
156-
ZEND_ENABLE_STATIC_TSRMLS_CACHE
157162
)
158163
endif()
159164

cmake/ext/pcre/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ else()
193193
php_check_compiler_flag(
194194
C
195195
-Wno-implicit-fallthrough
196-
_HAVE_WNO_IMPLICIT_FALLTHROUGH_C
196+
_PHP_HAVE_WNO_IMPLICIT_FALLTHROUGH_C
197197
)
198-
if(_HAVE_WNO_IMPLICIT_FALLTHROUGH_C)
198+
if(_PHP_HAVE_WNO_IMPLICIT_FALLTHROUGH_C)
199199
set_property(
200200
SOURCE pcre2lib/pcre2_jit_compile.c
201201
APPEND

patches/8.5/php-config.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ index 640f0100800..de89ceb45b1 100644
5858
])
5959

6060
diff --git a/configure.ac b/configure.ac
61-
index 61d1c350a82..a4b41411d1b 100644
61+
index e4bd8162a2e..5195ff85b1d 100644
6262
--- a/configure.ac
6363
+++ b/configure.ac
64-
@@ -1382,6 +1382,9 @@ exec_prefix=$old_exec_prefix
64+
@@ -1386,6 +1386,9 @@ exec_prefix=$old_exec_prefix
6565
libdir=$old_libdir
6666
datadir=$old_datadir
6767

@@ -71,7 +71,7 @@ index 61d1c350a82..a4b41411d1b 100644
7171
AC_SUBST([INCLUDE_PATH])
7272
AC_SUBST([EXPANDED_PEAR_INSTALLDIR])
7373
AC_SUBST([EXPANDED_EXTENSION_DIR])
74-
@@ -1400,6 +1403,9 @@ AC_SUBST([SAPI_LIBNAME_STATIC])
74+
@@ -1404,6 +1407,9 @@ AC_SUBST([SAPI_LIBNAME_STATIC])
7575
AC_SUBST([PHP_VERSION])
7676
AC_SUBST([PHP_VERSION_ID])
7777
AC_SUBST([PHP_LDFLAGS])

0 commit comments

Comments
 (0)