Skip to content

Commit 9976a65

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 79511cd + 909e9c9 commit 9976a65

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

cmake/cmake/modules/PHP/Re2c.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ macro(_php_re2c_config)
197197

198198
# If re2c is not found on the system, set which version to download.
199199
if(NOT PHP_RE2C_VERSION_DOWNLOAD)
200-
set(PHP_RE2C_VERSION_DOWNLOAD 4.0.2)
200+
set(PHP_RE2C_VERSION_DOWNLOAD 4.2)
201201
endif()
202202
endmacro()
203203

@@ -637,6 +637,10 @@ function(_php_re2c_download)
637637
)
638638
endif()
639639

640+
if(RE2C_VERSION VERSION_GREATER_EQUAL 4.2)
641+
list(APPEND re2cOptions -DRE2C_BUILD_RE2SWIFT=OFF)
642+
endif()
643+
640644
ExternalProject_Add(
641645
re2c
642646
URL

cmake/main/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,12 @@ function(_php_main_configure_php_config)
389389
file(READ ${CMAKE_CURRENT_BINARY_DIR}/Zend/CMakeFiles/zend_config.h config)
390390
string(STRIP "${config}" ZEND_CONFIGURATION)
391391

392+
# Add Windows configuration.
393+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
394+
file(READ ${CMAKE_CURRENT_BINARY_DIR}/win32/config.h config)
395+
string(STRIP "${config}" WINDOWS_CONFIGURATION)
396+
endif()
397+
392398
file(READ main/cmake/php_config.h.in content)
393399
string(CONFIGURE "${content}" content @ONLY)
394400
file(

cmake/main/cmake/php_config.h.in

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,6 @@
584584
/* Define to 1 you have IRIX-style reentrant time functions. */
585585
#cmakedefine PHP_IRIX_TIME_R 1
586586

587-
/* Linker major version. */
588-
#cmakedefine PHP_LINKER_MAJOR @PHP_LINKER_MAJOR@
589-
590-
/* Linker minor version. */
591-
#cmakedefine PHP_LINKER_MINOR @PHP_LINKER_MINOR@
592-
593587
/* The 'uname' output. */
594588
#define PHP_OS "@CMAKE_SYSTEM_NAME@"
595589

@@ -663,6 +657,7 @@
663657
@ZEND_CONFIGURATION@
664658

665659
#if @PHP_CONFIG_H_WINDOWS@
660+
@WINDOWS_CONFIGURATION@
666661
# include "build-defs.h"
667662
# if __has_include("main/config.pickle.h")
668663
# include "main/config.pickle.h"

cmake/win32/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,34 @@ set_source_files_properties(
152152
HEADER_FILE_ONLY ON
153153
)
154154

155+
################################################################################
156+
# Configure configuration header.
157+
################################################################################
158+
159+
# Determine major and minor linker version.
160+
block(PROPAGATE PHP_LINKER_MAJOR PHP_LINKER_MINOR)
161+
if(CMAKE_C_COMPILER_LINKER_VERSION)
162+
set(version "${CMAKE_C_COMPILER_LINKER_VERSION}")
163+
else()
164+
set(version "")
165+
endif()
166+
167+
string(REGEX MATCH "^([0-9]+)\\.?" _ "${version}")
168+
set(PHP_LINKER_MAJOR "${CMAKE_MATCH_1}")
169+
string(REGEX MATCH "^[0-9]+\\.([0-9]+)\\.?" _ "${version}")
170+
set(PHP_LINKER_MINOR "${CMAKE_MATCH_1}")
171+
172+
if(NOT PHP_LINKER_MAJOR)
173+
set(PHP_LINKER_MAJOR 0)
174+
endif()
175+
176+
if(NOT PHP_LINKER_MINOR)
177+
set(PHP_LINKER_MINOR 0)
178+
endif()
179+
endblock()
180+
181+
configure_file(cmake/config.h.in config.h @ONLY)
182+
155183
################################################################################
156184
# Configure installation.
157185
################################################################################

cmake/win32/cmake/config.h.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* Linker major version. */
2+
#cmakedefine PHP_LINKER_MAJOR @PHP_LINKER_MAJOR@
3+
4+
/* Linker minor version. */
5+
#cmakedefine PHP_LINKER_MINOR @PHP_LINKER_MINOR@

0 commit comments

Comments
 (0)