Skip to content

Commit d818a28

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 8b464e6 + ea8abcc commit d818a28

File tree

5 files changed

+98
-46
lines changed

5 files changed

+98
-46
lines changed

cmake/Zend/cmake/Signals.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ endif()
1313

1414
message(CHECK_START "Checking whether to enable Zend signal handling")
1515

16-
check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
16+
check_symbol_exists(sigaction signal.h PHP_HAVE_SIGACTION)
17+
set(HAVE_SIGACTION ${PHP_HAVE_SIGACTION})
1718

18-
if(HAVE_SIGACTION AND PHP_ZEND_SIGNALS)
19+
if(PHP_HAVE_SIGACTION AND PHP_ZEND_SIGNALS)
1920
message(CHECK_PASS "yes")
2021
set(ZEND_SIGNALS TRUE)
2122

cmake/cmake/platforms/Windows.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
7070
set(HAVE_FCNTL_H TRUE)
7171
set(HAVE_FDATASYNC FALSE)
7272
set(HAVE_FLOCK FALSE)
73-
set(HAVE_FORK FALSE)
7473
set(HAVE_FUNOPEN FALSE)
7574
set(HAVE_GETGRNAM_R FALSE)
7675
set(HAVE_GETLOADAVG FALSE)
@@ -194,7 +193,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
194193
set(PHP_EXT_RANDOM_HAVE_COMMONCRYPTO_COMMONRANDOM_H FALSE)
195194
set(PHP_EXT_RANDOM_HAVE_ARC4RANDOM_BUF FALSE)
196195
set(PHP_EXT_RANDOM_HAVE_GETRANDOM FALSE)
197-
set(PHP_HAS_CREATEPROCESS TRUE)
198196
set(PHP_HAS_DN_EXPAND FALSE)
199197
set(PHP_HAS_DN_SKIPNAME FALSE)
200198
set(PHP_HAS_DNS_SEARCH FALSE)
@@ -258,6 +256,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
258256
set(PHP_HAS_WNO_UNUSED_PARAMETER_C FALSE)
259257
set(PHP_HAS_WNO_UNUSED_PARAMETER_CXX FALSE)
260258
set(PHP_HAS_WSTRICT_PROTOTYPES_C FALSE)
259+
set(PHP_HAVE_CREATEPROCESS TRUE)
260+
set(PHP_HAVE_FORK FALSE)
261261
set(PHP_HAVE_GRP_H FALSE)
262262
set(PHP_HAVE_UNISTD_H FALSE)
263263
set(PHP_SAPI_CLI_HAVE_PS_STRINGS FALSE)

cmake/cmake/toolchains/template.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ set(PHP_EXT_OPCACHE_HAS_SHM_MMAP_POSIX_EXITCODE 0)
100100
################################################################################
101101

102102
# Set the exit code of the sched_getcpu() check.
103-
set(PHP_EXT_PCNTL_HAS_SCHED_GETCPU_EXITCODE 0)
103+
set(PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_EXITCODE 0)
104104

105105
################################################################################
106106
# ext/pcre

cmake/ext/pcntl/CMakeLists.txt

