Skip to content

Commit aca670c

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 2dc3ee0 + 14b8b4d commit aca670c

File tree

9 files changed

+95
-71
lines changed

9 files changed

+95
-71
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,12 +685,17 @@ endif()
685685
configure_file(cmake/zend_config.h.in CMakeFiles/zend_config.h)
686686

687687
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
688-
message(STATUS "Creating Zend/zend_config.h")
689-
688+
cmake_path(
689+
RELATIVE_PATH
690+
CMAKE_CURRENT_BINARY_DIR
691+
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
692+
OUTPUT_VARIABLE relativeDir
693+
)
694+
message(STATUS "Creating ${relativeDir}/zend_config.h")
690695
file(
691-
WRITE
692-
${CMAKE_CURRENT_BINARY_DIR}/zend_config.h
693-
"#include <../main/php_config.h>\n"
696+
CONFIGURE
697+
OUTPUT zend_config.h
698+
CONTENT "#include <../main/php_config.h>\n"
694699
)
695700
endif()
696701

cmake/cmake/modules/FindDTrace.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ function(dtrace_target)
197197
]]
198198
)
199199
cmake_path(
200-
RELATIVE_PATH parsed_HEADER
200+
RELATIVE_PATH
201+
parsed_HEADER
201202
BASE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
202203
OUTPUT_VARIABLE header
203204
)

cmake/cmake/modules/FindMC.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,17 @@ function(mc_target)
214214
VERBATIM
215215
)
216216

217+
cmake_path(
218+
RELATIVE_PATH
219+
output
220+
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
221+
OUTPUT_VARIABLE relativePath
222+
)
223+
217224
add_custom_target(
218225
${parsed_NAME}
219226
SOURCES "${parsed_INPUT}"
220227
DEPENDS "${output}"
221-
COMMENT "[MC][${parsed_NAME}] Generating ${output}"
228+
COMMENT "[MC][${parsed_NAME}] Generating ${relativePath}"
222229
)
223230
endfunction()

