Skip to content

Commit 462260c

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 7883986 + f02f31a commit 462260c

File tree

29 files changed

+128
-226
lines changed

29 files changed

+128
-226
lines changed

bin/check-cmake.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ function runGersemi(): int
591591
}
592592

593593
exec(
594-
'gersemi --check --indent 2 --definitions cmake bin -- cmake bin',
594+
'gersemi --check --config ' . __DIR__ . '/check-cmake/.gersemirc -- cmake bin',
595595
$output,
596596
$status,
597597
);

bin/check-cmake/.gersemirc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22
#
33
# CMake code formatting configuration.
44
# See: https://github.com/BlankSpruce/gersemi
5-
#
6-
# This is only a template for now, as configuration options are passed manually.
75

8-
cache: true
9-
color: true
10-
definitions: [.]
6+
definitions: [../../cmake, ., ../../bin]
117
indent: 2
128
line_length: 80
139
list_expansion: favour-inlining
14-
quiet: false
1510
unsafe: false
1611
warn_about_unknown_commands: true
17-
workers: max

cmake/cmake/modules/PHP/Extensions.cmake

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ php_extensions_add(subdirectory)
4949
* `PHP_ALWAYS_ENABLED_EXTENSIONS`
5050
5151
This global property contains a list of always enabled PHP extensions which
52-
don't need the `HAVE_<extension-name>` preprocessor macros defined in the PHP
53-
configuration header and can be considered as part of the core PHP engine.
52+
can be considered part of the core PHP engine.
5453
5554
* `PHP_EXTENSIONS`
5655
@@ -670,13 +669,6 @@ function(_php_extensions_post_configure directory)
670669
return()
671670
endif()
672671

673-
# Define HAVE_<extension-name> symbol for php_config.h.
674-
string(TOUPPER "HAVE_${extension}" symbol)
675-
set(
676-
${symbol} 1
677-
CACHE INTERNAL "Whether to enable the PHP extension '${extension}'."
678-
)
679-
680672
get_target_property(extension_type php_${extension} TYPE)
681673

682674
if(NOT extension_type MATCHES "^(MODULE|SHARED)_LIBRARY$")

cmake/ext/date/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ target_compile_definitions(
6262
HAVE_STRTOLL
6363
)
6464

65-
set(HAVE_TIMELIB_CONFIG_H 1 CACHE INTERNAL "Whether you have timelib_config.h.")
65+
set(HAVE_TIMELIB_CONFIG_H 1)
6666

