Skip to content

Commit 470317b

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents b7f5c4f + b714227 commit 470317b

File tree

10 files changed

+128
-117
lines changed

10 files changed

+128
-117
lines changed

cmake/main/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,20 @@ function(_php_main_create_files)
387387
file(READ ${CMAKE_CURRENT_BINARY_DIR}/Zend/CMakeFiles/zend_config.h config)
388388
string(STRIP "${config}" ZEND_CONFIGURATION)
389389

390+
# Add sapis configuration.
391+
set(config "")
392+
get_cmake_property(sapis PHP_SAPIS)
393+
list(SORT sapis COMPARE NATURAL)
394+
foreach(sapi IN LISTS sapis)
395+
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/sapi/${sapi}/config.h)
396+
file(READ ${CMAKE_CURRENT_BINARY_DIR}/sapi/${sapi}/config.h content)
397+
if(content)
398+
string(APPEND config "\n${content}")
399+
endif()
400+
endif()
401+
endforeach()
402+
string(STRIP "${config}" PHP_SAPIS_CONFIGURATION)
403+
390404
# Add extensions configuration.
391405
set(config "")
392406
get_cmake_property(extensions PHP_EXTENSIONS)

cmake/main/php_config.cmake.h.in

Lines changed: 6 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
and to string "0" if they are not. */
4949
#define DEFAULT_SHORT_OPEN_TAG "@DEFAULT_SHORT_OPEN_TAG@"
5050

51-
/* Define to 1 if 'TIOCGWINSZ' requires <sys/ioctl.h>. */
52-
#cmakedefine GWINSZ_IN_SYS_IOCTL 1
53-
5451
/* Define to 1 when aarch64 CRC32 API is available. */
5552
#cmakedefine HAVE_AARCH64_CRC32 1
5653

@@ -66,9 +63,6 @@
6663
/* Define to 1 if you have the 'alphasort' function. */
6764
#cmakedefine HAVE_ALPHASORT 1
6865

69-
/* Define to 1 if AppArmor confinement is available for PHP-FPM. */
70-
#cmakedefine HAVE_APPARMOR 1
71-
7266
/* Define to 1 if you have the <arpa/inet.h> header file. */
7367
#cmakedefine HAVE_ARPA_INET_H 1
7468

@@ -93,21 +87,9 @@
9387
/* Define to 1 if PHP has the <main/build-defs.h> header file. */
9488
#cmakedefine HAVE_BUILD_DEFS_H 1
9589

96-
/* Define to 1 if compiler supports __sync_bool_compare_and_swap() a.o. */
97-
#cmakedefine HAVE_BUILTIN_ATOMIC 1
98-
9990
/* Define to 1 if you have the 'chroot' function. */
10091
#cmakedefine HAVE_CHROOT 1
10192

102-
/* Define to 1 if you have the 'clearenv' function. */
103-
#cmakedefine HAVE_CLEARENV 1
104-
105-
/* Define to 1 if you have the 'clock_gettime' function. */
106-
#cmakedefine HAVE_CLOCK_GETTIME 1
107-
108-
/* Define to 1 if you have the 'clock_get_time' function. */
109-
#cmakedefine HAVE_CLOCK_GET_TIME 1
110-
11193
/* Define to 1 if you have the 'copy_file_range' function. */
11294
#cmakedefine HAVE_COPY_FILE_RANGE 1
11395

@@ -129,9 +111,6 @@
129111
/* Define to 1 if DTrace support is enabled. */
130112
#cmakedefine HAVE_DTRACE 1
131113

132-
/* Define to 1 if system has a working epoll. */
133-
#cmakedefine HAVE_EPOLL 1
134-
135114
/* Define to 1 if you have the 'explicit_bzero' function. */
136115
#cmakedefine HAVE_EXPLICIT_BZERO 1
137116

@@ -150,9 +129,6 @@
150129
/* Define to 1 if you have the 'fopencookie' function. */
151130
#cmakedefine HAVE_FOPENCOOKIE 1
152131

153-
/* Define to 1 if PHP-FPM has ACL support. */
154-
#cmakedefine HAVE_FPM_ACL 1
155-
156132
/* Define to 1 if you have the 'ftok' function. */
157133
#cmakedefine HAVE_FTOK 1
158134

@@ -252,9 +228,6 @@
252228
/* Define to 1 if IPv6 is enabled and supported. */
253229
#cmakedefine HAVE_IPV6 1
254230

