Skip to content

Commit 2f6390b

Browse files
committed
Merge branch 'PHP-8.4'
2 parents a1942e2 + 0201efb commit 2f6390b

File tree

164 files changed

+1013
-1263
lines changed

Some content is hidden

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

164 files changed

+1013
-1263
lines changed

cmake/Zend/cmake/CheckFloatPrecision.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Check for x87 floating point internal precision control.
33
44
See: https://wiki.php.net/rfc/rounding
55
6-
Cache variables:
6+
## Cache variables
77
88
* `HAVE__FPU_SETCW`
99
Whether `_FPU_SETCW` is usable.

cmake/Zend/cmake/CheckMMAlignment.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Test and set the alignment defines for the Zend memory manager (`ZEND_MM`). This
33
also does the logarithmic test.
44
5-
Cache variables:
5+
## Cache variables
66
77
* `ZEND_MM_ALIGNMENT`
88
* `ZEND_MM_ALIGNMENT_LOG2`

cmake/Zend/cmake/CheckStackLimit.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[=============================================================================[
22
Check whether the stack grows downwards. Assumes contiguous stack.
33
4-
Cache variables:
4+
## Cache variables
55
66
* `ZEND_CHECK_STACK_LIMIT`
77
Whether checking the stack limit is supported.

cmake/Zend/cmake/CheckStrerrorR.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Check for `strerror_r()`, and if its a POSIX-compatible or a GNU-specific
33
version.
44
5-
Cache variables:
5+
## Cache variables
66
77
* `HAVE_STRERROR_R`
88
Whether `strerror_r()` is available.

cmake/cmake/ConfigureChecks.cmake

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -500,41 +500,6 @@ if(TARGET PHP::CheckGethostbynameR)
500500
target_link_libraries(php_configuration INTERFACE PHP::CheckGethostbynameR)
501501
endif()
502502

503-
if(PHP_CCACHE)
504-
find_package(Ccache)
505-
endif()
506-
507-
# Check GCOV.
508-
if(PHP_GCOV)
509-
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
510-
message(FATAL_ERROR "GCC is required for using PHP_GCOV='ON'")
511-
endif()
512-
513-
# Check if ccache is being used.
514-
if(CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache")
515-
message(
516-
WARNING
517-
"ccache should be disabled when PHP_GCOV='ON' option is used. You can "
518-
"disable ccache by setting option PHP_CCACHE='OFF' or environment "
519-
"variable CCACHE_DISABLE=1."
520-
)
521-
endif()
522-
523-
find_package(Gcov)
524-
set_package_properties(
525-
Gcov
526-
PROPERTIES
527-
TYPE REQUIRED
528-
PURPOSE "Necessary to enable GCOV coverage report and symbols."
529-
)
530-
531-
if(TARGET Gcov::Gcov)
532-
target_link_libraries(php_configuration INTERFACE Gcov::Gcov)
533-
534-
gcov_generate_report()
535-
endif()
536-
endif()
537-
538503
################################################################################
539504
# Check for required libraries.
540505
################################################################################
@@ -802,3 +767,68 @@ block()
802767
target_link_libraries(php_configuration INTERFACE ${libgcc_path})
803768
endif()
804769
endblock()
770+
771+
################################################################################
772+
# Check for additional tools.
773+
################################################################################
774+
775+
if(PHP_CCACHE)
776+
find_package(Ccache)
777+
endif()
778+
779+
# Check GCOV.
780+
if(PHP_GCOV)
781+
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
782+
message(FATAL_ERROR "GCC is required for using PHP_GCOV='ON'")
783+
endif()
784+
785+
if(CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache")
786+
message(
787+
WARNING
788+
"ccache should be disabled when PHP_GCOV='ON' option is used. You can "
789+
"disable ccache by setting option PHP_CCACHE='OFF' or environment "
790+
"variable CCACHE_DISABLE=1."
791+
)
792+
endif()
793+
794+
find_package(Gcov)
795+
set_package_properties(
796+
Gcov
797+
PROPERTIES
798+
TYPE REQUIRED
799+
PURPOSE "Necessary to enable GCOV coverage report and symbols."
800+
)
801+
802+
if(TARGET Gcov::Gcov)
803+
target_link_libraries(php_configuration INTERFACE Gcov::Gcov)
804+
805+
gcov_generate_report()
806+
endif()
807+
endif()
808+
809+
# Check Valgrind.
810+
if(PHP_VALGRIND)
811+
find_package(Valgrind)
812+
set_package_properties(
813+
Valgrind
814+
PROPERTIES
815+
TYPE REQUIRED
816+
PURPOSE "Necessary to enable Valgrind support."
817+
)
818+
819+
if(Valgrind_FOUND)
820+
cmake_push_check_state(RESET)
821+
set(CMAKE_REQUIRED_LIBRARIES Valgrind::Valgrind)
822+
check_include_file(valgrind/cachegrind.h HAVE_VALGRIND_CACHEGRIND_H)
823+
cmake_pop_check_state()
824+
825+
set(HAVE_VALGRIND 1)
826+
endif()
827+
828+
target_link_libraries(php_configuration INTERFACE Valgrind::Valgrind)
829+
endif()
830+
add_feature_info(
831+
"Valgrind"
832+
PHP_VALGRIND
833+
"support for dynamic analysis"
834+
)

cmake/cmake/Requirements.cmake

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,6 @@ endif()
142142
################################################################################
143143
find_package(Sendmail)
144144

145-
################################################################################
146-
# Find Valgrind.
147-
################################################################################
148-
if(PHP_VALGRIND)
149-
find_package(Valgrind)
150-
set_package_properties(
151-
Valgrind
152-
PROPERTIES
153-
TYPE REQUIRED
154-
PURPOSE "Necessary to enable Valgrind support."
155-
)
156-
157-
target_link_libraries(php_configuration INTERFACE Valgrind::Valgrind)
158-
endif()
159-
160145
################################################################################
161146
# Find PHP installed on the system for generating stub files (*_arginfo.h),
162147
# Zend/zend_vm_gen.php, ext/tokenizer/tokenizer_data_gen.php and similar where

cmake/cmake/modules/FindACL.cmake

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,25 @@ Module defines the following `IMPORTED` target(s):
55
66
* `ACL::ACL` - The package library, if found.
77
8-
Result variables:
8+
## Result variables
99
1010
* `ACL_FOUND` - Whether the package has been found.
1111
* `ACL_INCLUDE_DIRS` - Include directories needed to use this package.
1212
* `ACL_LIBRARIES` - Libraries needed to link to the package library.
1313
* `ACL_VERSION` - Package version, if found.
1414
15-
Cache variables:
15+
## Cache variables
1616
1717
* `ACL_IS_BUILT_IN` - Whether ACL is a part of the C library (BSD-based
1818
systems).
1919
* `ACL_INCLUDE_DIR` - Directory containing package library headers.
2020
* `ACL_LIBRARY` - The path to the package library.
2121
22-
Hints:
22+
## Hints
2323
24-
The `ACL_ROOT` variable adds custom search path.
25-
26-
Set `ACL_USE_USER_GROUP` to `TRUE` before calling `find_package(ACL)` to also
27-
check if the ACL library supports `ACL_USER` and `ACL_GROUP`. For example, macOS
28-
doesn't have support for user/group.
24+
* Set `ACL_USE_USER_GROUP` to `TRUE` before calling `find_package(ACL)` to also
25+
check if the ACL library supports `ACL_USER` and `ACL_GROUP`. For example,
26+
macOS doesn't have support for user/group.
2927
#]=============================================================================]
3028

3129
include(CheckSourceCompiles)
@@ -141,7 +139,7 @@ if(ACL_IS_BUILT_IN)
141139
else()
142140
set(_ACL_REQUIRED_VARS ACL_LIBRARY ACL_INCLUDE_DIR)
143141

144-
# Use pkgconf, if available on the system.
142+
# Try pkg-config.
145143
find_package(PkgConfig QUIET)
146144
if(PKG_CONFIG_FOUND)
147145
pkg_check_modules(PC_ACL QUIET libacl)
@@ -150,7 +148,7 @@ else()
150148
find_path(
151149
ACL_INCLUDE_DIR
152150
NAMES sys/acl.h
153-
PATHS ${PC_ACL_INCLUDE_DIRS}
151+
HINTS ${PC_ACL_INCLUDE_DIRS}
154152
DOC "Directory containing ACL library headers"
155153
)
156154

@@ -161,25 +159,18 @@ else()
161159
find_library(
162160
ACL_LIBRARY
163161
NAMES acl
164-
PATHS ${PC_ACL_LIBRARY_DIRS}
162+
HINTS ${PC_ACL_LIBRARY_DIRS}
165163
DOC "The path to the ACL library"
166164
)
167165

168166
if(NOT ACL_LIBRARY)
169167
string(APPEND _reason "ACL library not found. ")
170168
endif()
171169

172-
# Get version.
173-
block(PROPAGATE ACL_VERSION)
174-
# ACL headers don't provide version. Try pkgconf version, if found.
175-
if(PC_ACL_VERSION AND ACL_INCLUDE_DIR)
176-
cmake_path(COMPARE "${ACL_INCLUDE_DIR}" EQUAL "${PC_ACL_INCLUDEDIR}" isEqual)
177-
178-
if(isEqual)
179-
set(ACL_VERSION ${PC_ACL_VERSION})
180-
endif()
181-
endif()
182-
endblock()
170+
# ACL headers don't provide version. Try pkg-config.
171+
if(PC_ACL_VERSION AND ACL_INCLUDE_DIR IN_LIST PC_ACL_INCLUDE_DIRS)
172+
set(ACL_VERSION ${PC_ACL_VERSION})
173+
endif()
183174

184175
_acl_check(_acl_works)
185176

@@ -204,6 +195,7 @@ find_package_handle_standard_args(
204195
${_ACL_REQUIRED_VARS}
205196
_acl_works
206197
VERSION_VAR ACL_VERSION
198+
HANDLE_VERSION_RANGE
207199
REASON_FAILURE_MESSAGE "${_reason}"
208200
)
209201

@@ -227,11 +219,11 @@ endif()
227219
if(NOT TARGET ACL::ACL)
228220
add_library(ACL::ACL UNKNOWN IMPORTED)
229221

230-
if(ACL_INCLUDE_DIR)
222+
if(ACL_INCLUDE_DIRS)
231223
set_target_properties(
232224
ACL::ACL
233225
PROPERTIES
234-
INTERFACE_INCLUDE_DIRECTORIES "${ACL_INCLUDE_DIR}"
226+
INTERFACE_INCLUDE_DIRECTORIES "${ACL_INCLUDE_DIRS}"
235227
)
236228
endif()
237229

cmake/cmake/modules/FindApache.cmake

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Module defines the following `IMPORTED` target(s):
99
1010
* `Apache::Apache` - The package library, if found.
1111
12-
Result variables:
12+
## Result variables
1313
1414
* `Apache_FOUND` - Whether the package has been found.
1515
* `Apache_INCLUDE_DIRS` - Include directories needed to use this package.
@@ -19,7 +19,7 @@ Result variables:
1919
* `Apache_LIBEXECDIR` - Path to the directory containing all Apache modules and
2020
`httpd.exp` file (list of exported symbols).
2121
22-
Cache variables:
22+
## Cache variables
2323
2424
* `Apache_APXS_EXECUTABLE` - Path to the APache eXtenSion tool command-line tool
2525
(`apxs`).
@@ -34,10 +34,6 @@ Cache variables:
3434
* `Apache_INCLUDE_DIR` - Directory containing package library headers.
3535
* `Apache_APR_INCLUDE_DIR` - Directory containing `apr` library headers.
3636
* `Apache_APR_LIBRARY` - The path to the `apr` library.
37-
38-
Hints:
39-
40-
The `Apache_ROOT` variable adds custom search path.
4137
#]=============================================================================]
4238

4339
include(FeatureSummary)
@@ -145,7 +141,7 @@ endif()
145141
find_program(
146142
Apache_APR_CONFIG_EXECUTABLE
147143
NAMES apr-config apr-1-config
148-
PATHS ${_Apache_APR_BINDIR}
144+
HINTS ${_Apache_APR_BINDIR}
149145
DOC "Path to the apr library command-line tool for retrieving metainformation"
150146
)
151147
mark_as_advanced(Apache_APR_CONFIG_EXECUTABLE)
@@ -190,8 +186,7 @@ if(Apache_APR_CONFIG_EXECUTABLE)
190186
)
191187
endif()
192188

193-
# Find the apr library (Apache portable runtime).
194-
# Use pkgconf, if available on the system.
189+
# Try pkg-config.
195190
find_package(PkgConfig QUIET)
196191
if(PKG_CONFIG_FOUND)
197192
pkg_check_modules(PC_Apache_APR QUIET apr-1)
@@ -200,7 +195,7 @@ endif()
200195
find_path(
201196
Apache_APR_INCLUDE_DIR
202197
NAMES apr.h
203-
PATHS
198+
HINTS
204199
${PC_Apache_APR_INCLUDE_DIRS}
205200
${_Apache_APR_INCLUDE_DIR}
206201
${_Apache_APU_INCLUDE_DIR}
@@ -215,7 +210,7 @@ endif()
215210
find_library(
216211
Apache_APR_LIBRARY
217212
NAMES apr-1
218-
PATHS ${PC_Apache_APR_LIBRARY_DIRS}
213+
HINTS ${PC_Apache_APR_LIBRARY_DIRS}
219214
DOC "The path to the apr library"
220215
)
221216
mark_as_advanced(Apache_APR_LIBRARY)
@@ -231,7 +226,7 @@ endif()
231226
find_program(
232227
Apache_APU_CONFIG_EXECUTABLE
233228
NAMES apu-config apu-1-config
234-
PATHS ${_Apache_APU_BINDIR}
229+
HINTS ${_Apache_APU_BINDIR}
235230
DOC "Path to the Apache Portable Runtime Utilities config command-line tool"
236231
)
237232
mark_as_advanced(Apache_APU_CONFIG_EXECUTABLE)
@@ -270,7 +265,7 @@ endif()
270265
find_program(
271266
Apache_EXECUTABLE
272267
NAMES ${_Apache_NAME} apache2
273-
PATHS ${_Apache_SBINDIR}
268+
HINTS ${_Apache_SBINDIR}
274269
DOC "Path to the Apache HTTP server command-line utility"
275270
)
276271
mark_as_advanced(Apache_EXECUTABLE)
@@ -283,7 +278,7 @@ find_path(
283278
Apache_INCLUDE_DIR
284279
NAMES httpd.h
285280
PATH_SUFFIXES apache2
286-
PATHS ${_Apache_APXS_INCLUDE_DIR}
281+
HINTS ${_Apache_APXS_INCLUDE_DIR}
287282
DOC "Directory containing Apache headers"
288283
)
289284
mark_as_advanced(Apache_INCLUDE_DIR)
@@ -294,7 +289,7 @@ endif()
294289

295290
# Get Apache version.
296291
block(PROPAGATE Apache_VERSION)
297-
if(Apache_INCLUDE_DIR AND EXISTS ${Apache_INCLUDE_DIR}/ap_release.h)
292+
if(EXISTS ${Apache_INCLUDE_DIR}/ap_release.h)
298293
file(
299294
STRINGS
300295
${Apache_INCLUDE_DIR}/ap_release.h
@@ -385,6 +380,7 @@ find_package_handle_standard_args(
385380
Apache_APR_INCLUDE_DIR
386381
Apache_EXECUTABLE
387382
VERSION_VAR Apache_VERSION
383+
HANDLE_VERSION_RANGE
388384
REASON_FAILURE_MESSAGE "${_reason}"
389385
)
390386

0 commit comments

Comments
 (0)