Skip to content

Commit d3ea267

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 0183f88 + 4771224 commit d3ea267

File tree

16 files changed

+94
-76
lines changed

16 files changed

+94
-76
lines changed

cmake/TSRM/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ install(
3131
TARGETS php_tsrm
3232
ARCHIVE EXCLUDE_FROM_ALL
3333
FILE_SET HEADERS
34-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/TSRM
34+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/TSRM
3535
)

cmake/Zend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,5 +507,5 @@ install(
507507
TARGETS zend
508508
ARCHIVE EXCLUDE_FROM_ALL
509509
FILE_SET HEADERS
510-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Zend
510+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/Zend
511511
)

cmake/cmake/Configuration.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ if(NOT PHP_LAYOUT STREQUAL "GNU")
6060
# TODO: DATAROOTDIR should be "php" instead of default "share".
6161
endif()
6262

63+
set(
64+
PHP_INCLUDE_PREFIX "php"
65+
CACHE STRING
66+
"The relative directory inside the CMAKE_INSTALL_INCLUDEDIR, where to install\
67+
PHP headers. For example, 'php/${PHP_VERSION}' to specify version or other\
68+
build-related characteristics and have multiple PHP versions installed.\
69+
Absolute paths are threated as relative; set CMAKE_INSTALL_INCLUDEDIR if\
70+
absolute path needs to be set."
71+
)
72+
mark_as_advanced(PHP_INCLUDE_PREFIX)
73+
6374
set(
6475
PHP_CONFIG_FILE_SCAN_DIR ""
6576
CACHE PATH "The path where to scan for additional INI configuration files; By\

cmake/cmake/Platform.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ include(PHP/SystemExtensions)
2424
target_link_libraries(php_configuration INTERFACE PHP::SystemExtensions)
2525

2626
# Set installation directories.
27-
set(
28-
CMAKE_INSTALL_INCLUDEDIR "include/php"
29-
CACHE STRING "Include directory containing PHP header files (include/php)"
30-
)
3127
include(GNUInstallDirs)
3228

3329
# Detect C standard library implementation.

cmake/cmake/modules/PHP/ConfigureFile.cmake

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ php_configure_file(
2020
2121
* `VARIABLES`
2222
23-
Pairs of variable names and values.
23+
Pairs of variable names and values. Variable values support generator
24+
expressions.
2425
2526
The `$<INSTALL_PREFIX>` generator expression can be used in variable values,
2627
which is replaced with installation prefix either set via the
2728
`CMAKE_INSTALL_PREFIX` variable at the configuration phase, or the `--prefix`
2829
option at the `cmake --install` phase.
29-
30-
The custom PHP specific `$<PHP_EXPAND:path>` generator expression can be used
31-
in variable values. It is automatically replaced to `<install-prefix>/path`
32-
if `path` is relative, or to just `path` if `path` is absolute.
3330
#]=============================================================================]
3431

3532
include_guard(GLOBAL)
@@ -97,16 +94,6 @@ function(_php_configure_file_parse_variables)
9794

9895
list(APPEND resultVariables ${var})
9996

100-
if(value MATCHES [[^\$<PHP_EXPAND:(.*)>.*]])
101-
if(IS_ABSOLUTE "${CMAKE_MATCH_1}")
102-
set(value "${CMAKE_MATCH_1}")
103-
elseif(CMAKE_MATCH_1)
104-
set(value "$<INSTALL_PREFIX>/${CMAKE_MATCH_1}")
105-
else()
106-
set(value "")
107-
endif()
108-
endif()
109-
11097
# The resultValues are for the first configure_file().
11198
if(value MATCHES [[.*\$<INSTALL_PREFIX>.*]])
11299
string(

cmake/cmake/modules/PHP/Extensions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ function(_php_extensions_post_configure directory)
661661
LIBRARY
662662
DESTINATION ${PHP_EXTENSION_DIR}
663663
FILE_SET HEADERS
664-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ext/${extension}
664+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/ext/${extension}
665665
)
666666

667667
# Check if extension is always enabled.

cmake/cmake/modules/PHP/PkgConfigGenerator.cmake

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ template.
4545
which is replaced with installation prefix either set via the
4646
`CMAKE_INSTALL_PREFIX` variable at the configuration phase, or the `--prefix`
4747
option at the `cmake --install` phase.
48-
49-
The custom PHP specific `$<PHP_EXPAND:path>` generator expression can be used
50-
in variable values. It is automatically replaced to `<install-prefix>/path`
51-
if `path` is relative, or to just `path` if `path` is absolute.
5248
#]=============================================================================]
5349

5450
include_guard(GLOBAL)
@@ -87,16 +83,6 @@ function(_pkgconfig_parse_variables variables)
8783

8884
list(APPEND result_variables ${var})
8985

90-
if(value MATCHES [[^\$<PHP_EXPAND:(.*)>.*]])
91-
if(IS_ABSOLUTE "${CMAKE_MATCH_1}")
92-
set(value "${CMAKE_MATCH_1}")
93-
elseif(CMAKE_MATCH_1)
94-
set(value "$<INSTALL_PREFIX>/${CMAKE_MATCH_1}")
95-
else()
96-
set(value "")
97-
endif()
98-
endif()
99-
10086
# The result_values are for the install(CODE) and generator expression
10187
# $<INSTALL_PREFIX> works since CMake 3.27, for earlier versions the escaped
10288
# variable CMAKE_INSTALL_PREFIX can be used.

cmake/ext/skeleton/CMakeLists.txt.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ install(
9393
TARGETS php_%EXTNAME%
9494
ARCHIVE EXCLUDE_FROM_ALL
9595
FILE_SET HEADERS
96-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ext/%EXTNAME%
96+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/ext/%EXTNAME%
9797
)

cmake/main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,5 +373,5 @@ install(
373373
TARGETS php_main
374374
ARCHIVE EXCLUDE_FROM_ALL
375375
FILE_SET HEADERS
376-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/main
376+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/main
377377
)

cmake/sapi/cli/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ install(
146146
RUNTIME
147147
DESTINATION ${CMAKE_INSTALL_BINDIR}
148148
FILE_SET HEADERS
149-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sapi/cli
149+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/sapi/cli
150150
)
151151

152152
install(

0 commit comments

Comments
 (0)