255-
/* Define to 1 if system has a working 'kqueue' function. */
256-
#cmakedefine HAVE_KQUEUE 1
257-
258231
/* Define to 1 if you have the <langinfo.h> header file. */
259232
#cmakedefine HAVE_LANGINFO_H 1
260233

@@ -273,18 +246,6 @@
273246
/* Define to 1 if you have the 'localtime_r' function. */
274247
#cmakedefine HAVE_LOCALTIME_R 1
275248

276-
/* Define to 1 if you have 'SO_LISTENQ*'. */
277-
#cmakedefine HAVE_LQ_SO_LISTENQ 1
278-
279-
/* Define to 1 if you have 'TCP_CONNECTION_INFO'. */
280-
#cmakedefine HAVE_LQ_TCP_CONNECTION_INFO 1
281-
282-
/* Define to 1 if you have 'TCP_INFO'. */
283-
#cmakedefine HAVE_LQ_TCP_INFO 1
284-
285-
/* Define to 1 if you have the 'mach_vm_read' function. */
286-
#cmakedefine HAVE_MACH_VM_READ 1
287-
288249
/* Define to 1 if you have the 'memcntl' function. */
289250
#cmakedefine HAVE_MEMCNTL 1
290251

@@ -321,33 +282,21 @@
321282
/* Define to 1 if you have the 'openpty' function. */
322283
#cmakedefine HAVE_OPENPTY 1
323284

324-
/* Define to 1 if the phpdbg SAPI has libedit/readline integration. */
325-
#cmakedefine HAVE_PHPDBG_READLINE 1
326-
327285
/* Define to 1 if you have the 'poll' function. */
328286
#cmakedefine HAVE_POLL 1
329287

330288
/* Define to 1 if you have the <poll.h> header file. */
331289
#cmakedefine HAVE_POLL_H 1
332290

333-
/* Define to 1 if you have the 'port_create' function. */
334-
#cmakedefine HAVE_PORT_CREATE 1
335-
336291
/* Define to 1 if you have the 'prctl' function. */
337292
#cmakedefine HAVE_PRCTL 1
338293

339294
/* Define to 1 if you have the 'procctl' function. */
340295
#cmakedefine HAVE_PROCCTL 1
341296

342-
/* Define if the PS_STRINGS exists. */
343-
#cmakedefine HAVE_PS_STRINGS
344-
345297
/* Define to 1 if you have the 'pthread_jit_write_protect_np' function. */
346298
#cmakedefine HAVE_PTHREAD_JIT_WRITE_PROTECT_NP 1
347299

348-
/* Define to 1 if you have the 'ptrace' function. */
349-
#cmakedefine HAVE_PTRACE 1
350-
351300
/* Define to 1 if the system has the type 'ptrdiff_t'. */
352301
#cmakedefine HAVE_PTRDIFF_T 1
353302

@@ -366,27 +315,12 @@
366315
/* Define to 1 if you have the 'scandir' function. */
367316
#cmakedefine HAVE_SCANDIR 1
368317

369-
/* Define to 1 if system has a working 'select' function. */
370-
#cmakedefine HAVE_SELECT 1
371-
372-
/* Define to 1 if SELinux is available in PHP-FPM. */
373-
#cmakedefine HAVE_SELINUX 1
374-
375318
/* Define to 1 if you have the 'setenv' function. */
376319
#cmakedefine HAVE_SETENV 1
377320

378321
/* Define to 1 if you have the 'setitimer' function. */
379322
#cmakedefine HAVE_SETITIMER 1
380323

381-
/* Define to 1 if you have the 'setpflags' function. */
382-
#cmakedefine HAVE_SETPFLAGS 1
383-
384-
/* Define to 1 if you have the 'setproctitle' function. */
385-
#cmakedefine HAVE_SETPROCTITLE 1
386-
387-
/* Define to 1 if you have the 'setproctitle_fast' function. */
388-
#cmakedefine HAVE_SETPROCTITLE_FAST 1
389-
390324
/* Define to 1 if you have the 'shutdown' function. */
391325
#cmakedefine HAVE_SHUTDOWN 1
392326

@@ -444,9 +378,6 @@
444378
/* Define to 1 if the system has the type 'struct sockaddr_storage'. */
445379
#cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE 1
446380

447-
/* Define to 1 if 'sun_len' is a member of 'struct sockaddr_un'. */
448-
#cmakedefine HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1
449-
450381
/* Define to 1 if 'st_blksize' is a member of 'struct stat'. */
451382
#cmakedefine HAVE_STRUCT_STAT_ST_BLKSIZE 1
452383

