Skip to content

Commit 29e1929

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 4dd95a6 + be8ddd6 commit 29e1929

File tree

6 files changed

+55
-12
lines changed

6 files changed

+55
-12
lines changed

cmake/Zend/cmake/CheckStrerrorR.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include(CheckSourceCompiles)
2929
include(CheckSymbolExists)
3030
include(CMakePushCheckState)
3131

32-
check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
32+
check_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
3333

3434
if(NOT HAVE_STRERROR_R)
3535
return()

cmake/cmake/modules/FindArgon2.cmake

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ find_package(Argon2)
2727
```
2828
#]=============================================================================]
2929

30+
include(CheckSymbolExists)
31+
include(CMakePushCheckState)
3032
include(FeatureSummary)
3133
include(FindPackageHandleStandardArgs)
3234

@@ -67,9 +69,50 @@ if(NOT Argon2_LIBRARY)
6769
string(APPEND _reason "Argon2 library (libargon2) not found. ")
6870
endif()
6971

70-
# Argon2 headers don't provide version. Try pkg-config.
72+
# Argon2 headers don't provide version. Try pkg-config, or fallback to
73+
# heuristic version determination.
7174
if(PC_Argon2_VERSION AND Argon2_INCLUDE_DIR IN_LIST PC_Argon2_INCLUDE_DIRS)
7275
set(Argon2_VERSION ${PC_Argon2_VERSION})
76+
elseif(Argon2_LIBRARY AND Argon2_INCLUDE_DIR)
77+
cmake_push_check_state(RESET)
78+
set(CMAKE_REQUIRED_LIBRARIES "${Argon2_LIBRARY}")
79+
set(CMAKE_REQUIRED_INCLUDES "${Argon2_INCLUDE_DIR}")
80+
set(CMAKE_REQUIRED_QUIET TRUE)
81+
82+
check_symbol_exists(error_message argon2.h _Argon2_HAVE_ERROR_MESSAGE)
83+
84+
if(_Argon2_HAVE_ERROR_MESSAGE)
85+
set(Argon2_VERSION 20151206)
86+
else()
87+
check_symbol_exists(
88+
ARGON2_FLAG_CLEAR_MEMORY
89+
argon2.h
90+
_Argon2_HAVE_ARGON2_FLAG_CLEAR_MEMORY
91+
)
92+
endif()
93+
94+
if(_Argon2_HAVE_ARGON2_FLAG_CLEAR_MEMORY)
95+
set(Argon2_VERSION 20160406)
96+
else()
97+
check_symbol_exists(argon2id_hash_raw argon2.h _Argon2_HAVE_ARGON2ID_HASH_RAW)
98+
endif()
99+
100+
if(_Argon2_HAVE_ARGON2ID_HASH_RAW)
101+
set(Argon2_VERSION 20161029)
102+
endif()
103+
104+
check_symbol_exists(ARGON2_LOCAL argon2.h _Argon2_HAVE_ARGON2_LOCAL)
105+
if(_Argon2_HAVE_ARGON2_LOCAL)
106+
set(Argon2_VERSION 20171227)
107+
108+
file(STRINGS ${Argon2_INCLUDE_DIR}/argon2.h content REGEX " deafults ")
109+
110+
if(NOT content)
111+
set(Argon2_VERSION 20190702)
112+
endif()
113+
unset(content)
114+
endif()
115+
cmake_pop_check_state()
73116
endif()
74117

75118
mark_as_advanced(Argon2_INCLUDE_DIR Argon2_LIBRARY)

cmake/cmake/modules/PHP/CheckReentrantFunctions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function(_php_check_reentrant_function symbol header)
8080

8181
cmake_push_check_state(RESET)
8282
set(CMAKE_REQUIRED_QUIET TRUE)
83-
check_symbol_exists(${symbol} ${header} PHP_HAVE_DECL_${const})
83+
check_symbol_exists(${symbol} "${header}" PHP_HAVE_DECL_${const})
8484
cmake_pop_check_state()
8585

8686
if(NOT PHP_HAVE_DECL_${const})

cmake/ext/standard/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ include(cmake/GenerateGrammar.cmake)
234234
################################################################################
235235

236236
if(PHP_EXT_STANDARD_ARGON2)
237-
find_package(Argon2 20171227)
237+
find_package(Argon2 20161029)
238238
set_package_properties(
239239
Argon2
240240
PROPERTIES
@@ -319,9 +319,9 @@ endif()
319319
# Check if there is a support means of creating a new process and defining which
320320
# handles it receives.
321321
message(CHECK_START "Checking if OS can spawn processes with inherited handles")
322-
check_symbol_exists(fork "unistd.h" HAVE_FORK)
322+
check_symbol_exists(fork unistd.h HAVE_FORK)
323323
if(NOT HAVE_FORK)
324-
check_symbol_exists(CreateProcess "windows.h" HAVE_CREATEPROCESS)
324+
check_symbol_exists(CreateProcess windows.h HAVE_CREATEPROCESS)
325325
endif()
326326
if(HAVE_FORK OR HAVE_CREATEPROCESS)
327327
set(PHP_CAN_SUPPORT_PROC_OPEN TRUE)
@@ -338,12 +338,12 @@ php_search_libraries(
338338
LIBRARIES
339339
socket # Solaris 11..11.3, illumos
340340
network # Haiku
341-
VARIABLE _HAVE_GETIFADDRS
341+
VARIABLE _PHP_HAVE_GETIFADDRS
342342
LIBRARY_VARIABLE libraryForGetifaddrs
343343
TARGET php_ext_standard PRIVATE
344344
)
345345

346-
if(_HAVE_GETIFADDRS)
346+
if(_PHP_HAVE_GETIFADDRS)
347347
message(CHECK_START "Checking for usable getifaddrs")
348348
cmake_push_check_state(RESET)
349349
if(libraryForGetifaddrs)
@@ -465,7 +465,7 @@ php_search_libraries(
465465

466466
check_symbol_exists(
467467
posix_spawn_file_actions_addchdir_np
468-
"spawn.h"
468+
spawn.h
469469
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP
470470
)
471471

@@ -520,7 +520,7 @@ endblock()
520520
# See: https://github.com/php/php-src/issues/11984
521521
################################################################################
522522

523-
check_symbol_exists(chroot "unistd.h" HAVE_CHROOT)
523+
check_symbol_exists(chroot unistd.h HAVE_CHROOT)
524524

525525
add_library(php_ext_standard_functions OBJECT)
526526
add_library(php_ext_standard_functions_cli OBJECT)

cmake/ext/standard/cmake/CheckStrptime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ endif()
4242
# Check whether linker sees the strptime and it is declared in time.h.
4343
cmake_push_check_state(RESET)
4444
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
45-
check_symbol_exists(strptime "time.h" HAVE_STRPTIME)
45+
check_symbol_exists(strptime time.h HAVE_STRPTIME)
4646
cmake_pop_check_state()
4747

4848
if(HAVE_STRPTIME)

cmake/sapi/phpdbg/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ message(
235235
)
236236
check_symbol_exists(
237237
UFFDIO_WRITEPROTECT_MODE_WP
238-
"linux/userfaultfd.h"
238+
linux/userfaultfd.h
239239
HAVE_UFFDIO_WRITEPROTECT_MODE_WP
240240
)
241241
if(HAVE_UFFDIO_WRITEPROTECT_MODE_WP)

0 commit comments

Comments
 (0)