Lines changed: 87 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ target_compile_definitions(php_ext_pcntl PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE
8787

8888
# Check for required functions.
8989
block()
90-
check_symbol_exists(fork unistd.h HAVE_FORK)
91-
check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
92-
check_symbol_exists(waitpid sys/wait.h HAVE_WAITPID)
90+
check_symbol_exists(fork unistd.h PHP_HAVE_FORK)
91+
check_symbol_exists(sigaction signal.h PHP_HAVE_SIGACTION)
92+
check_symbol_exists(waitpid sys/wait.h PHP_HAVE_WAITPID)
9393

9494
foreach(function fork sigaction waitpid)
9595
string(TOUPPER ${function} const)
@@ -102,36 +102,82 @@ block()
102102
endforeach()
103103
endblock()
104104

105-
check_symbol_exists(forkx sys/fork.h HAVE_FORKX)
106-
check_symbol_exists(getcpuid sys/processor.h HAVE_GETCPUID)
107-
check_symbol_exists(getpriority sys/resource.h HAVE_GETPRIORITY)
108-
check_symbol_exists(pset_bind sys/pset.h HAVE_PSET_BIND)
105+
check_symbol_exists(forkx sys/fork.h PHP_EXT_PCNTL_HAVE_FORKX)
106+
set(HAVE_FORKX ${PHP_EXT_PCNTL_HAVE_FORKX})
107+
108+
check_symbol_exists(getcpuid sys/processor.h PHP_EXT_PCNTL_HAVE_GETCPUID)
109+
set(HAVE_GETCPUID ${PHP_EXT_PCNTL_HAVE_GETCPUID})
110+
111+
check_symbol_exists(getpriority sys/resource.h PHP_EXT_PCNTL_HAVE_GETPRIORITY)
112+
set(HAVE_GETPRIORITY ${PHP_EXT_PCNTL_HAVE_GETPRIORITY})
113+
114+
check_symbol_exists(pset_bind sys/pset.h PHP_EXT_PCNTL_HAVE_PSET_BIND)
115+
set(HAVE_PSET_BIND ${PHP_EXT_PCNTL_HAVE_PSET_BIND})
116+
109117
check_symbol_exists(
110118
pthread_set_qos_class_self_np
111119
pthread/qos.h
120+
PHP_EXT_PCNTL_HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP
121+
)
122+
set(
112123
HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP
124+
${PHP_EXT_PCNTL_HAVE_PTHREAD_SET_QOS_CLASS_SELF_NP}
113125
)
114-
check_symbol_exists(rfork unistd.h HAVE_RFORK)
126+
127+
check_symbol_exists(rfork unistd.h PHP_EXT_PCNTL_HAVE_RFORK)
128+
set(HAVE_RFORK ${PHP_EXT_PCNTL_HAVE_RFORK})
129+
115130
cmake_push_check_state(RESET)
116131
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
117-
check_symbol_exists(sched_setaffinity sched.h HAVE_SCHED_SETAFFINITY)
132+
check_symbol_exists(
133+
sched_setaffinity
134+
sched.h
135+
PHP_EXT_PCNTL_HAVE_SCHED_SETAFFINITY
136+
)
137+
set(HAVE_SCHED_SETAFFINITY ${PHP_EXT_PCNTL_HAVE_SCHED_SETAFFINITY})
118138
cmake_pop_check_state()
119-
check_symbol_exists(setpriority sys/resource.h HAVE_SETPRIORITY)
120-
check_symbol_exists(sigtimedwait signal.h HAVE_SIGTIMEDWAIT)
121-
check_symbol_exists(sigwaitinfo signal.h HAVE_SIGWAITINFO)
122-
check_symbol_exists(SYS_pidfd_open sys/syscall.h HAVE_PIDFD_OPEN)
139+
140+
check_symbol_exists(setpriority sys/resource.h PHP_EXT_PCNTL_HAVE_SETPRIORITY)
141+
set(HAVE_SETPRIORITY ${PHP_EXT_PCNTL_HAVE_SETPRIORITY})
142+
143+
check_symbol_exists(sigtimedwait signal.h PHP_EXT_PCNTL_HAVE_SIGTIMEDWAIT)
144+
set(HAVE_SIGTIMEDWAIT ${PHP_EXT_PCNTL_HAVE_SIGTIMEDWAIT})
145+
146+
check_symbol_exists(sigwaitinfo signal.h PHP_EXT_PCNTL_HAVE_SIGWAITINFO)
147+
set(HAVE_SIGWAITINFO ${PHP_EXT_PCNTL_HAVE_SIGWAITINFO})
148+
149+
check_symbol_exists(SYS_pidfd_open sys/syscall.h PHP_EXT_PCNTL_HAVE_PIDFD_OPEN)
150+
set(HAVE_PIDFD_OPEN ${PHP_EXT_PCNTL_HAVE_PIDFD_OPEN})
151+
123152
cmake_push_check_state(RESET)
124153
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
125-
check_symbol_exists(unshare sched.h HAVE_UNSHARE)
154+
check_symbol_exists(unshare sched.h PHP_EXT_PCNTL_HAVE_UNSHARE)
155+
set(HAVE_UNSHARE ${PHP_EXT_PCNTL_HAVE_UNSHARE})
126156
cmake_pop_check_state()
127-
check_symbol_exists(wait3 sys/wait.h HAVE_WAIT3)
128-
check_symbol_exists(wait4 sys/wait.h HAVE_WAIT4)
129-
check_symbol_exists(waitid sys/wait.h HAVE_WAITID)
130-
check_symbol_exists(WCONTINUED sys/wait.h HAVE_DECL_WCONTINUED)
131-
check_symbol_exists(WEXITED sys/wait.h HAVE_DECL_WEXITED)
132-
check_symbol_exists(WIFCONTINUED sys/wait.h HAVE_WIFCONTINUED)
133-
check_symbol_exists(WNOWAIT sys/wait.h HAVE_DECL_WNOWAIT)
134-
check_symbol_exists(WSTOPPED sys/wait.h HAVE_DECL_WSTOPPED)
157+
158+
check_symbol_exists(wait3 sys/wait.h PHP_EXT_PCNTL_HAVE_WAIT3)
159+
set(HAVE_WAIT3 ${PHP_EXT_PCNTL_HAVE_WAIT3})
160+
161+
check_symbol_exists(wait4 sys/wait.h PHP_EXT_PCNTL_HAVE_WAIT4)
162+
set(HAVE_WAIT4 ${PHP_EXT_PCNTL_HAVE_WAIT4})
163+
164+
check_symbol_exists(waitid sys/wait.h PHP_EXT_PCNTL_HAVE_WAITID)
165+
set(HAVE_WAITID ${PHP_EXT_PCNTL_HAVE_WAITID})
166+
167+
check_symbol_exists(WCONTINUED sys/wait.h PHP_EXT_PCNTL_HAVE_DECL_WCONTINUED)
168+
set(HAVE_DECL_WCONTINUED ${PHP_EXT_PCNTL_HAVE_DECL_WCONTINUED})
169+
170+
check_symbol_exists(WEXITED sys/wait.h PHP_EXT_PCNTL_HAVE_DECL_WEXITED)
171+
set(HAVE_DECL_WEXITED ${PHP_EXT_PCNTL_HAVE_DECL_WEXITED})
172+
173+
check_symbol_exists(WIFCONTINUED sys/wait.h PHP_EXT_PCNTL_HAVE_WIFCONTINUED)
174+
set(HAVE_WIFCONTINUED ${PHP_EXT_PCNTL_HAVE_WIFCONTINUED})
175+
176+
check_symbol_exists(WNOWAIT sys/wait.h PHP_EXT_PCNTL_HAVE_DECL_WNOWAIT)
177+
set(HAVE_DECL_WNOWAIT ${PHP_EXT_PCNTL_HAVE_DECL_WNOWAIT})
178+
179+
check_symbol_exists(WSTOPPED sys/wait.h PHP_EXT_PCNTL_HAVE_DECL_WSTOPPED)
180+
set(HAVE_DECL_WSTOPPED ${PHP_EXT_PCNTL_HAVE_DECL_WSTOPPED})
135181

136182
cmake_push_check_state(RESET)
137183
# Some of these enum values require _GNU_SOURCE.
@@ -140,30 +186,34 @@ cmake_push_check_state(RESET)
140186
check_source_compiles(C [[
141187
#include <sys/wait.h>
142188
int main(void) { idtype_t e = P_ALL; (void)e; return 0; }
143-
]] HAVE_DECL_P_ALL)
189+
]] PHP_EXT_PCNTL_HAVE_DECL_P_ALL)
190+
set(HAVE_DECL_P_ALL ${PHP_EXT_PCNTL_HAVE_DECL_P_ALL})
144191