@@ -471,12 +402,6 @@
471402
/* Define to 1 if you have the <syslog.h> header file. */
472403
#cmakedefine HAVE_SYSLOG_H 1
473404

474-
/* Define to 1 if FPM has systemd integration. */
475-
#cmakedefine HAVE_SYSTEMD 1
476-
477-
/* Define to 1 if you have the <sys/acl.h> header file. */
478-
#cmakedefine HAVE_SYS_ACL_H 1
479-
480405
/* Define to 1 if you have the <sys/file.h> header file. */
481406
#cmakedefine HAVE_SYS_FILE_H 1
482407

@@ -501,9 +426,6 @@
501426
/* Define to 1 if you have the <sys/poll.h> header file. */
502427
#cmakedefine HAVE_SYS_POLL_H 1
503428

504-
/* Define to 1 if you have the <sys/pstat.h> header file. */
505-
#cmakedefine HAVE_SYS_PSTAT_H 1
506-
507429
/* Define to 1 if you have the <sys/resource.h> header file. */
508430
#cmakedefine HAVE_SYS_RESOURCE_H 1
509431

@@ -543,9 +465,6 @@
543465
/* Define to 1 if you have the <sys/wait.h> header file. */
544466
#cmakedefine HAVE_SYS_WAIT_H 1
545467

546-
/* Define to 1 if you have the 'times' function. */
547-
#cmakedefine HAVE_TIMES 1
548-
549468
/* Define to 1 if you have the <tmmintrin.h> header file. */
550469
#cmakedefine HAVE_TMMINTRIN_H 1
551470

@@ -561,10 +480,6 @@
561480
/* Define to 1 if you have the 'unsetenv' function. */
562481
#cmakedefine HAVE_UNSETENV 1
563482

564-
/* Define to 1 if faulting on write-protected memory support can be compiled
565-
for userfaultfd. */
566-
#cmakedefine HAVE_USERFAULTFD_WRITEFAULT 1
567-
568483
/* Define to 1 if you have the 'usleep' function. */
569484
#cmakedefine HAVE_USLEEP 1
570485

@@ -704,9 +619,6 @@
704619
/* Define to 1 if 'write(2)' works. */
705620
#cmakedefine PHP_WRITE_STDOUT 1
706621

707-
/* Define to the /proc/pid/mem interface filename value. */
708-
#cmakedefine PROC_MEM_FILE "@PROC_MEM_FILE@"
709-
710622
/* The size of 'int', as computed by sizeof. */
711623
@SIZEOF_INT_CODE@
712624

@@ -734,9 +646,6 @@
734646
/* Define to 1 if strerror_r returns char *. */
735647
#cmakedefine STRERROR_R_CHAR_P 1
736648

737-
/* Define to 1 if cross-process locking is required by 'accept()'. */
738-
#cmakedefine USE_LOCKING 1
739-
740649
@PHP_SYSTEM_EXTENSIONS@
741650

742651
/* Define if processor uses big-endian word. */
@@ -761,6 +670,12 @@
761670

762671
@ZEND_CONFIGURATION@
763672

673+
/*****************************************************************************
674+
PHP SAPIs configuration
675+
****************************************************************************/
676+
677+
@PHP_SAPIS_CONFIGURATION@
678+
764679
/*****************************************************************************
765680
PHP extensions configuration
766681
****************************************************************************/

