Skip to content

Commit 055ef5e

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents d68ae84 + 912c5a2 commit 055ef5e

18 files changed

+160
-146
lines changed

cmake/cmake/modules/Findlibzip.cmake

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ This module defines the following imported targets:
2626
2727
* `libzip_INCLUDE_DIR` - Directory containing package library headers.
2828
* `libzip_LIBRARY` - The path to the package library.
29-
* `libzip_HAVE_ENCRYPTION`
30-
* `libzip_HAVE_LIBZIP_VERSION`
31-
* `libzip_HAVE_SET_MTIME`
3229
3330
## Examples
3431
@@ -41,8 +38,6 @@ target_link_libraries(example PRIVATE libzip::zip)
4138
```
4239
#]=============================================================================]
4340

44-
include(CheckSymbolExists)
45-
include(CMakePushCheckState)
4641
include(FeatureSummary)
4742
include(FindPackageHandleStandardArgs)
4843

@@ -83,15 +78,15 @@ if(NOT libzip_LIBRARY)
8378
endif()
8479

8580
block(PROPAGATE libzip_VERSION)
86-
# Version in zipconf.h is available since libzip 1.4.0.
8781
if(EXISTS ${libzip_INCLUDE_DIR}/zipconf.h)
88-
set(regex "^[ \t]*#[ \t]*define[ \t]+LIBZIP_VERSION[ \t]+\"?([^\"]+)\"?[ \t]*$")
89-
90-
file(STRINGS ${libzip_INCLUDE_DIR}/zipconf.h result REGEX "${regex}")
91-
92-
if(result MATCHES "${regex}")
93-
set(libzip_VERSION "${CMAKE_MATCH_1}")
94-
endif()
82+
file(
83+
STRINGS
84+
${libzip_INCLUDE_DIR}/zipconf.h
85+
_
86+
REGEX
87+
"^[ \t]*#[ \t]*define[ \t]+LIBZIP_VERSION[ \t]+\"?([^\"]+)\"?[ \t]*$"
88+
)
89+
set(libzip_VERSION "${CMAKE_MATCH_1}")
9590
endif()
9691

9792
if(
@@ -101,40 +96,6 @@ block(PROPAGATE libzip_VERSION)
10196
)
10297
set(libzip_VERSION ${PC_libzip_VERSION})
10398
endif()
104-
105-
# Determine libzip older version heuristically.
106-
if(NOT libzip_VERSION AND libzip_INCLUDE_DIR AND libzip_LIBRARY)
107-
cmake_push_check_state(RESET)
108-
set(CMAKE_REQUIRED_INCLUDES ${libzip_INCLUDE_DIR})
109-
set(CMAKE_REQUIRED_LIBRARIES ${libzip_LIBRARY})
110-
set(CMAKE_REQUIRED_QUIET TRUE)
111-
112-
# zip_file_set_mtime is available with libzip 1.0.0.
113-
check_symbol_exists(zip_file_set_mtime zip.h libzip_HAVE_SET_MTIME)
114-
115-
if(NOT libzip_HAVE_SET_MTIME)
116-
set(libzip_VERSION 0.11)
117-
else()
118-
set(libzip_VERSION 1.0)
119-
endif()
120-
121-
# zip_file_set_encryption is available in libzip 1.2.0.
122-
check_symbol_exists(zip_file_set_encryption zip.h libzip_HAVE_ENCRYPTION)
123-
124-
if(libzip_HAVE_ENCRYPTION)
125-
set(libzip_VERSION 1.2.0)
126-
endif()
127-
128-
# zip_libzip_version is available in libzip 1.3.1.
129-
check_symbol_exists(zip_libzip_version zip.h libzip_HAVE_LIBZIP_VERSION)
130-
131-
if(libzip_HAVE_LIBZIP_VERSION)
132-
set(libzip_VERSION 1.3.1)
133-
endif()
134-
cmake_pop_check_state()
135-
136-
message(WARNING "The libzip version might not be correctly determined")
137-
endif()
13899
endblock()
139100

140101
mark_as_advanced(libzip_INCLUDE_DIR libzip_LIBRARY)

cmake/cmake/platforms/Windows.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
115115
set(HAVE_SCANDIR FALSE)
116116
set(HAVE_SETENV FALSE)
117117
set(HAVE_SETITIMER FALSE)
118-
set(HAVE_SETPROCTITLE FALSE)
119118
set(HAVE_SIGPROCMASK FALSE)
120119
set(HAVE_SIZEOF_GID_T FALSE)
121120
set(HAVE_SIZEOF_SSIZE_T FALSE)
@@ -131,8 +130,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
131130
set(HAVE_STRNLEN TRUE)
132131
set(HAVE_STRUCT_FLOCK FALSE)
133132
set(HAVE_STRUCT_SOCKADDR_SA_LEN FALSE)
134-
set(HAVE_STRUCT_SOCKADDR_STORAGE FALSE)
135-
set(HAVE_STRUCT_SOCKADDR_UN_SUN_LEN FALSE)
136133
set(HAVE_STRUCT_STAT_ST_BLKSIZE FALSE)
137134
set(HAVE_STRUCT_STAT_ST_BLOCKS FALSE)
138135
set(HAVE_STRUCT_STAT_ST_RDEV TRUE)
@@ -147,7 +144,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
147144
set(HAVE_SYS_MOUNT_H FALSE)
148145
set(HAVE_SYS_PARAM_H FALSE)
149146
set(HAVE_SYS_POLL_H FALSE)
150-
set(HAVE_SYS_PSTAT_H FALSE)
151147
set(HAVE_SYS_RESOURCE_H FALSE)
152148
set(HAVE_SYS_SELECT_H FALSE)
153149
set(HAVE_SYS_STAT_H TRUE)
@@ -260,7 +256,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
260256
set(PHP_HAVE_STRINGS_H FALSE)
261257
set(PHP_HAVE_SYS_SOCKET_H FALSE)
262258
set(PHP_HAVE_UNISTD_H FALSE)
259+
set(PHP_SAPI_HAVE_SETPROCTITLE FALSE)
260+
set(PHP_SAPI_CGI_HAVE_STRUCT_SOCKADDR_UN_SUN_LEN FALSE)
263261
set(PHP_SAPI_CLI_HAVE_PS_STRINGS FALSE)
262+
set(PHP_SAPI_CLI_HAVE_SYS_PSTAT_H FALSE)
264263
set(PHP_SAPI_PHPDBG_HAS_UFFDIO_WRITEPROTECT_MODE_WP FALSE)
265264
set(PHP_ZEND_HAS_PGRAB FALSE)
266265

cmake/cmake/toolchains/template.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ set(ZEND_MM_EXITCODE__TRYRUN_OUTPUT "(size_t)8 (size_t)3 0")
5252
################################################################################
5353

5454
# Set the exit code of the ptrace() check.
55-
set(PHP_SAPI_FPM_HAS_PTRACE_EXITCODE 0)
55+
set(PHP_SAPI_FPM_HAVE_PTRACE_EXITCODE 0)
5656

5757
# Set the process memory access file - 'mem' on Linux-alike or 'as' on
5858
# Solaris-alike target systems for the PHP FPM to use pread trace type

cmake/ext/zip/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if(NOT libzip_FOUND)
7979
endif()
8080

8181
if(NOT libzip_FOUND)
82-
find_package(libzip 0.11...1.3.0)
82+
find_package(libzip 0.11.2...1.3.0)
8383
endif()
8484

8585
if(libzip_VERSION VERSION_EQUAL 1.3.1 OR libzip_VERSION VERSION_EQUAL 1.7.0)

cmake/sapi/cgi/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ check_struct_has_member(
6363
"struct sockaddr_un"
6464
sun_len
6565
sys/un.h
66-
HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
66+
PHP_SAPI_CGI_HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
6767
)
68+
set(HAVE_STRUCT_SOCKADDR_UN_SUN_LEN ${PHP_SAPI_CGI_HAVE_STRUCT_SOCKADDR_UN_SUN_LEN})
6869

6970
message(CHECK_START "Checking whether accept() requires cross-process locking")
7071
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")

cmake/sapi/cli/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ endif()
5757
# Configuration checks.
5858
################################################################################
5959

60-
check_symbol_exists(setproctitle "unistd.h;stdlib.h" HAVE_SETPROCTITLE)
61-
check_include_files(sys/pstat.h HAVE_SYS_PSTAT_H)
60+
check_symbol_exists(setproctitle "unistd.h;stdlib.h" PHP_SAPI_HAVE_SETPROCTITLE)
61+
set(HAVE_SETPROCTITLE ${PHP_SAPI_HAVE_SETPROCTITLE})
62+
63+
check_include_files(sys/pstat.h PHP_SAPI_CLI_HAVE_SYS_PSTAT_H)
64+
set(HAVE_SYS_PSTAT_H ${PHP_SAPI_CLI_HAVE_SYS_PSTAT_H})
6265

6366
# For some BSD-based systems.
6467
message(CHECK_START "Checking for PS_STRINGS")

cmake/sapi/fpm/CMakeLists.txt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,23 @@ set_target_properties(
247247
# Configuration checks.
248248
################################################################################
249249

250-
check_symbol_exists(clearenv stdlib.h HAVE_CLEARENV)
251-
check_symbol_exists(port_create port.h HAVE_PORT_CREATE)
252-
check_symbol_exists(setpflags priv.h HAVE_SETPFLAGS)
253-
check_symbol_exists(setproctitle "unistd.h;stdlib.h" HAVE_SETPROCTITLE)
254-
check_symbol_exists(setproctitle_fast unistd.h HAVE_SETPROCTITLE_FAST)
255-
check_symbol_exists(times sys/times.h HAVE_TIMES)
250+
check_symbol_exists(clearenv stdlib.h PHP_SAPI_FPM_HAVE_CLEARENV)
251+
set(HAVE_CLEARENV ${PHP_SAPI_FPM_HAVE_CLEARENV})
252+
253+
check_symbol_exists(port_create port.h PHP_SAPI_FPM_HAVE_PORT_CREATE)
254+
set(HAVE_PORT_CREATE ${PHP_SAPI_FPM_HAVE_PORT_CREATE})
255+
256+
check_symbol_exists(setpflags priv.h PHP_SAPI_FPM_HAVE_SETPFLAGS)
257+
set(HAVE_SETPFLAGS ${PHP_SAPI_FPM_HAVE_SETPFLAGS})
258+
259+
check_symbol_exists(setproctitle "unistd.h;stdlib.h" PHP_SAPI_HAVE_SETPROCTITLE)
260+
set(HAVE_SETPROCTITLE ${PHP_SAPI_HAVE_SETPROCTITLE})
261+
262+
check_symbol_exists(setproctitle_fast unistd.h PHP_SAPI_FPM_HAVE_SETPROCTITLE_FAST)
263+
set(HAVE_SETPROCTITLE_FAST ${PHP_SAPI_FPM_HAVE_SETPROCTITLE_FAST})
264+
265+
check_symbol_exists(times sys/times.h PHP_SAPI_FPM_HAVE_TIMES)
266+
set(HAVE_TIMES ${PHP_SAPI_FPM_HAVE_TIMES})
256267

257268
include(cmake/CheckClockGetTime.cmake)
258269
include(cmake/CheckCompilerAtomicBuiltins.cmake)

cmake/sapi/fpm/cmake/CheckClockGetTime.cmake

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ php_search_libraries(
1111
HEADERS time.h
1212
LIBRARIES
1313
rt # Solaris 10
14-
VARIABLE PHP_SAPI_FPM_HAS_CLOCK_GETTIME
14+
VARIABLE PHP_SAPI_FPM_HAVE_CLOCK_GETTIME
1515
TARGET php_sapi_fpm PRIVATE
1616
)
17-
set(HAVE_CLOCK_GETTIME ${PHP_SAPI_FPM_HAS_CLOCK_GETTIME})
17+
set(HAVE_CLOCK_GETTIME ${PHP_SAPI_FPM_HAVE_CLOCK_GETTIME})
1818

1919
# Checking for working clock_get_time() on macOS systems is obsolete as of macOS
2020
# Sierra (10.12) where the clock_gettime() was added.
2121
if(
22-
NOT PHP_SAPI_FPM_HAS_CLOCK_GETTIME
23-
AND NOT DEFINED PHP_SAPI_FPM_HAS_CLOCK_GET_TIME
22+
NOT PHP_SAPI_FPM_HAVE_CLOCK_GETTIME
23+
AND NOT DEFINED PHP_SAPI_FPM_HAVE_CLOCK_GET_TIME
2424
)
2525
message(CHECK_START "Checking for clock_get_time()")
2626

@@ -29,9 +29,9 @@ if(
2929
if(
3030
CMAKE_CROSSCOMPILING
3131
AND NOT CMAKE_CROSSCOMPILING_EMULATOR
32-
AND NOT DEFINED PHP_SAPI_FPM_HAS_CLOCK_GET_TIME_EXITCODE
32+
AND NOT DEFINED PHP_SAPI_FPM_HAVE_CLOCK_GET_TIME_EXITCODE
3333
)
34-
set(PHP_SAPI_FPM_HAS_CLOCK_GET_TIME_EXITCODE 0)
34+
set(PHP_SAPI_FPM_HAVE_CLOCK_GET_TIME_EXITCODE 0)
3535
endif()
3636

3737
cmake_push_check_state(RESET)
@@ -59,18 +59,14 @@ if(
5959

6060
return 0;
6161
}
62-
]] PHP_SAPI_FPM_HAS_CLOCK_GET_TIME)
62+
]] PHP_SAPI_FPM_HAVE_CLOCK_GET_TIME)
6363
cmake_pop_check_state()
6464

65-
if(PHP_SAPI_FPM_HAS_CLOCK_GET_TIME)
65+
if(PHP_SAPI_FPM_HAVE_CLOCK_GET_TIME)
6666
message(CHECK_PASS "yes")
6767
else()
6868
message(CHECK_FAIL "no")
6969
endif()
7070
endif()
7171

72-
if(PHP_SAPI_FPM_HAS_CLOCK_GET_TIME)
73-
set(HAVE_CLOCK_GET_TIME TRUE)
74-
else()
75-
set(HAVE_CLOCK_GET_TIME FALSE)
76-
endif()
72+
set(HAVE_CLOCK_GET_TIME "${PHP_SAPI_FPM_HAVE_CLOCK_GET_TIME}")

cmake/sapi/fpm/cmake/CheckCompilerAtomicBuiltins.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include(CheckSourceCompiles)
1010
include(CMakePushCheckState)
1111

1212
# Skip in consecutive configuration phases.
13-
if(NOT DEFINED PHP_SAPI_FPM_HAS_BUILTIN_ATOMIC)
13+
if(NOT DEFINED PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC)
1414
message(CHECK_START "Checking if compiler has __sync_bool_compare_and_swap")
1515

1616
cmake_push_check_state(RESET)
@@ -22,14 +22,14 @@ if(NOT DEFINED PHP_SAPI_FPM_HAS_BUILTIN_ATOMIC)
2222
return (__sync_bool_compare_and_swap(&variable, 1, 2)
2323
&& __sync_add_and_fetch(&variable, 1)) ? 1 : 0;
2424
}
25-
]] PHP_SAPI_FPM_HAS_BUILTIN_ATOMIC)
25+
]] PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC)
2626
cmake_pop_check_state()
2727

28-
if(PHP_SAPI_FPM_HAS_BUILTIN_ATOMIC)
28+
if(PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC)
2929
message(CHECK_PASS "yes")
3030
else()
3131
message(CHECK_FAIL "no")
3232
endif()
3333
endif()
3434

35-
set(HAVE_BUILTIN_ATOMIC ${PHP_SAPI_FPM_HAS_BUILTIN_ATOMIC})
35+
set(HAVE_BUILTIN_ATOMIC ${PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC})

cmake/sapi/fpm/cmake/CheckEpoll.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include(CheckSourceCompiles)
1010
include(CMakePushCheckState)
1111

1212
# Skip in consecutive configuration phases.
13-
if(NOT DEFINED PHP_SAPI_FPM_HAS_EPOLL)
13+
if(NOT DEFINED PHP_SAPI_FPM_HAVE_EPOLL)
1414
message(CHECK_START "Checking for epoll")
1515
cmake_push_check_state(RESET)
1616
set(CMAKE_REQUIRED_QUIET TRUE)
@@ -41,14 +41,14 @@ if(NOT DEFINED PHP_SAPI_FPM_HAS_EPOLL)
4141

4242
return 0;
4343
}
44-
]] PHP_SAPI_FPM_HAS_EPOLL)
44+
]] PHP_SAPI_FPM_HAVE_EPOLL)
4545
cmake_pop_check_state()
4646

47-
if(PHP_SAPI_FPM_HAS_EPOLL)
47+
if(PHP_SAPI_FPM_HAVE_EPOLL)
4848
message(CHECK_PASS "yes")
4949
else()
5050
message(CHECK_FAIL "no")
5151
endif()
5252
endif()
5353

54-
set(HAVE_EPOLL ${PHP_SAPI_FPM_HAS_EPOLL})
54+
set(HAVE_EPOLL ${PHP_SAPI_FPM_HAVE_EPOLL})

0 commit comments

Comments
 (0)