Skip to content

Commit be8ddd6

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 5faecc8 + 92bd4e5 commit be8ddd6

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
@@ -235,7 +235,7 @@ include(cmake/GenerateGrammar.cmake)
235235
################################################################################
236236

237237
if(PHP_EXT_STANDARD_ARGON2)
238-
find_package(Argon2 20171227)
238+
find_package(Argon2 20161029)
239239
set_package_properties(
240240
Argon2
241241
PROPERTIES
@@ -320,9 +320,9 @@ endif()
320320
# Check if there is a support means of creating a new process and defining which
321321
# handles it receives.
322322
message(CHECK_START "Checking if OS can spawn processes with inherited handles")
323-
check_symbol_exists(fork "unistd.h" HAVE_FORK)
323+
check_symbol_exists(fork unistd.h HAVE_FORK)
324324
if(NOT HAVE_FORK)
325-
check_symbol_exists(CreateProcess "windows.h" HAVE_CREATEPROCESS)
325+
check_symbol_exists(CreateProcess windows.h HAVE_CREATEPROCESS)
326326
endif()
327327
if(HAVE_FORK OR HAVE_CREATEPROCESS)
328328
set(PHP_CAN_SUPPORT_PROC_OPEN TRUE)
@@ -339,12 +339,12 @@ php_search_libraries(
339339
LIBRARIES
340340
socket # Solaris 11..11.3, illumos
341341
network # Haiku
342-
VARIABLE _HAVE_GETIFADDRS
342+
VARIABLE _PHP_HAVE_GETIFADDRS
343343
LIBRARY_VARIABLE libraryForGetifaddrs
344344
TARGET php_ext_standard PRIVATE
345345
)
346346

347-
if(_HAVE_GETIFADDRS)
347+
if(_PHP_HAVE_GETIFADDRS)
348348
message(CHECK_START "Checking for usable getifaddrs")
349349
cmake_push_check_state(RESET)
350350
if(libraryForGetifaddrs)
@@ -466,7 +466,7 @@ php_search_libraries(
466466

467467
check_symbol_exists(
468468
posix_spawn_file_actions_addchdir_np
469-
"spawn.h"
469+
spawn.h
470470
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP
471471
)
472472

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

524-
check_symbol_exists(chroot "unistd.h" HAVE_CHROOT)
524+
check_symbol_exists(chroot unistd.h HAVE_CHROOT)
525525

526526
add_library(php_ext_standard_functions OBJECT)
527527
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)