6767
message(STATUS "Creating ext/date/lib/timelib_config.h")
6868
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lib/timelib_config.h [[

cmake/ext/enchant/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ set_package_properties(
4949
)
5050

5151
if(Enchant_FOUND)
52-
set(
53-
HAVE_ENCHANT_GET_VERSION 1
54-
CACHE INTERNAL "enchant_get_version since 1.6.0"
55-
)
52+
set(HAVE_ENCHANT_GET_VERSION 1)
5653
else()
5754
message(WARNING "Library Enchant 2 not found, trying with Enchant 1")
5855

cmake/ext/ftp/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,22 @@ function(php_ftp_post_configuration)
6565

6666
target_link_libraries(php_ftp PRIVATE OpenSSL::SSL)
6767

68-
set(HAVE_FTP_SSL 1 CACHE INTERNAL "Whether FTP over SSL is enabled")
68+
set(HAVE_FTP_SSL 1)
6969
endif()
7070

7171
add_feature_info(
7272
"ext/ftp SSL"
7373
HAVE_FTP_SSL
7474
"FTP over SSL support"
7575
)
76+
77+
set(HAVE_FTP 1)
78+
79+
configure_file(
80+
${PhpExtensionFtp_SOURCE_DIR}/config.cmake.h.in
81+
${PhpExtensionFtp_BINARY_DIR}/config.h
82+
@ONLY
83+
)
7684
endfunction()
7785

7886
# Run at the end of the configuration.
@@ -81,7 +89,3 @@ cmake_language(
8189
DIRECTORY ${PHP_SOURCE_DIR}
8290
CALL php_ftp_post_configuration
8391
)
84-
85-
set(HAVE_FTP 1)
86-
87-
configure_file(config.cmake.h.in config.h @ONLY)

cmake/ext/gd/CMakeLists.txt

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,12 @@ if(NOT EXT_GD_EXTERNAL)
211211
libgd/wbmp.h
212212
)
213213

214-
set(HAVE_GD_BUNDLED 1 CACHE INTERNAL "Whether the bundled libgd is used")
214+
set(HAVE_GD_BUNDLED 1)
215215

216216
# With bundled GD library these are always available.
217-
set(
218-
HAVE_GD_PNG 1
219-
CACHE INTERNAL "Whether the PNG functionality can be used with libgd"
220-
)
221-
222-
set(
223-
HAVE_GD_BMP 1
224-
CACHE INTERNAL "Whether the BMP functionality can be used with libgd"
225-
)
226-
227-
set(
228-
HAVE_GD_TGA 1
229-
CACHE INTERNAL "Whether the TGA functionality can be used with libgd"
230-
)
217+
set(HAVE_GD_PNG 1)
218+
set(HAVE_GD_BMP 1)
219+
set(HAVE_GD_TGA 1)
231220

232221
php_search_libraries(
233222
floorf
@@ -269,7 +258,7 @@ if(NOT EXT_GD_EXTERNAL)
269258

270259
target_link_libraries(php_gd PRIVATE PNG::PNG)
271260

272-
set(HAVE_LIBPNG 1 CACHE INTERNAL "Whether the libpng is available")
261+
set(HAVE_LIBPNG 1)
273262

274263
if(EXT_GD_AVIF)
275264
find_package(libavif 0.8.2)
@@ -282,8 +271,8 @@ if(NOT EXT_GD_EXTERNAL)
282271

283272
target_link_libraries(php_gd PRIVATE libavif::libavif)
284273

285-
set(HAVE_LIBAVIF 1 CACHE INTERNAL "Whether the libavif is available")
286-
set(HAVE_GD_AVIF 1 CACHE INTERNAL "Whether the AVIF support is enabled")
274+
set(HAVE_LIBAVIF 1)
275+
set(HAVE_GD_AVIF 1)
287276
endif()
288277

289278
if(EXT_GD_WEBP)
@@ -297,8 +286,8 @@ if(NOT EXT_GD_EXTERNAL)
297286

298287
target_link_libraries(php_gd PRIVATE WebP::WebP)
299288

300-
set(HAVE_LIBWEBP 1 CACHE INTERNAL "Whether the libwebp is available")
301-
set(HAVE_GD_WEBP 1 CACHE INTERNAL "Whether the WebP support is enabled")
289+
set(HAVE_LIBWEBP 1)
290+
set(HAVE_GD_WEBP 1)
302291
endif()
303292

304293
if(EXT_GD_JPEG)
@@ -312,8 +301,8 @@ if(NOT EXT_GD_EXTERNAL)
312301

313302
target_link_libraries(php_gd PRIVATE JPEG::JPEG)
314303

315-
set(HAVE_LIBJPEG 1 CACHE INTERNAL "Whether the libjpeg is available")
316-
set(HAVE_GD_JPG 1 CACHE INTERNAL "Whether the JPEG support is enabled")
304+
set(HAVE_LIBJPEG 1)
305+
set(HAVE_GD_JPG 1)
317306
endif()
318307

319308
if(EXT_GD_XPM)
@@ -327,8 +316,8 @@ if(NOT EXT_GD_EXTERNAL)
327316

328317
target_link_libraries(php_gd PRIVATE XPM::XPM)
329318

330-
set(HAVE_XPM 1 CACHE INTERNAL "Whether the libXpm library is available")
331-
set(HAVE_GD_XPM 1 CACHE INTERNAL "Whether the XPM support is enabled")
319+
set(HAVE_XPM 1)
320+
set(HAVE_GD_XPM 1)
332321
endif()
333322

334323
if(EXT_GD_FREETYPE)
@@ -342,27 +331,13 @@ if(NOT EXT_GD_EXTERNAL)
342331

343332
target_link_libraries(php_gd PRIVATE Freetype::Freetype)
344333

345-
set(
346-
HAVE_LIBFREETYPE 1
347-
CACHE INTERNAL "Whether the FreeType library is available"
348-
)
349-
350-
set(
351-
HAVE_GD_FREETYPE 1
352-
CACHE INTERNAL "Whether the FreeType support is enabled"
353-
)
334+
set(HAVE_LIBFREETYPE 1)
335+
set(HAVE_GD_FREETYPE 1)
354336
endif()
355337

356338
if(EXT_GD_JIS)
357-
set(
358-
JISX0208 1
359-
CACHE INTERNAL "Whether the JIS-mapped Japanese font support is available"
360-
)
361-
362-
set(
363-
USE_GD_JISX0208 1
364-
CACHE INTERNAL "Whether the JIS-mapped Japanese font support is enabled"
365-
)
339+
set(JISX0208 1)
340+
set(USE_GD_JISX0208 1)
366341
endif()
367342

368343
# Do sanity check when all required packages are found.

cmake/ext/gettext/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if(TARGET Intl::Intl)
6161
)
6262
endif()
6363

64-
set(HAVE_LIBINTL 1 CACHE INTERNAL "Whether gettext library is available")
64+
set(HAVE_LIBINTL 1)
6565

6666
check_library_exists(Intl::Intl ngettext "" HAVE_NGETTEXT)
6767
check_library_exists(Intl::Intl dngettext "" HAVE_DNGETTEXT)

cmake/ext/hash/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if(EXT_HASH_MHASH)
2626
"Support for mhash in the hash extension is deprecated as of PHP 8.1.0"
2727
)
2828