145192
check_source_compiles(C [[
146193
#include <sys/wait.h>
147194
int main(void) { idtype_t e = P_JAILID; (void)e; return 0; }
148-
]] HAVE_DECL_P_JAILID)
195+
]] PHP_EXT_PCNTL_HAVE_DECL_P_JAILID)
196+
set(HAVE_DECL_P_JAILID ${PHP_EXT_PCNTL_HAVE_DECL_P_JAILID})
149197

150198
check_source_compiles(C [[
151199
#include <sys/wait.h>
152200
int main(void) { idtype_t e = P_PIDFD; (void)e; return 0; }
153-
]] HAVE_DECL_P_PIDFD)
201+
]] PHP_EXT_PCNTL_HAVE_DECL_P_PIDFD)
202+
set(HAVE_DECL_P_PIDFD ${PHP_EXT_PCNTL_HAVE_DECL_P_PIDFD})
154203

155204
check_source_compiles(C [[
156205
#include <sys/wait.h>
157206
int main(void) { idtype_t e = P_UID; (void)e; return 0; }
158-
]] HAVE_DECL_P_UID)
207+
]] PHP_EXT_PCNTL_HAVE_DECL_P_UID)
208+
set(HAVE_DECL_P_UID ${PHP_EXT_PCNTL_HAVE_DECL_P_UID})
159209
cmake_pop_check_state()
160210

