Skip to content

Commit ae98804

Browse files
committed
Merge branch 'PHP-8.4'
2 parents cd0b75c + da134df commit ae98804

File tree

5 files changed

+57
-17
lines changed

5 files changed

+57
-17
lines changed

cmake/cmake/ConfigureChecks.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ php_search_libraries(
678678
# The gai_strerror() is mostly in C library (Solaris 11.4...)
679679
php_search_libraries(
680680
gai_strerror
681-
HEADERS netdb.h
681+
HEADERS
682+
netdb.h
683+
ws2tcpip.h
682684
LIBRARIES
683685
socket # Solaris <= 11.3, illumos
684686
network # Haiku

cmake/cmake/Flags.cmake

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Check and configure compilation options.
44

55
include_guard(GLOBAL)
66

7+
include(CheckLinkerFlag)
78
include(CheckSourceRuns)
89
include(CMakePushCheckState)
910
include(PHP/CheckCompilerFlag)
@@ -75,13 +76,23 @@ target_compile_options(
7576

7677
php_check_compiler_flag(C -Wall PHP_HAS_WALL_C)
7778
php_check_compiler_flag(CXX -Wall PHP_HAS_WALL_CXX)
78-
target_compile_options(
79-
php_config
80-
BEFORE
81-
INTERFACE
82-
$<$<AND:$<BOOL:${PHP_HAS_WALL_C}>,$<COMPILE_LANGUAGE:ASM,C>>:-Wall>
83-
$<$<AND:$<BOOL:${PHP_HAS_WALL_CXX}>,$<COMPILE_LANGUAGE:CXX>>:-Wall>
84-
)
79+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
80+
target_compile_options(
81+
php_config
82+
BEFORE
83+
INTERFACE
84+
$<$<AND:$<BOOL:${PHP_HAS_WALL_C}>,$<CONFIG:Debug>,$<COMPILE_LANGUAGE:ASM,C>>:-Wall>
85+
$<$<AND:$<BOOL:${PHP_HAS_WALL_CXX}>,$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CXX>>:-Wall>
86+
)
87+
else()
88+
target_compile_options(
89+
php_config
90+
BEFORE
91+
INTERFACE
92+
$<$<AND:$<BOOL:${PHP_HAS_WALL_C}>,$<COMPILE_LANGUAGE:ASM,C>>:-Wall>
93+
$<$<AND:$<BOOL:${PHP_HAS_WALL_CXX}>,$<COMPILE_LANGUAGE:CXX>>:-Wall>
94+
)
95+
endif()
8596

8697
# Check if compiler supports -Wno-clobbered (only GCC).
8798
php_check_compiler_flag(C -Wno-clobbered PHP_HAS_WNO_CLOBBERED_C)
@@ -461,3 +472,19 @@ endif()
461472

462473
# Align segments on huge page boundary.
463474
include(PHP/CheckSegmentsAlignment)
475+
476+
check_linker_flag(C LINKER:/verbose PHP_HAS_VERBOSE_LINKER_FLAG_C)
477+
if(PHP_HAS_VERBOSE_LINKER_FLAG_C)
478+
target_link_options(
479+
php_config
480+
INTERFACE $<$<AND:$<CONFIG:Debug>,$<LINK_LANGUAGE:C>>:LINKER:/verbose>
481+
)
482+
endif()
483+
484+
check_linker_flag(CXX LINKER:/verbose PHP_HAS_VERBOSE_LINKER_FLAG_CXX)
485+
if(PHP_HAS_VERBOSE_LINKER_FLAG_CXX)
486+
target_link_options(
487+
php_config
488+
INTERFACE $<$<AND:$<CONFIG:Debug>,$<LINK_LANGUAGE:CXX>>:LINKER:/verbose>
489+
)
490+
endif()

cmake/cmake/modules/PHP/CheckIPv6.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ if(NOT PHP_IPV6)
2929
return()
3030
endif()
3131

32+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
33+
message(CHECK_PASS "yes")
34+
set(HAVE_IPV6 TRUE)
35+
return()
36+
endif()
37+
3238
cmake_push_check_state(RESET)
3339
set(CMAKE_REQUIRED_QUIET TRUE)
3440

cmake/main/cmake/php_config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
#cmakedefine PHP_BUILD_SYSTEM "@PHP_BUILD_SYSTEM@"
530530

531531
/* Compiler identification string. */
532-
#cmakedefine PHP_COMPILER_ID "@PHP_COMPILER_ID@"
532+
#cmakedefine PHP_COMPILER_ID "@CMAKE_C_COMPILER_ID@"
533533

534534
/* Define to 1 if the compiler supports AVX-512. */
535535
#cmakedefine PHP_HAVE_AVX512_SUPPORTS 1

cmake/win32/CMakeLists.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,26 @@ set_source_files_properties(
176176

177177
# Determine major and minor linker version.
178178
block(PROPAGATE PHP_LINKER_MAJOR PHP_LINKER_MINOR)
179-
if(CMAKE_C_COMPILER_LINKER_VERSION)
180-
set(version "${CMAKE_C_COMPILER_LINKER_VERSION}")
181-
else()
182-
set(version "")
179+
if(
180+
NOT DEFINED CMAKE_C_COMPILER_LINKER_VERSION
181+
OR NOT CMAKE_C_COMPILER_LINKER_VERSION MATCHES "^[^0-9]*[0-9]"
182+
)
183+
message(
184+
FATAL_ERROR
185+
"The linker version could not be detected. Please ensure the linker "
186+
"version can be determined, or set the 'CMAKE_C_COMPILER_LINKER_VERSION' "
187+
"variable to the linker version of format '<major>.<minor>'."
188+
)
183189
endif()
184190

185-
string(REGEX MATCH "^([0-9]+)\\.?" _ "${version}")
191+
string(REGEX MATCH "^[^0-9]*([0-9]+)\\.?" _ "${CMAKE_C_COMPILER_LINKER_VERSION}")
186192
set(PHP_LINKER_MAJOR "${CMAKE_MATCH_1}")
187-
string(REGEX MATCH "^[0-9]+\\.([0-9]+)\\.?" _ "${version}")
188-
set(PHP_LINKER_MINOR "${CMAKE_MATCH_1}")
189-
190193
if(NOT PHP_LINKER_MAJOR)
191194
set(PHP_LINKER_MAJOR 0)
192195
endif()
193196

197+
string(REGEX MATCH "^[^0-9]*[0-9]+\\.([0-9]+)\\.?" _ "${CMAKE_C_COMPILER_LINKER_VERSION}")
198+
set(PHP_LINKER_MINOR "${CMAKE_MATCH_1}")
194199
if(NOT PHP_LINKER_MINOR)
195200
set(PHP_LINKER_MINOR 0)
196201
endif()

0 commit comments

Comments
 (0)