29-
set(PHP_MHASH_BC 1 CACHE INTERNAL "Whether the mhash support is included")
29+
set(PHP_MHASH_BC 1)
3030
endif()
3131

3232
add_library(php_hash STATIC)
@@ -78,7 +78,7 @@ target_sources(
7878
)
7979

8080
if(WORDS_BIGENDIAN)
81-
set(HAVE_SLOW_HASH3 1 CACHE INTERNAL "Whether slow SHA3 algo is used.")
81+
set(HAVE_SLOW_HASH3 1)
8282
message(WARNING "Using slow SHA3 implementation on bigendian")
8383
else()
8484
block()

cmake/ext/iconv/CMakeLists.txt

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ if(TARGET Iconv::Iconv)
7979
check_library_exists(Iconv::Iconv libiconv "" HAVE_LIBICONV)
8080

8181
if(HAVE_LIBICONV)
82-
set(
83-
ICONV_ALIASED_LIBICONV 1
84-
CACHE INTERNAL "iconv() is aliased to libiconv()"
85-
)
82+
set(ICONV_ALIASED_LIBICONV 1)
8683
else()
8784
check_library_exists(Iconv::Iconv iconv "" _HAVE_ICONV)
8885
endif()
@@ -106,11 +103,8 @@ if(TARGET Iconv::Iconv)
106103
cmake_pop_check_state()
107104
if(_have_gnu_libiconv)
108105
message(CHECK_PASS "GNU libiconv")
109-
set(HAVE_LIBICONV 1 CACHE INTERNAL "")
110-
set(
111-
PHP_ICONV_IMPL "libiconv"
112-
CACHE INTERNAL "The iconv implementation"
113-
)
106+
set(HAVE_LIBICONV 1)
107+
set(PHP_ICONV_IMPL "libiconv")
114108
endif()
115109

116110
# Check for glibc implementation.
@@ -123,10 +117,7 @@ if(TARGET Iconv::Iconv)
123117
endif()
124118
if(HAVE_GLIBC_ICONV)
125119
message(CHECK_PASS "GNU C library")
126-
set(
127-
PHP_ICONV_IMPL "glibc"
128-
CACHE INTERNAL "The iconv implementation"
129-
)
120+
set(PHP_ICONV_IMPL "glibc")
130121
endif()
131122

132123
# Check for Konstantin Chuguev's iconv implementation.
@@ -139,10 +130,7 @@ if(TARGET Iconv::Iconv)
139130
endif()
140131
if(_have_bsd_iconv)
141132
message(CHECK_PASS "BSD iconv")
142-
set(
143-
PHP_ICONV_IMPL "BSD iconv"
144-
CACHE INTERNAL "The iconv implementation"
145-
)
133+
set(PHP_ICONV_IMPL "BSD iconv")
146134
endif()
147135

148136
# Check for IBM iconv implementation.
@@ -155,10 +143,7 @@ if(TARGET Iconv::Iconv)
155143
endif()
156144
if(HAVE_IBM_ICONV)
157145
message(CHECK_PASS "IBM iconv")
158-
set(
159-
PHP_ICONV_IMPL "IBM iconv"
160-
CACHE INTERNAL "The iconv implementation"
161-
)
146+
set(PHP_ICONV_IMPL "IBM iconv")
162147
endif()
163148

164149
if(NOT PHP_ICONV_IMPL AND Iconv_IS_BUILT_IN)

0 commit comments

Comments
 (0)