cmake/cmake/modules/PHP/PkgConfigGenerator.cmake

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pkgconfig_generate_pc(
2525
)
2626
```
2727
28-
Generate pkgconfig `<pc-file-output>` from the given pc `<pc-template-file>`
28+
Generate pkg-config `<pc-file-output>` from the given pc `<pc-template-file>`
2929
template.
3030
3131
* `TARGET`
@@ -72,20 +72,20 @@ function(_pkgconfig_parse_variables variables)
7272
)
7373
endif()
7474

75-
set(is_value FALSE)
76-
set(variables_options "")
77-
set(result_variables "")
78-
set(result_values "")
75+
set(isValue FALSE)
76+
set(variablesOptions "")
77+
set(resultVariables "")
78+
set(resultValues "")
7979
foreach(variable IN LISTS variables)
80-
if(is_value)
81-
set(is_value FALSE)
80+
if(isValue)
81+
set(isValue FALSE)
8282
continue()
8383
endif()
8484
list(POP_FRONT variables var value)
8585

86-
list(APPEND result_variables ${var})
86+
list(APPEND resultVariables ${var})
8787

88-
# The result_values are for the install(CODE) and generator expression
88+
# The resultValues are for the install(CODE) and generator expression
8989
# $<INSTALL_PREFIX> works since CMake 3.27, for earlier versions the escaped
9090
# variable CMAKE_INSTALL_PREFIX can be used.
9191
if(
@@ -96,16 +96,16 @@ function(_pkgconfig_parse_variables variables)
9696
REPLACE
9797
"$<INSTALL_PREFIX>"
9898
"\${CMAKE_INSTALL_PREFIX}"
99-
replaced_value
99+
replacedValue
100100
"${value}"
101101
)
102-
list(APPEND result_values "${replaced_value}")
102+
list(APPEND resultValues "${replacedValue}")
103103
else()
104-
list(APPEND result_values "${value}")
104+
list(APPEND resultValues "${value}")
105105
endif()
106106

107107
# Replace possible INSTALL_PREFIX in value for usage in add_custom_command,
108-
# in the result_values above the intact genex is left for enabling the
108+
# in the resultValues above the intact genex is left for enabling the
109109
# possible 'cmake --install --prefix ...' override.
110110
if(value MATCHES [[.*\$<INSTALL_PREFIX>.*]])
111111
string(
@@ -117,14 +117,14 @@ function(_pkgconfig_parse_variables variables)
117117
)
118118
endif()
119119

120-
list(APPEND variables_options -D ${var}="${value}")
120+
list(APPEND variablesOptions -D ${var}="${value}")
121121

122-
set(is_value TRUE)
122+
set(isValue TRUE)
123123
endforeach()
124124

125-
set(variables_options "${variables_options}" PARENT_SCOPE)
126-
set(result_variables "${result_variables}" PARENT_SCOPE)
127-
set(result_values "${result_values}" PARENT_SCOPE)
125+
set(variablesOptions "${variablesOptions}" PARENT_SCOPE)
126+
set(resultVariables "${resultVariables}" PARENT_SCOPE)
127+
set(resultValues "${resultValues}" PARENT_SCOPE)
128128
endfunction()
129129

130130
function(pkgconfig_generate_pc)
@@ -209,36 +209,41 @@ function(pkgconfig_generate_pc)
209209
)
210210

211211
if(parsed_TARGET)
212-
set(target_option -D TARGET_FILE="$<TARGET_FILE:${parsed_TARGET}>")
212+
set(targetOption -D TARGET_FILE="$<TARGET_FILE:${parsed_TARGET}>")
213213
endif()
214214

215215
if(parsed_VARIABLES)
216216
_pkgconfig_parse_variables("${parsed_VARIABLES}")
217217
endif()
218218

219-
cmake_path(GET template FILENAME filename)
219+
cmake_path(
220+
RELATIVE_PATH
221+
output
222+
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
223+
OUTPUT_VARIABLE outputRelativePath
224+
)
220225

221-
string(MAKE_C_IDENTIFIER "${filename}" target_name)
226+
string(MAKE_C_IDENTIFIER "${outputRelativePath}" targetName)
222227

223228
add_custom_target(
224-
pkgconfig_generate_${target_name}
229+
pkgconfig_${targetName}
225230
ALL
226231
COMMAND ${CMAKE_COMMAND}
227232
-D PKGCONFIG_OBJDUMP_EXECUTABLE=${PKGCONFIG_OBJDUMP_EXECUTABLE}
228233
-D TEMPLATE=${template}
229234
-D OUTPUT=${output}
230-
${target_option}
231-
${variables_options}
235+
${targetOption}
236+
${variablesOptions}
232237
-P CMakeFiles/PkgConfigGeneratePc.cmake
233-
COMMENT "[PkgConfig] Generating pkg-config ${filename} file"
238+
COMMENT "[PkgConfig] Generating ${outputRelativePath}"
234239
)
235240

236241
install(CODE "
237242
block()
238-
set(result_variables ${result_variables})
239-
set(result_values \"${result_values}\")
243+
set(resultVariables ${resultVariables})
244+
set(resultValues \"${resultValues}\")
240245
241-
foreach(var value IN ZIP_LISTS result_variables result_values)
246+
foreach(var value IN ZIP_LISTS resultVariables resultValues)
242247
set(\${var} \"\${value}\")
243248
endforeach()
244249

cmake/cmake/platforms/Windows.cmake

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,28 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
2323
# these are always known on Windows systems.
2424
# TODO: Update and fix this better.
2525

26-
# PHP has custom syslog.h for Windows platform.
27-
set(HAVE_SYSLOG_H TRUE)
26+
set(HAVE_FNMATCH TRUE)
2827

29-
# PHP has custom usleep for Windows platform.
30-
set(HAVE_USLEEP TRUE)
28+
# PHP has unconditional getaddrinfo() support on Windows for now.
29+
set(HAVE_GETADDRINFO TRUE)
30+
31+
# PHP defines getpid as _getpid on Windows.
32+
set(HAVE_GETPID TRUE)
3133

3234
# PHP has custom nanosleep for Windows platform.
3335
set(HAVE_NANOSLEEP TRUE)
3436

35-
# PHP supports socketpair by the emulation in win32/sockets.c
37+
set(HAVE_NICE TRUE)
38+
39+
# PHP supports socketpair by the emulation in win32/sockets.c.
3640
set(HAVE_SOCKETPAIR TRUE)
3741

38-
# PHP has unconditional getaddrinfo() support on Windows for now.
39-
set(HAVE_GETADDRINFO TRUE)
42+
# PHP defines strcasecmp in zend_config.w32.h.
43+
set(HAVE_STRCASECMP TRUE)
4044

41-
set(HAVE_NICE TRUE)
42-
set(HAVE_FNMATCH TRUE)
45+
# PHP has custom syslog.h for Windows platform.
46+
set(HAVE_SYSLOG_H TRUE)
4347

44-
# PHP defines getpid as _getpid on Windows.
45-
set(HAVE_GETPID TRUE)
48+
# PHP has custom usleep for Windows platform.
49+
set(HAVE_USLEEP TRUE)
4650
endif()

cmake/ext/date/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ target_compile_definitions(
7474

7575
set(HAVE_TIMELIB_CONFIG_H TRUE)
7676

77-
message(STATUS "Creating ext/date/lib/timelib_config.h")
77+
cmake_path(
78+
RELATIVE_PATH
79+
CMAKE_CURRENT_BINARY_DIR
80+
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
81+
OUTPUT_VARIABLE relativeDir
82+
)
83+
message(STATUS "Creating ${relativeDir}/lib/timelib_config.h")
7884
file(CONFIGURE OUTPUT lib/timelib_config.h CONTENT [[
7985
#ifdef PHP_WIN32
8086
# include "config.w32.h"

cmake/ext/opcache/CMakeLists.txt

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ project(
4040
include(CheckSymbolExists)
4141
include(CMakeDependentOption)
4242
include(FeatureSummary)
43-
include(PHP/CheckCompilerFlag)
4443
include(PHP/SearchLibraries)
4544

4645
option(EXT_OPCACHE "Enable the Zend OPcache extension" ON)
@@ -203,6 +202,13 @@ if(EXT_OPCACHE_JIT)
203202
# Help generators create a jit/ir build directory.
204203
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/jit/ir)
205204

205+
cmake_path(
206+
RELATIVE_PATH
207+
CMAKE_CURRENT_BINARY_DIR
208+
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
209+
OUTPUT_VARIABLE relativeDir
210+
)
211+
206212
# Generate native code generator for selected architecture.
207213
add_custom_command(
208214
OUTPUT jit/ir/ir_emit_${DASM_ARCH}.h
@@ -211,7 +217,7 @@ if(EXT_OPCACHE_JIT)
211217
${DASM_FLAGS}
212218
-o ${CMAKE_CURRENT_BINARY_DIR}/jit/ir/ir_emit_${DASM_ARCH}.h
213219
${CMAKE_CURRENT_SOURCE_DIR}/jit/ir/ir_${DASM_ARCH}.dasc
214-
COMMENT "[ext/opcache] Generating native code generator ext/opcache/jit/ir/ir_emit_${DASM_ARCH}.h"
220+
COMMENT "[ext/opcache] Generating native code generator ${relativeDir}/jit/ir/ir_emit_${DASM_ARCH}.h"
215221
DEPENDS
216222
jit/ir/dynasm/dynasm.lua
217223
jit/ir/ir_${DASM_ARCH}.dasc
@@ -234,30 +240,13 @@ if(EXT_OPCACHE_JIT)
234240
RUNTIME_OUTPUT_DIRECTORY CMakeFiles
235241
)
236242

237-
# Suppress typedef redefinition warnings on Clang. At time of writing, PHP is
238-
# using C99.
239-
if(CMAKE_C_STANDARD EQUAL 99)
240-
php_check_compiler_flag(
241-
C
242-
-Wno-typedef-redefinition
243-
_HAVE_WNO_TYPEDEF_REDEFINITION
244-
)
245-
if(_HAVE_WNO_TYPEDEF_REDEFINITION)
246-
target_compile_options(
247-
php_opcache_jit_generator
248-
PRIVATE
249-
$<$<COMPILE_LANGUAGE:C>:-Wno-typedef-redefinition>
250-
)
251-
endif()
252-
endif()
253-
254243
# Generate IR folding engine rules header.
255244
add_custom_command(
256245
OUTPUT jit/ir/ir_fold_hash.h
257246
COMMAND php_opcache_jit_generator
258247
< ${CMAKE_CURRENT_SOURCE_DIR}/jit/ir/ir_fold.h
259248
> ${CMAKE_CURRENT_BINARY_DIR}/jit/ir/ir_fold_hash.h
260-
COMMENT "[ext/opcache] Generating folding engine rules ext/opcache/jit/ir/ir_fold_hash.h"
249+
COMMENT "[ext/opcache] Generating folding engine rules ${relativeDir}/jit/ir/ir_fold_hash.h"
261250
DEPENDS
262251
jit/ir/ir_fold.h
263252
VERBATIM

cmake/ext/phar/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ if(EXT_PHAR_SHARED OR BUILD_SHARED_LIBS)
141141
)
142142
endif()
143143

144+
cmake_path(
145+
RELATIVE_PATH
146+
CMAKE_CURRENT_BINARY_DIR
147+
BASE_DIRECTORY ${CMAKE_BINARY_DIR}
148+
OUTPUT_VARIABLE relativeDir
149+
)
150+
144151
add_custom_command(
145152
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/phar.php
146153
COMMAND
@@ -153,7 +160,7 @@ add_custom_command(
153160
-d phar.readonly=0
154161
${CMAKE_CURRENT_SOURCE_DIR}/build_precommand.php
155162
> ${CMAKE_CURRENT_BINARY_DIR}/phar.php
156-
COMMENT "[ext/phar] Generating phar.php"
163+
COMMENT "[ext/phar] Generating ${relativeDir}/phar.php"
157164
VERBATIM
158165
)
159166

@@ -179,7 +186,7 @@ add_custom_command(
179186
${CMAKE_CURRENT_SOURCE_DIR}/phar
180187
DEPENDS
181188
${CMAKE_CURRENT_BINARY_DIR}/phar.php
182-
COMMENT "[ext/phar] Generating phar.phar"
189+
COMMENT "[ext/phar] Generating ${relativeDir}/phar.phar"
183190
VERBATIM
184191
)
185192

@@ -210,7 +217,7 @@ add_custom_command(
210217
${CMAKE_COMMAND} -P CMakeFiles/PharPermissions.cmake
211218
DEPENDS
212219
${CMAKE_CURRENT_BINARY_DIR}/phar.phar
213-
COMMENT "[ext/phar] Generating phar"
220+
COMMENT "[ext/phar] Generating ${relativeDir}/phar"
214221
)
215222

216223
file(

cmake/main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ target_link_libraries(
192192
php_main
193193
# If Zend is STATIC library link as whole archive, otherwise link normally.
194194
$<IF:$<STREQUAL:$<TARGET_PROPERTY:Zend::Zend,TYPE>,STATIC_LIBRARY>,$<LINK_LIBRARY:WHOLE_ARCHIVE,Zend::Zend>,Zend::Zend>
195-
$<$<TARGET_EXISTS:PHP::windows>::PHP::windows>
195+
$<$<TARGET_EXISTS:PHP::windows>:PHP::windows>
196196
PHP::extensions
197197
)
198198

0 commit comments

Comments
 (0)