161211
cmake_push_check_state(RESET)
162212
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
163-
check_type_size(siginfo_t STRUCT_SIGINFO_T)
213+
check_type_size(siginfo_t PHP_EXT_PCNTL_STRUCT_SIGINFO_T)
164214
cmake_pop_check_state()
165215

166-
if(HAVE_STRUCT_SIGINFO_T)
216+
if(HAVE_PHP_EXT_PCNTL_STRUCT_SIGINFO_T)
167217
target_compile_definitions(php_ext_pcntl PRIVATE HAVE_STRUCT_SIGINFO_T)
168218
endif()
169219

@@ -177,13 +227,13 @@ cmake_push_check_state(RESET)
177227
HEADERS sched.h
178228
LIBRARIES
179229
gnu # Haiku
180-
VARIABLE PHP_EXT_PCNTL_HAS_SCHED_GETCPU_SYMBOL
181-
LIBRARY_VARIABLE PHP_EXT_PCNTL_HAS_SCHED_GETCPU_LIBRARY
230+
VARIABLE PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_SYMBOL
231+
LIBRARY_VARIABLE PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY
182232
)
183233

184-
if(PHP_EXT_PCNTL_HAS_SCHED_GETCPU_SYMBOL)
185-
if(PHP_EXT_PCNTL_HAS_SCHED_GETCPU_LIBRARY)
186-
set(CMAKE_REQUIRED_LIBRARIES ${PHP_EXT_PCNTL_HAS_SCHED_GETCPU_LIBRARY})
234+
if(PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_SYMBOL)
235+
if(PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY)
236+
set(CMAKE_REQUIRED_LIBRARIES ${PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY})
187237
endif()
188238
check_source_runs(C [[
189239
#include <sched.h>
@@ -194,14 +244,14 @@ cmake_push_check_state(RESET)
194244
}
195245
return 0;
196246
}
197-
]] PHP_EXT_PCNTL_HAS_SCHED_GETCPU)
247+
]] PHP_EXT_PCNTL_HAVE_SCHED_GETCPU)
198248
endif()
199249

200-
if(PHP_EXT_PCNTL_HAS_SCHED_GETCPU)
201-
if(PHP_EXT_PCNTL_HAS_SCHED_GETCPU_LIBRARY)
250+
if(PHP_EXT_PCNTL_HAVE_SCHED_GETCPU)
251+
if(PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY)
202252
target_link_libraries(
203253
php_ext_pcntl
204-
PRIVATE ${PHP_EXT_PCNTL_HAS_SCHED_GETCPU_LIBRARY}
254+
PRIVATE ${PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY}
205255
)
206256
endif()
207257

cmake/ext/standard/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,12 @@ include(cmake/CheckStrptime.cmake)
288288
# Check if there is a support means of creating a new process and defining which
289289
# handles it receives.
290290
message(CHECK_START "Checking if OS can spawn processes with inherited handles")
291-
check_symbol_exists(fork unistd.h HAVE_FORK)
292-
if(NOT HAVE_FORK)
293-
check_symbol_exists(CreateProcess windows.h PHP_HAS_CREATEPROCESS)
291+
check_symbol_exists(fork unistd.h PHP_HAVE_FORK)
292+
set(HAVE_FORK ${PHP_HAVE_FORK})
293+
if(NOT PHP_HAVE_FORK)
294+
check_symbol_exists(CreateProcess windows.h PHP_HAVE_CREATEPROCESS)
294295
endif()
295-
if(HAVE_FORK OR PHP_HAS_CREATEPROCESS)
296+
if(PHP_HAVE_FORK OR PHP_HAVE_CREATEPROCESS)
296297
set(PHP_CAN_SUPPORT_PROC_OPEN TRUE)
297298

298299
message(CHECK_PASS "yes")

0 commit comments

Comments
 (0)