cmake/sapi/cgi/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ check_struct_has_member("struct sockaddr_un" sun_len sys/un.h HAVE_STRUCT_SOCKAD
5555

5656
message(CHECK_START "Checking whether accept() requires cross-process locking")
5757
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
58-
set(USE_LOCKING 1 CACHE INTERNAL "Whether accept() requires cross-process locking")
59-
endif()
60-
if(USE_LOCKING)
58+
set(USE_LOCKING 1)
6159
message(CHECK_PASS "yes")
6260
else()
61+
set(USE_LOCKING 0)
6362
message(CHECK_FAIL "no")
6463
endif()
6564

@@ -77,3 +76,5 @@ install(
7776
RENAME ${PHP_PROGRAM_PREFIX}php-cgi${PHP_PROGRAM_SUFFIX}.1
7877
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
7978
)
79+
80+
configure_file(config.cmake.h.in config.h)

cmake/sapi/cgi/config.cmake.h.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* Define to 1 if 'sun_len' is a member of 'struct sockaddr_un'. */
2+
#cmakedefine HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1
3+
4+
/* Define to 1 if cross-process locking is required by 'accept()'. */
5+
#cmakedefine USE_LOCKING 1

cmake/sapi/cli/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,5 @@ install(
168168
RENAME ${PHP_PROGRAM_PREFIX}php${PHP_PROGRAM_SUFFIX}.1
169169
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
170170
)
171+
172+
configure_file(config.cmake.h.in config.h)

cmake/sapi/cli/config.cmake.h.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Define if the PS_STRINGS exists. */
2+
#cmakedefine HAVE_PS_STRINGS
3+
4+
/* Define to 1 if you have the 'setproctitle' function. */
5+
#cmakedefine HAVE_SETPROCTITLE 1
6+
7+
/* Define to 1 if you have the <sys/pstat.h> header file. */
8+
#cmakedefine HAVE_SYS_PSTAT_H 1

cmake/sapi/fpm/CMakeLists.txt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ php_set(
3030
VALUE "nobody"
3131
DOC "Set the user for running PHP FPM (default: nobody)"
3232
)
33-
unset(PHP_FPM_USER CACHE)
34-
if(SAPI_FPM_USER)
35-
set(PHP_FPM_USER "${SAPI_FPM_USER}" CACHE INTERNAL "FPM user")
36-
endif()
3733

3834
php_set(
3935
SAPI_FPM_GROUP
@@ -44,10 +40,6 @@ php_set(
4440
"Set the group for running PHP FPM. For a system user, this should usually "
4541
"be set to match the FPM username (default: nobody)"
4642
)
47-
unset(PHP_FPM_GROUP CACHE)
48-
if(SAPI_FPM_GROUP)
49-
set(PHP_FPM_GROUP "${SAPI_FPM_GROUP}" CACHE INTERNAL "FPM group")
50-
endif()
5143

5244
php_set(
5345
SAPI_FPM_SYSTEMD
@@ -332,14 +324,14 @@ if(SAPI_FPM_SYSTEMD)
332324
target_link_libraries(php_fpm PRIVATE Systemd::Systemd)
333325

334326
if(TARGET Systemd::Systemd)
335-
set(HAVE_SYSTEMD 1 CACHE INTERNAL "Whether FPM is using systemd integration")
327+
set(HAVE_SYSTEMD 1)
336328

337329
target_sources(php_fpm PRIVATE fpm/fpm_systemd.c)
338330
endif()
339331

340-
set(PHP_FPM_SYSTEMD "notify" CACHE INTERNAL "FPM systemd service type")
332+
set(PHP_FPM_SYSTEMD "notify")
341333
else()
342-
set(PHP_FPM_SYSTEMD "simple" CACHE INTERNAL "FPM systemd service type")
334+
set(PHP_FPM_SYSTEMD "simple")
343335
endif()
344336

345337
if(SAPI_FPM_ACL)
@@ -360,7 +352,7 @@ if(SAPI_FPM_ACL)
360352
check_include_file(sys/acl.h HAVE_SYS_ACL_H)
361353
cmake_pop_check_state()
362354

363-
set(HAVE_FPM_ACL 1 CACHE INTERNAL "Whether FPM has ACL support")
355+
set(HAVE_FPM_ACL 1)
364356
endif()
365357
endif()
366358

@@ -376,7 +368,7 @@ if(SAPI_FPM_APPARMOR)
376368
target_link_libraries(php_fpm PRIVATE AppArmor::AppArmor)
377369

378370
if(TARGET AppArmor::AppArmor)
379-
set(HAVE_APPARMOR 1 CACHE INTERNAL "Whether AppArmor is present")
371+
set(HAVE_APPARMOR 1)
380372
endif()
381373
endif()
382374

@@ -392,7 +384,7 @@ if(SAPI_FPM_SELINUX)
392384
target_link_libraries(php_fpm PRIVATE SELinux::SELinux)
393385

394386
if(TARGET SELinux::SELinux)
395-
set(HAVE_SELINUX 1 CACHE INTERNAL "Whether SELinux is present")
387+
set(HAVE_SELINUX 1)
396388
endif()
397389
endif()
398390

@@ -539,3 +531,5 @@ install(
539531
${CMAKE_CURRENT_BINARY_DIR}/status.html
540532
DESTINATION ${CMAKE_INSTALL_DATADIR}/fpm
541533
)
534+
535+
configure_file(config.cmake.h.in config.h)

0 commit comments

Comments
 (0)