Skip to content

Commit d32cf41

Browse files
committed
Merge branch 'PHP-8.4'
2 parents f354d44 + 3b6ee80 commit d32cf41

File tree

120 files changed

+153
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+153
-76
lines changed

bin/make-docs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function generateModuleDocs(
4545
}
4646
}
4747

48-
$docs = __DIR__ . '/../docs/cmake-modules';
48+
$docs = __DIR__ . '/../docs/cmake/modules';
4949
if (!file_exists($docs)) {
5050
mkdir($docs, 0777, true);
5151
}

cmake/Zend/CMakeLists.txt

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,34 @@ endblock()
4848
include(CheckIncludeFile)
4949
include(CheckSourceCompiles)
5050
include(CheckSymbolExists)
51+
include(CMakeDependentOption)
5152
include(CMakePushCheckState)
53+
include(FeatureSummary)
5254
include(PHP/AddCustomCommand)
5355

5456
################################################################################
5557
# Configuration.
5658
################################################################################
5759

58-
option(ZEND_GCC_GLOBAL_REGS "Enable GCC global register variables" ON)
59-
mark_as_advanced(ZEND_GCC_GLOBAL_REGS)
60-
61-
option(ZEND_FIBER_ASM "Enable the use of Boost fiber assembly files" ON)
60+
cmake_dependent_option(
61+
ZEND_FIBER_ASM
62+
"Enable the use of Boost fiber assembly files"
63+
ON
64+
[[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
65+
ON
66+
)
6267
mark_as_advanced(ZEND_FIBER_ASM)
6368

64-
option(ZEND_SIGNALS "Enable Zend signal handling" ON)
69+
option(ZEND_GLOBAL_REGISTER_VARIABLES "Enable global register variables" ON)
70+
mark_as_advanced(ZEND_GLOBAL_REGISTER_VARIABLES)
71+
72+
cmake_dependent_option(
73+
ZEND_SIGNALS
74+
"Enable Zend signal handling"
75+
ON
76+
[[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
77+
OFF
78+
)
6579
mark_as_advanced(ZEND_SIGNALS)
6680

6781
################################################################################
@@ -412,13 +426,23 @@ endif()
412426
# Check Zend signals.
413427
message(CHECK_START "Checking whether to enable Zend signal handling")
414428
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
415-
if(NOT HAVE_SIGACTION OR NOT ZEND_SIGNALS)
416-
message(CHECK_FAIL "no")
417-
set_property(CACHE ZEND_SIGNALS PROPERTY VALUE 0)
418-
else()
429+
if(HAVE_SIGACTION AND ZEND_SIGNALS)
419430
message(CHECK_PASS "yes")
420-
set_property(CACHE ZEND_SIGNALS PROPERTY VALUE 1)
431+
432+
set_property(CACHE ZEND_SIGNALS PROPERTY VALUE ON)
433+
434+
# zend_config.h (or its parent php_config.h) isn't included in some zend_*
435+
# files, therefore also compilation definitions are added.
436+
target_compile_definitions(zend PRIVATE ZEND_SIGNALS)
437+
else()
438+
set_property(CACHE ZEND_SIGNALS PROPERTY VALUE OFF)
439+
message(CHECK_FAIL "no")
421440
endif()
441+
add_feature_info(
442+
"Zend signals"
443+
ZEND_SIGNALS
444+
"signals handling within the Zend Engine for performance"
445+
)
422446

423447
# Check Zend max execution timers.
424448
include(Zend/MaxExecutionTimers)
@@ -430,8 +454,8 @@ endif()
430454
include(Zend/CheckMMAlignment)
431455

432456
# Check for global register variables.
433-
if(ZEND_GCC_GLOBAL_REGS)
434-
include(Zend/CheckGlobalRegisterVars)
457+
if(ZEND_GLOBAL_REGISTER_VARIABLES)
458+
include(Zend/CheckGlobalRegisterVariables)
435459
endif()
436460

437461
# Check if stack grows downward.
@@ -440,12 +464,6 @@ include(Zend/CheckStackLimit)
440464
# Check float precision.
441465
include(Zend/CheckFloatPrecision)
442466

443-
# zend_config.h (or its parent php_config.h) isn't included in some zend_*
444-
# files, therefore also compilation definitions need to be added.
445-
if(ZEND_SIGNALS)
446-
target_compile_definitions(zend PRIVATE ZEND_SIGNALS)
447-
endif()
448-
449467
################################################################################
450468
# Generate lexers and parsers.
451469
################################################################################

cmake/cmake/modules/Zend/CheckGlobalRegisterVars.cmake renamed to cmake/cmake/modules/Zend/CheckGlobalRegisterVariables.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#[=============================================================================[
2-
Check for global register variables support.
2+
Check whether the compiler and target system support global register variables.
33
4-
Cache variables:
4+
Global register variables are relevant for the GNU C compatible compilers.
5+
6+
See also: [GCC global register variables](https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html)
7+
8+
## Cache variables
59
610
* `HAVE_GCC_GLOBAL_REGS`
7-
Whether the target system has support for global register variables.
11+
12+
Whether global register variables are supported.
813
#]=============================================================================]
914

1015
include_guard(GLOBAL)

cmake/cmake/modules/Zend/Fibers.cmake

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@ Check if Fibers can be used.
44
This module adds Boost fiber assembly files support if available for the
55
platform, otherwise it checks if ucontext can be used.
66
7-
Interface library:
7+
## Control variables
88
9-
* `Zend::Fibers`
10-
Library using Boost fiber assembly files if available.
9+
* `ZEND_FIBER_ASM`
1110
12-
Cache variables:
11+
Whether to use Boost fiber assembly files.
12+
13+
## Cache variables
1314
1415
* `ZEND_FIBER_UCONTEXT`
16+
1517
Whether `<ucontext.h>` header file is available and should be used.
1618
17-
Control variables:
19+
## Interface library
1820
19-
* `ZEND_FIBER_ASM`
20-
Whether to use Boost fiber assembly files.
21+
* `Zend::Fibers`
22+
23+
Interface library using Boost fiber assembly files and compile options if
24+
available.
2125
#]=============================================================================]
2226

2327
include_guard(GLOBAL)

cmake/cmake/modules/Zend/MaxExecutionTimers.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Check whether to enable Zend max execution timers.
33
44
## Cache variables
55
6-
* [`ZEND_MAX_EXECUTION_TIMERS`](/docs/cmake/ZEND_MAX_EXECUTION_TIMERS.md)
6+
* [`ZEND_MAX_EXECUTION_TIMERS`](/docs/cmake/variables/ZEND_MAX_EXECUTION_TIMERS.md)
77
88
* `HAVE_TIMER_CREATE`
99
@@ -101,7 +101,7 @@ if(libraryForTimerCreate)
101101
endif()
102102

103103
# The configuration header with ZEND_MAX_EXECUTION_TIMERS might not be included
104-
# in some source files, therefore also compilation definitions is added.
104+
# in some source files, therefore also compilation definitions are added.
105105
if(ZEND_MAX_EXECUTION_TIMERS)
106106
target_compile_definitions(
107107
Zend::MaxExecutionTimers

cmake/sapi/phpdbg/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ block()
260260
configure_file(phpdbg.1.in phpdbg.1 @ONLY)
261261
endblock()
262262

263-
# TODO: Add prefix and suffix to installed executable file.
264263
install(
265264
TARGETS php_phpdbg
266265
RUNTIME

cmake/scripts/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ block()
4949

5050
message(STATUS "Creating scripts/php-config")
5151

52+
get_cmake_property(sapis PHP_SAPIS)
53+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.27)
54+
set(sapis "$<JOIN:$<LIST:SORT,${sapis}>, >")
55+
else()
56+
set(sapis "$<JOIN:${sapis}, >")
57+
endif()
58+
5259
# Replace the upstream php-config script hardcoded php include directory to a
5360
# template placeholder.
5461
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/php-config.in" content)
@@ -82,8 +89,7 @@ block()
8289
EXEEXT "${CMAKE_EXECUTABLE_SUFFIX}"
8390
# TODO:
8491
CONFIGURE_OPTIONS ""
85-
# TODO:
86-
PHP_INSTALLED_SAPIS ""
92+
PHP_INSTALLED_SAPIS "${sapis}"
8793
EXPANDED_PHP_CONFIG_FILE_SCAN_DIR "$<PATH:ABSOLUTE_PATH,NORMALIZE,${PHP_CONFIG_FILE_SCAN_DIR},$<INSTALL_PREFIX>>"
8894
EXPANDED_PHP_CONFIG_FILE_PATH "$<PATH:ABSOLUTE_PATH,NORMALIZE,${PHP_CONFIG_FILE_PATH},$<INSTALL_PREFIX>>"
8995
bindir "$<PATH:ABSOLUTE_PATH,NORMALIZE,${CMAKE_INSTALL_BINDIR},$<INSTALL_PREFIX>>"

docs/cmake-modules/Zend/CheckGlobalRegisterVars.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/cmake.md

Lines changed: 13 additions & 12 deletions

0 commit comments

Comments
 (0)