Skip to content

Commit 2ad06f9

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 00b3b22 + 6b5d9d2 commit 2ad06f9

File tree

7 files changed

+36
-20
lines changed

7 files changed

+36
-20
lines changed

cmake/sapi/embed/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Configure the `embed` PHP SAPI.
1111
Enable the embedded PHP SAPI module for embedding PHP into application using C
1212
bindings.
1313
14-
The embed library is then located in the `sapi/embed` directory:
14+
The embed library is after the build phase located in the `sapi/embed`
15+
directory:
16+
1517
* as a shared library `libphp.so` (\*nix), or `libphp.dylib` (macOS), or
1618
`phpembed.dll` (Windows)
1719
* and a static library `libphp.a` (\*nix), or `phpembed.lib` (Windows)

cmake/sapi/phpdbg/CMakeLists.txt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Enable the phpdbg SAPI module as an executable.
1717
1818
Build phpdbg SAPI also as a shared module together with an executable.
1919
20+
The phpdbg shared library is after the build phase located in the `sapi/phpdbg`
21+
directory:
22+
23+
* `libphpdbg.so` (\*nix), or `libphpdbg.dylib` (macOS), or `libphpdbg.dll`
24+
(Windows)
25+
2026
## PHP_SAPI_PHPDBG_DEBUG
2127
2228
* Default: `OFF`
@@ -179,7 +185,7 @@ if(TARGET php_sapi_phpdbg_shared)
179185
set_target_properties(
180186
php_sapi_phpdbg_shared
181187
PROPERTIES
182-
OUTPUT_NAME libphpdbg
188+
PREFIX lib
183189
)
184190
endif()
185191

@@ -236,24 +242,20 @@ message(
236242
check_symbol_exists(
237243
UFFDIO_WRITEPROTECT_MODE_WP
238244
linux/userfaultfd.h
239-
HAVE_UFFDIO_WRITEPROTECT_MODE_WP
245+
_PHP_HAVE_UFFDIO_WRITEPROTECT_MODE_WP
240246
)
241-
if(HAVE_UFFDIO_WRITEPROTECT_MODE_WP)
242-
if(NOT PHP_THREAD_SAFETY)
243-
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
244-
find_package(Threads)
245-
if(Threads_FOUND)
246-
target_link_libraries(php_sapi_phpdbg PRIVATE Threads::Threads)
247-
if(TARGET php_sapi_phpdbg_shared)
248-
target_link_libraries(php_sapi_phpdbg_shared PRIVATE Threads::Threads)
249-
endif()
250-
else()
251-
message(WARNING "Threads not available.")
247+
if(_PHP_HAVE_UFFDIO_WRITEPROTECT_MODE_WP)
248+
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
249+
find_package(Threads)
250+
if(Threads_FOUND)
251+
target_link_libraries(php_sapi_phpdbg PRIVATE Threads::Threads)
252+
if(TARGET php_sapi_phpdbg_shared)
253+
target_link_libraries(php_sapi_phpdbg_shared PRIVATE Threads::Threads)
252254
endif()
253-
endif()
254255

255-
if(PHP_THREAD_SAFETY OR Threads_FOUND)
256256
set(HAVE_USERFAULTFD_WRITEFAULT TRUE)
257+
else()
258+
message(WARNING "Threads are not available.")
257259
endif()
258260
endif()
259261
if(HAVE_USERFAULTFD_WRITEFAULT)
@@ -314,6 +316,7 @@ if(TARGET php_sapi_phpdbg_shared)
314316
PHP_CONFIG_FILE_PATH "$<PATH:ABSOLUTE_PATH,NORMALIZE,${PHP_CONFIG_FILE_PATH},$<INSTALL_PREFIX>>"
315317
PHP_DEBUG "$<IF:$<CONFIG:Debug,DebugAssertions>,yes,no>"
316318
PHP_THREAD_SAFETY "$<IF:$<BOOL:$<TARGET_PROPERTY:PHP::config,PHP_THREAD_SAFETY>>,yes,no>"
319+
PHP_PHPDBG_SAPI_NAME "$<GENEX_EVAL:$<TARGET_PROPERTY:php_sapi_phpdbg_shared,OUTPUT_NAME>>"
317320
)
318321

319322
install(

cmake/sapi/phpdbg/cmake/CheckTiocgwinsz.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ include(CMakePushCheckState)
2929
message(CHECK_START "Checking whether termios.h defines TIOCGWINSZ")
3030
cmake_push_check_state(RESET)
3131
set(CMAKE_REQUIRED_QUIET TRUE)
32-
check_symbol_exists(TIOCGWINSZ termios.h HAVE_TIOCGWINSZ_IN_TERMIOS_H)
32+
check_symbol_exists(TIOCGWINSZ termios.h _PHP_HAVE_TIOCGWINSZ_IN_TERMIOS_H)
3333
cmake_pop_check_state()
3434

35-
if(NOT HAVE_TIOCGWINSZ_IN_TERMIOS_H)
35+
if(NOT _PHP_HAVE_TIOCGWINSZ_IN_TERMIOS_H)
3636
message(CHECK_FAIL "no")
3737

3838
message(CHECK_START "Checking whether sys/ioctl.h defines TIOCGWINSZ")

cmake/sapi/phpdbg/phpdbg.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Version: @PHP_VERSION@
3535
Cflags.private: @PHP_CFLAGS_PRIVATE@
3636
Cflags: -I${includedir}/${php_include_prefix} -I${includedir}/${php_include_prefix}/main -I${includedir}/${php_include_prefix}/TSRM -I${includedir}/${php_include_prefix}/Zend -I${includedir}/${php_include_prefix}/ext -I${includedir}/${php_include_prefix}/ext/lexbor
3737
Libs.private: @PHP_LIBS_PRIVATE@
38-
Libs: -L${libdir} -lphpdbg
38+
Libs: -L${libdir} -l@PHP_PHPDBG_SAPI_NAME@

docs/cmake/differences.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ build system:
4343
* sapi/phpdbg readline support works more intuitively regardless of the readline
4444
extension being enabled during the build.
4545
46+
* sapi/phpdbg shared library name on Windows is synced with \*nix systems
47+
(`libphpdbg`).
48+
4649
* ext/session can be built as shared on Windows (in testing phase).
4750
4851
* Obsolete check whether the `dlsym()` requires a leading underscore in symbol

docs/cmake/sapi/embed.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Configure the `embed` PHP SAPI.
1313
Enable the embedded PHP SAPI module for embedding PHP into application using C
1414
bindings.
1515

16-
The embed library is then located in the `sapi/embed` directory:
16+
The embed library is after the build phase located in the `sapi/embed`
17+
directory:
18+
1719
* as a shared library `libphp.so` (\*nix), or `libphp.dylib` (macOS), or
1820
`phpembed.dll` (Windows)
1921
* and a static library `libphp.a` (\*nix), or `phpembed.lib` (Windows)

docs/cmake/sapi/phpdbg.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Enable the phpdbg SAPI module as an executable.
1919

2020
Build phpdbg SAPI also as a shared module together with an executable.
2121

22+
The phpdbg shared library is after the build phase located in the `sapi/phpdbg`
23+
directory:
24+
25+
* `libphpdbg.so` (\*nix), or `libphpdbg.dylib` (macOS), or `libphpdbg.dll`
26+
(Windows)
27+
2228
## PHP_SAPI_PHPDBG_DEBUG
2329

2430
* Default: `OFF`

0 commit comments

Comments
 (0)