diff --git a/bin/php.cmake b/bin/php.cmake index 1524edb78..ab80da82c 100755 --- a/bin/php.cmake +++ b/bin/php.cmake @@ -184,9 +184,9 @@ function(php_check_url url result) ) if(status EQUAL 0) - set(${result} 1) + set(${result} TRUE) else() - set(${result} 0) + set(${result} FALSE) endif() return(PROPAGATE ${result}) diff --git a/cmake/Zend/CMakeLists.txt b/cmake/Zend/CMakeLists.txt index 00136a374..577b23453 100644 --- a/cmake/Zend/CMakeLists.txt +++ b/cmake/Zend/CMakeLists.txt @@ -310,7 +310,7 @@ target_include_directories( target_compile_definitions( zend PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE PUBLIC $<$:LIBZEND_EXPORTS> ) diff --git a/cmake/Zend/cmake/CheckDlsym.cmake b/cmake/Zend/cmake/CheckDlsym.cmake index 7a714b1e0..049ecf0f4 100644 --- a/cmake/Zend/cmake/CheckDlsym.cmake +++ b/cmake/Zend/cmake/CheckDlsym.cmake @@ -1,13 +1,16 @@ #[=============================================================================[ +# CheckDlsym + Check if `dlsym()` requires a leading underscore in symbol name. Some non-ELF platforms, such as OpenBSD, FreeBSD, NetBSD, Mac OSX (~10.3), needed underscore character (`_`) prefix for symbols, when using `dlsym()`. This module is obsolete on current platforms. -## Cache variables +## Result variables * `DLSYM_NEEDS_UNDERSCORE` + Whether `dlsym()` requires a leading underscore in symbol names. #]=============================================================================] @@ -30,7 +33,7 @@ check_include_file(dlfcn.h HAVE_DLFCN_H) block() if(HAVE_DLFCN_H) - set(definitions "-DHAVE_DLFCN_H=1") + set(definitions "-DHAVE_DLFCN_H") endif() try_run( @@ -110,14 +113,7 @@ block() endblock() if(DLSYM_NEEDS_UNDERSCORE_COMPILED AND DLSYM_NEEDS_UNDERSCORE_EXITCODE EQUAL 2) - set( - DLSYM_NEEDS_UNDERSCORE 1 - CACHE INTERNAL - "Whether dlsym() requires a leading underscore in symbol names." - ) -endif() - -if(DLSYM_NEEDS_UNDERSCORE) + set(DLSYM_NEEDS_UNDERSCORE TRUE) message(CHECK_PASS "yes") else() message(CHECK_FAIL "no") diff --git a/cmake/Zend/cmake/CheckFloatPrecision.cmake b/cmake/Zend/cmake/CheckFloatPrecision.cmake index 1bd54b9eb..2824866ab 100644 --- a/cmake/Zend/cmake/CheckFloatPrecision.cmake +++ b/cmake/Zend/cmake/CheckFloatPrecision.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckFloatPrecision + Check for x87 floating point internal precision control. See: https://wiki.php.net/rfc/rounding @@ -6,14 +8,23 @@ See: https://wiki.php.net/rfc/rounding ## Cache variables * `HAVE__FPU_SETCW` + Whether `_FPU_SETCW` is usable. + * `HAVE_FPSETPREC` + Whether `fpsetprec` is present and usable. + * `HAVE__CONTROLFP` + Whether `_controlfp` is present and usable. + * `HAVE__CONTROLFP_S` + Whether `_controlfp_s` is present and usable. + * `HAVE_FPU_INLINE_ASM_X86` + Whether FPU control word can be manipulated by inline assembler. #]=============================================================================] diff --git a/cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake b/cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake index d9d8d79a7..a134518be 100644 --- a/cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake +++ b/cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckGlobalRegisterVariables + Check whether the compiler and target system support global register variables. Global register variables are relevant for the GNU C compatible compilers. diff --git a/cmake/Zend/cmake/CheckMMAlignment.cmake b/cmake/Zend/cmake/CheckMMAlignment.cmake index ec3470b14..1928c0280 100644 --- a/cmake/Zend/cmake/CheckMMAlignment.cmake +++ b/cmake/Zend/cmake/CheckMMAlignment.cmake @@ -1,8 +1,10 @@ #[=============================================================================[ +# CheckMMAlignment + Test and set the alignment defines for the Zend memory manager (`ZEND_MM`). This also does the logarithmic test. -## Cache variables +## Result variables * `ZEND_MM_ALIGNMENT` * `ZEND_MM_ALIGNMENT_LOG2` @@ -23,7 +25,12 @@ if( set(ZEND_MM_EXITCODE__TRYRUN_OUTPUT "(size_t)8 (size_t)3 0") endif() -block() +block( + PROPAGATE + ZEND_MM_ALIGNMENT + ZEND_MM_ALIGNMENT_LOG2 + ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT +) try_run( ZEND_MM_EXITCODE ZEND_MM_COMPILED @@ -82,21 +89,13 @@ block() "ZEND_MM alignment defines failed. Please, check CMake logs.") endif() - set( - ZEND_MM_ALIGNMENT ${zend_mm_alignment} - CACHE INTERNAL "Alignment for Zend memory allocator" - ) - set( - ZEND_MM_ALIGNMENT_LOG2 ${zend_mm_alignment_log2} - CACHE INTERNAL "Alignment for Zend memory allocator log2" - ) - set( - ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT ${zend_mm_need_eight_byte_realignment} - CACHE INTERNAL "Whether 8-byte realignment is needed" - ) + set(ZEND_MM_ALIGNMENT ${zend_mm_alignment}) + set(ZEND_MM_ALIGNMENT_LOG2 ${zend_mm_alignment_log2}) + set(ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT ${zend_mm_need_eight_byte_realignment}) endblock() -message(VERBOSE +message( + VERBOSE "MM alignment values:\n" " ZEND_MM_ALIGNMENT=${ZEND_MM_ALIGNMENT}\n" " ZEND_MM_ALIGNMENT_LOG2=${ZEND_MM_ALIGNMENT_LOG2}\n" diff --git a/cmake/Zend/cmake/CheckStackLimit.cmake b/cmake/Zend/cmake/CheckStackLimit.cmake index 6b85ef760..712f90e64 100644 --- a/cmake/Zend/cmake/CheckStackLimit.cmake +++ b/cmake/Zend/cmake/CheckStackLimit.cmake @@ -1,9 +1,12 @@ #[=============================================================================[ +# CheckStackLimit + Check whether the stack grows downwards. Assumes contiguous stack. ## Cache variables -* `ZEND_CHECK_STACK_LIMIT` +* `ZEND_CHECK_STACK_LIMIT + Whether checking the stack limit is supported. #]=============================================================================] diff --git a/cmake/Zend/cmake/CheckStrerrorR.cmake b/cmake/Zend/cmake/CheckStrerrorR.cmake index ac924fb1d..9e20fb069 100644 --- a/cmake/Zend/cmake/CheckStrerrorR.cmake +++ b/cmake/Zend/cmake/CheckStrerrorR.cmake @@ -1,12 +1,17 @@ #[=============================================================================[ +# CheckStrerrorR + Check for `strerror_r()`, and if its a POSIX-compatible or a GNU-specific version. ## Cache variables * `HAVE_STRERROR_R` + Whether `strerror_r()` is available. + * `STRERROR_R_CHAR_P` + Whether `strerror_r()` returns a `char *` message, otherwise it returns an `int` error number. #]=============================================================================] diff --git a/cmake/Zend/cmake/Fibers.cmake b/cmake/Zend/cmake/Fibers.cmake index c93f0818d..cc5c14347 100644 --- a/cmake/Zend/cmake/Fibers.cmake +++ b/cmake/Zend/cmake/Fibers.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# Fibers + Check if Fibers can be used. This module adds Boost fiber assembly files support if available for the diff --git a/cmake/Zend/cmake/MaxExecutionTimers.cmake b/cmake/Zend/cmake/MaxExecutionTimers.cmake index 4370612d3..2689442dd 100644 --- a/cmake/Zend/cmake/MaxExecutionTimers.cmake +++ b/cmake/Zend/cmake/MaxExecutionTimers.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# MaxExecutionTimers + Check whether to enable Zend max execution timers. ## Cache variables diff --git a/cmake/cmake/CMakeDefaults.cmake b/cmake/cmake/CMakeDefaults.cmake index b078549ba..5cb2d5522 100644 --- a/cmake/cmake/CMakeDefaults.cmake +++ b/cmake/cmake/CMakeDefaults.cmake @@ -35,25 +35,23 @@ set(CMAKE_SHARED_MODULE_PREFIX_CXX "") set(CMAKE_STATIC_LIBRARY_PREFIX_CXX "") # Whether to enable verbose output from Makefile builds. -option(CMAKE_VERBOSE_MAKEFILE "Enable verbose output from Makefile builds" OFF) +option(CMAKE_VERBOSE_MAKEFILE "Enable verbose output from Makefile builds") mark_as_advanced(CMAKE_VERBOSE_MAKEFILE) # Whether to show message context in configuration log. option( CMAKE_MESSAGE_CONTEXT_SHOW "Show message context in configuration log, where possible" - OFF ) mark_as_advanced(CMAKE_MESSAGE_CONTEXT_SHOW) # Whether to build all libraries as shared. -option(BUILD_SHARED_LIBS "Build enabled PHP extensions as shared libraries" OFF) +option(BUILD_SHARED_LIBS "Build enabled PHP extensions as shared libraries") # Treat all compile warnings as errors at the build phase, if compiler supports # such compile option, like -Werror, /WX, or similar. option( CMAKE_COMPILE_WARNING_AS_ERROR "Treat all compile warnings as errors at the build phase" - OFF ) mark_as_advanced(CMAKE_COMPILE_WARNING_AS_ERROR) diff --git a/cmake/cmake/Configuration.cmake b/cmake/cmake/Configuration.cmake index 6b5023f30..907a49675 100644 --- a/cmake/cmake/Configuration.cmake +++ b/cmake/cmake/Configuration.cmake @@ -92,10 +92,10 @@ mark_as_advanced(PHP_PROGRAM_PREFIX) set(PHP_PROGRAM_SUFFIX "" CACHE STRING "Append suffix to the program names") mark_as_advanced(PHP_PROGRAM_SUFFIX) -option(PHP_RE2C_CGOTO "Enable computed goto GCC extension with re2c" OFF) +option(PHP_RE2C_CGOTO "Enable computed goto GCC extension with re2c") mark_as_advanced(PHP_RE2C_CGOTO) -option(PHP_THREAD_SAFETY "Enable thread safety (ZTS)" OFF) +option(PHP_THREAD_SAFETY "Enable thread safety (ZTS)") cmake_dependent_option( PHP_USE_RTLD_NOW @@ -127,10 +127,10 @@ mark_as_advanced(PHP_DEFAULT_SHORT_OPEN_TAG) option(PHP_IPV6 "Enable IPv6 support" ON) mark_as_advanced(PHP_IPV6) -option(PHP_DMALLOC "Enable the Dmalloc memory debugger library" OFF) +option(PHP_DMALLOC "Enable the Dmalloc memory debugger library") mark_as_advanced(PHP_DMALLOC) -option(PHP_DTRACE "Enable DTrace support" OFF) +option(PHP_DTRACE "Enable DTrace support") mark_as_advanced(PHP_DTRACE) set(PHP_FD_SETSIZE "" CACHE STRING "Size of file descriptor sets") @@ -139,30 +139,25 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND PHP_FD_SETSIZE STREQUAL "") endif() mark_as_advanced(PHP_FD_SETSIZE) -option(PHP_VALGRIND "Enable the Valgrind support" OFF) +option(PHP_VALGRIND "Enable the Valgrind support") mark_as_advanced(PHP_VALGRIND) option( PHP_MEMORY_SANITIZER "Enable the memory sanitizer compiler options (Clang only)" - OFF ) mark_as_advanced(PHP_MEMORY_SANITIZER) -option(PHP_ADDRESS_SANITIZER "Enable the address sanitizer compiler option" OFF) +option(PHP_ADDRESS_SANITIZER "Enable the address sanitizer compiler option") mark_as_advanced(PHP_ADDRESS_SANITIZER) -option( - PHP_UNDEFINED_SANITIZER - "Enable the undefined sanitizer compiler option" - OFF -) +option(PHP_UNDEFINED_SANITIZER "Enable the undefined sanitizer compiler option") mark_as_advanced(PHP_UNDEFINED_SANITIZER) -option(PHP_GCOV "Enable GCOV code coverage and include GCOV symbols" OFF) +option(PHP_GCOV "Enable GCOV code coverage and include GCOV symbols") mark_as_advanced(PHP_GCOV) -option(PHP_LIBGCC "Explicitly link against libgcc" OFF) +option(PHP_LIBGCC "Explicitly link against libgcc") mark_as_advanced(PHP_LIBGCC) option(PHP_CCACHE "Use ccache if available on the system" ON) diff --git a/cmake/cmake/ConfigureChecks.cmake b/cmake/cmake/ConfigureChecks.cmake index e48fe7948..a2899f106 100644 --- a/cmake/cmake/ConfigureChecks.cmake +++ b/cmake/cmake/ConfigureChecks.cmake @@ -189,7 +189,7 @@ if(SIZEOF_PTRDIFF_T STREQUAL "") "Couldn't determine the ptrdiff_t size, setting it to ${SIZEOF_PTRDIFF_T}." ) endif() -set(HAVE_PTRDIFF_T 1) +set(HAVE_PTRDIFF_T TRUE) check_type_size("size_t" SIZEOF_SIZE_T) if(SIZEOF_SIZE_T STREQUAL "") @@ -391,7 +391,7 @@ include(PHP/CheckFopencookie) # component of the path has execute but not read permissions. message(CHECK_START "Checking for broken getcwd()") if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") - set(HAVE_BROKEN_GETCWD 1 CACHE INTERNAL "Define if system has broken getcwd") + set(HAVE_BROKEN_GETCWD TRUE) message(CHECK_PASS "yes") else() message(CHECK_FAIL "no") @@ -814,8 +814,8 @@ if(PHP_GCOV) if(TARGET Gcov::Gcov) target_link_libraries(php_configuration INTERFACE Gcov::Gcov) - gcov_generate_report() + set(HAVE_GCOV TRUE) endif() endif() @@ -830,7 +830,7 @@ if(PHP_VALGRIND) ) if(Valgrind_FOUND) - set(HAVE_VALGRIND 1) + set(HAVE_VALGRIND TRUE) endif() target_link_libraries(php_configuration INTERFACE Valgrind::Valgrind) diff --git a/cmake/cmake/Flags.cmake b/cmake/cmake/Flags.cmake index 02c8e8586..0c2b709ef 100644 --- a/cmake/cmake/Flags.cmake +++ b/cmake/cmake/Flags.cmake @@ -8,7 +8,7 @@ include(CheckSourceRuns) include(CMakePushCheckState) include(PHP/CheckCompilerFlag) -get_cmake_property(enabledLanguages ENABLED_LANGUAGES) +get_property(enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES) # Check for broken GCC optimize-strlen. include(PHP/CheckBrokenGccStrlenOpt) diff --git a/cmake/cmake/Requirements.cmake b/cmake/cmake/Requirements.cmake index ac155df27..1bb316b4e 100644 --- a/cmake/cmake/Requirements.cmake +++ b/cmake/cmake/Requirements.cmake @@ -118,7 +118,7 @@ if( endif() ################################################################################ -# Find sendmail binary. +# Find mailer. ################################################################################ find_package(Sendmail) diff --git a/cmake/cmake/Testing.cmake b/cmake/cmake/Testing.cmake index e68090e46..8df0d6e61 100644 --- a/cmake/cmake/Testing.cmake +++ b/cmake/cmake/Testing.cmake @@ -16,7 +16,7 @@ block() set(parallel -j${processors}) endif() - get_cmake_property(extensions PHP_EXTENSIONS) + get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) foreach(extension ${extensions}) get_target_property(type php_${extension} TYPE) if(type MATCHES "^(MODULE|SHARED)_LIBRARY$") diff --git a/cmake/cmake/modules/FindBerkeleyDB.cmake b/cmake/cmake/modules/FindBerkeleyDB.cmake index 69108fccd..2b594e045 100644 --- a/cmake/cmake/modules/FindBerkeleyDB.cmake +++ b/cmake/cmake/modules/FindBerkeleyDB.cmake @@ -10,8 +10,8 @@ Module defines the following `IMPORTED` target(s): ## Result variables * `BerkeleyDB_FOUND` - Whether the package has been found. -* `BerkeleyDB_INCLUDE_DIRS`- Include directories needed to use this package. -* `BerkeleyDB_LIBRARIES`- Libraries needed to link to the package library. +* `BerkeleyDB_INCLUDE_DIRS` - Include directories needed to use this package. +* `BerkeleyDB_LIBRARIES` - Libraries needed to link to the package library. * `BerkeleyDB_VERSION` - Package version, if found. ## Cache variables diff --git a/cmake/cmake/modules/FindCclient.cmake b/cmake/cmake/modules/FindCclient.cmake index 2b5b25b65..72ff60eb5 100644 --- a/cmake/cmake/modules/FindCclient.cmake +++ b/cmake/cmake/modules/FindCclient.cmake @@ -16,14 +16,14 @@ Module defines the following `IMPORTED` target(s): * `Cclient_FOUND` - Whether the package has been found. * `Cclient_INCLUDE_DIRS` - Include directories needed to use this package. * `Cclient_LIBRARIES` - Libraries needed to link to the package library. +* `HAVE_IMAP2000` - Whether c-client version is 2000 or newer. If true, + c-client.h should be included instead of only rfc822.h on prior versions. +* `HAVE_IMAP2001` - Whether c-client version is 2001 to 2004. ## Cache variables * `Cclient_INCLUDE_DIR` - Directory containing package library headers. * `Cclient_LIBRARY` - The path to the package library. -* `HAVE_IMAP2000` - Whether c-client version is 2000 or newer. If true, - c-client.h should be included instead of only rfc822.h on prior versions. -* `HAVE_IMAP2001` - Whether c-client version is 2001 to 2004. * `HAVE_IMAP2004` - Whether c-client version is 2004 or newer. * `HAVE_NEW_MIME2TEXT` - Whether utf8_mime2text() has new signature. * `HAVE_RFC822_OUTPUT_ADDRESS_LIST` - Whether function @@ -357,10 +357,7 @@ endif() # Check whether c-client version is 2000 or newer. if(EXISTS ${Cclient_INCLUDE_DIR}/c-client.h) - set( - HAVE_IMAP2000 1 - CACHE INTERNAL "Whether c-client version is 2000 or newer" - ) + set(HAVE_IMAP2000 TRUE) endif() block() @@ -378,10 +375,7 @@ block() if(imapsslport_results) message(CHECK_PASS "yes") - set( - HAVE_IMAP2001 1 - CACHE INTERNAL "Whether c-client version is 2001 to 2004" - ) + set(HAVE_IMAP2001 TRUE) else() message(CHECK_FAIL "no") endif() diff --git a/cmake/cmake/modules/FindGcov.cmake b/cmake/cmake/modules/FindGcov.cmake index 7a986b763..621094ffc 100644 --- a/cmake/cmake/modules/FindGcov.cmake +++ b/cmake/cmake/modules/FindGcov.cmake @@ -16,7 +16,6 @@ Module defines the following `IMPORTED` target(s): * `Gcov_GCOVR_EXECUTABLE` - The gcovr program executable. * `Gcov_GENHTML_EXECUTABLE` - The genhtml program executable. * `Gcov_LCOV_EXECUTABLE` - The lcov program executable. -* `HAVE_GCOV` - Whether the Gcov is available. ## Macros provided by this module @@ -88,8 +87,6 @@ find_package_handle_standard_args( unset(_reason) if(Gcov_FOUND AND NOT TARGET Gcov::Gcov) - set(HAVE_GCOV 1 CACHE INTERNAL "Whether GCOV is available.") - add_library(Gcov::Gcov INTERFACE IMPORTED) set_target_properties( diff --git a/cmake/cmake/modules/FindSendmail.cmake b/cmake/cmake/modules/FindSendmail.cmake index 59f4f3053..e1b92ee44 100644 --- a/cmake/cmake/modules/FindSendmail.cmake +++ b/cmake/cmake/modules/FindSendmail.cmake @@ -1,16 +1,20 @@ #[=============================================================================[ # FindSendmail -Find the `sendmail` program. +This module finds mailer program for PHP and sets sensible defaults based on the +target system. On Windows, PHP has built-in mailer (sendmail.c), on *nix systems +either `sendmail` is used if found, or a general default value is set to +`/usr/sbin/sendmail`. ## Result variables * `Sendmail_FOUND` - Whether sendmail has been found. +* `PROG_SENDMAIL` - Path to the sendmail executable program, either found by + the module or set to a sensible default value. ## Cache variables -* `Sendmail_EXECUTABLE` - Path to the sendmail executable, if found. -* `PROG_SENDMAIL` - Path to the sendmail program. +* `Sendmail_EXECUTABLE` - Path to the sendmail executable program, if found. #]=============================================================================] include(FeatureSummary) @@ -23,29 +27,40 @@ set_package_properties( DESCRIPTION "Mail Transport Agent" ) -find_program( - Sendmail_EXECUTABLE - NAMES sendmail - DOC "The path to the sendmail executable" -) +set(_reason) -if(Sendmail_EXECUTABLE) - set(_sendmail ${Sendmail_EXECUTABLE}) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(_sendmailIsBuiltInMsg "PHP built-in mailer (Windows)") + set(_sendmailRequiredVars _sendmailIsBuiltInMsg) else() - set(_sendmail "/usr/sbin/sendmail") -endif() + find_program( + Sendmail_EXECUTABLE + NAMES sendmail + DOC "The path to the sendmail executable" + ) + mark_as_advanced(Sendmail_EXECUTABLE) -# TODO: Should this be result variable? -set(PROG_SENDMAIL "${_sendmail}" CACHE INTERNAL "Path to sendmail executable") + set(_sendmailRequiredVars Sendmail_EXECUTABLE) -mark_as_advanced(Sendmail_EXECUTABLE) + if(Sendmail_EXECUTABLE) + set(PROG_SENDMAIL ${Sendmail_EXECUTABLE}) + else() + set(PROG_SENDMAIL "/usr/sbin/sendmail") + endif() + + set( + _reason + "sendmail not found. Default set to ${PROG_SENDMAIL}. + It can be overridden with 'sendmail_path' php.ini directive." + ) +endif() find_package_handle_standard_args( Sendmail - REQUIRED_VARS Sendmail_EXECUTABLE - REASON_FAILURE_MESSAGE - "sendmail not found, setting default to ${_sendmail}. - It can be overridden in php.ini with sendmail_path directive." + REQUIRED_VARS ${_sendmailRequiredVars} + REASON_FAILURE_MESSAGE "${_reason}" ) -unset(_sendmail) +unset(_reason) +unset(_sendmailIsBuiltInMsg) +unset(_sendmailRequiredVars) diff --git a/cmake/cmake/modules/PHP/AddCustomCommand.cmake b/cmake/cmake/modules/PHP/AddCustomCommand.cmake index 86c897ac2..e36a085d3 100644 --- a/cmake/cmake/modules/PHP/AddCustomCommand.cmake +++ b/cmake/cmake/modules/PHP/AddCustomCommand.cmake @@ -32,12 +32,16 @@ php_add_custom_command( ) ``` +## Basic usage + It acts similar to `add_custom_command()` and `add_custom_target()`, except that when PHP is not found on the system, the DEPENDS argument doesn't add dependencies among targets but instead checks their timestamps manually and executes the PHP_COMMAND only when needed. ```cmake +# CMakeLists.txt +include(PHP/AddCustomCommand) php_add_custom_command( php_generate_something OUTPUT diff --git a/cmake/cmake/modules/PHP/CheckAVX512.cmake b/cmake/cmake/modules/PHP/CheckAVX512.cmake index 65fe10161..17649b8ee 100644 --- a/cmake/cmake/modules/PHP/CheckAVX512.cmake +++ b/cmake/cmake/modules/PHP/CheckAVX512.cmake @@ -10,8 +10,11 @@ TODO: Adjust checks for MSVC. ## Cache variables * `PHP_HAVE_AVX512_SUPPORTS` + Whether compiler supports AVX-512. + * `PHP_HAVE_AVX512_VBMI_SUPPORTS` + Whether compiler supports AVX-512 VBMI. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckBrokenGccStrlenOpt.cmake b/cmake/cmake/modules/PHP/CheckBrokenGccStrlenOpt.cmake index 50456e18e..ca22b4e41 100644 --- a/cmake/cmake/modules/PHP/CheckBrokenGccStrlenOpt.cmake +++ b/cmake/cmake/modules/PHP/CheckBrokenGccStrlenOpt.cmake @@ -9,6 +9,7 @@ See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 ## Cache variables * `PHP_HAVE_BROKEN_OPTIMIZE_STRLEN` + Whether GCC has broken strlen() optimization. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckBuiltin.cmake b/cmake/cmake/modules/PHP/CheckBuiltin.cmake index 761b3e810..1060ca457 100644 --- a/cmake/cmake/modules/PHP/CheckBuiltin.cmake +++ b/cmake/cmake/modules/PHP/CheckBuiltin.cmake @@ -12,11 +12,11 @@ php_check_builtin( ) If builtin `` is supported by the C compiler, store the check result in the cache variable ``. -For example: +## Basic usage ```cmake +# CMakeLists.txt include(PHP/CheckBuiltin) - php_check_builtin(__builtin_clz PHP_HAVE_BUILTIN_CLZ) ``` #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckByteOrder.cmake b/cmake/cmake/modules/PHP/CheckByteOrder.cmake index 79473b860..6a07a0d5e 100644 --- a/cmake/cmake/modules/PHP/CheckByteOrder.cmake +++ b/cmake/cmake/modules/PHP/CheckByteOrder.cmake @@ -16,7 +16,7 @@ message(CHECK_START "Checking byte ordering") if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN") message(CHECK_PASS "big-endian") - set(WORDS_BIGENDIAN 1 CACHE INTERNAL "Whether byte ordering is big-endian.") + set(WORDS_BIGENDIAN TRUE CACHE INTERNAL "Whether byte ordering is big-endian.") elseif(CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN") message(CHECK_PASS "little-endian") else() diff --git a/cmake/cmake/modules/PHP/CheckCopyFileRange.cmake b/cmake/cmake/modules/PHP/CheckCopyFileRange.cmake index aea92c259..d8c0b6c37 100644 --- a/cmake/cmake/modules/PHP/CheckCopyFileRange.cmake +++ b/cmake/cmake/modules/PHP/CheckCopyFileRange.cmake @@ -8,6 +8,7 @@ only on Linux. ## Cache variables * `HAVE_COPY_FILE_RANGE` + Whether `copy_file_range()` is supported. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckFlushIo.cmake b/cmake/cmake/modules/PHP/CheckFlushIo.cmake index eb55afd70..4867d6c51 100644 --- a/cmake/cmake/modules/PHP/CheckFlushIo.cmake +++ b/cmake/cmake/modules/PHP/CheckFlushIo.cmake @@ -6,6 +6,7 @@ Check if flush should be called explicitly after buffered io. ## Cache variables * `HAVE_FLUSHIO` + Whether flush should be called explicitly after a buffered io. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckFopencookie.cmake b/cmake/cmake/modules/PHP/CheckFopencookie.cmake index 31aba6274..09ac41673 100644 --- a/cmake/cmake/modules/PHP/CheckFopencookie.cmake +++ b/cmake/cmake/modules/PHP/CheckFopencookie.cmake @@ -13,8 +13,11 @@ to use `off_t` only, check is left here when using glibc. ## Cache variables * `HAVE_FOPENCOOKIE` + Whether `fopencookie()` and `cookie_io_functions_t` are available. + * `COOKIE_SEEKER_USES_OFF64_T` + Whether `fopencookie` seeker uses the `off64_t` type. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckGetaddrinfo.cmake b/cmake/cmake/modules/PHP/CheckGetaddrinfo.cmake index 222f461b4..7d0f96dc2 100644 --- a/cmake/cmake/modules/PHP/CheckGetaddrinfo.cmake +++ b/cmake/cmake/modules/PHP/CheckGetaddrinfo.cmake @@ -6,11 +6,13 @@ Check for working `getaddrinfo()`. ## Cache variables * `HAVE_GETADDRINFO` + Whether `getaddrinfo()` function is working as expected. IMPORTED target: * `PHP::CheckGetaddrinfoLibrary` + If there is additional library to be linked for using `getaddrinfo()`. #]=============================================================================] @@ -45,8 +47,8 @@ if(libraryForGetaddrinfo) ) endif() -# If the variable HAVE_GETADDRINFO has been overridden (for example, on Windows) -# or cached in consecutive runs, the module stops here. +# If the variable HAVE_GETADDRINFO has been overridden the module stops here. +# For example, on Windows. if(HAVE_GETADDRINFO) message(CHECK_PASS "yes (cached)") return() diff --git a/cmake/cmake/modules/PHP/CheckGethostbynameR.cmake b/cmake/cmake/modules/PHP/CheckGethostbynameR.cmake index 335954a86..794debd3b 100644 --- a/cmake/cmake/modules/PHP/CheckGethostbynameR.cmake +++ b/cmake/cmake/modules/PHP/CheckGethostbynameR.cmake @@ -17,18 +17,26 @@ https://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html ## Cache variables -* `HAVE_GETHOSTBYNAME_R` - Whether `gethostbyname_r()` is available. * `HAVE_FUNC_GETHOSTBYNAME_R_6` + Whether `gethostbyname_r()` has 6 arguments. + * `HAVE_FUNC_GETHOSTBYNAME_R_5` + Whether `gethostbyname_r()` has 5 arguments. + * `HAVE_FUNC_GETHOSTBYNAME_R_3` + Whether `gethostbyname_r()` has 3 arguments. -INTERFACE library: +* `HAVE_GETHOSTBYNAME_R` + + Whether `gethostbyname_r()` is available. + +## INTERFACE library * `PHP::CheckGethostbynameR` + Created when additional system library needs to be linked. #]=============================================================================] @@ -118,7 +126,7 @@ if( OR HAVE_FUNC_GETHOSTBYNAME_R_3 ) set( - HAVE_GETHOSTBYNAME_R 1 - CACHE INTERNAL "Define to 1 if you have some form of gethostbyname_r()." + HAVE_GETHOSTBYNAME_R TRUE + CACHE INTERNAL "Whether gethostbyname_r() is available." ) endif() diff --git a/cmake/cmake/modules/PHP/CheckIPv6.cmake b/cmake/cmake/modules/PHP/CheckIPv6.cmake index b63b621e9..bb503f3cd 100644 --- a/cmake/cmake/modules/PHP/CheckIPv6.cmake +++ b/cmake/cmake/modules/PHP/CheckIPv6.cmake @@ -6,6 +6,7 @@ Check for IPv6 support. ## Cache variables * `HAVE_IPV6` + Whether IPv6 support is enabled. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckInline.cmake b/cmake/cmake/modules/PHP/CheckInline.cmake index 1287076cc..c6f6f4fed 100644 --- a/cmake/cmake/modules/PHP/CheckInline.cmake +++ b/cmake/cmake/modules/PHP/CheckInline.cmake @@ -13,6 +13,7 @@ definition needs to be used so the code compiles as a workaround. ## Cache variables * `INLINE_KEYWORD_DEFINITION` + Header definition line that sets the compiler's `inline` keyword. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckReentrantFunctions.cmake b/cmake/cmake/modules/PHP/CheckReentrantFunctions.cmake index 91da0061e..a6dd63eb9 100644 --- a/cmake/cmake/modules/PHP/CheckReentrantFunctions.cmake +++ b/cmake/cmake/modules/PHP/CheckReentrantFunctions.cmake @@ -11,25 +11,44 @@ functions on current systems and this module might be obsolete in the future. ## Cache variables * `HAVE_LOCALTIME_R` - Whether `localtime_r()` is available. + + Whether `localtime_r()` is available. + * `MISSING_LOCALTIME_R_DECL` - Whether `localtime_r()` is not declared. + + Whether `localtime_r()` is not declared. + * `HAVE_GMTIME_R` - Whether `gmtime_r()` is available. + + Whether `gmtime_r()` is available. + * `MISSING_GMTIME_R_DECL` - Whether `gmtime_r()` is not declared. + + Whether `gmtime_r()` is not declared. + * `HAVE_ASCTIME_R` - Whether `asctime_r()` is available. + + Whether `asctime_r()` is available. + * `MISSING_ASCTIME_R_DECL` - Whether `asctime_r()` is not declared. + + Whether `asctime_r()` is not declared. + * `HAVE_CTIME_R` - Whether `ctime_r()` is available. + + Whether `ctime_r()` is available. + * `MISSING_CTIME_R_DECL` - Whether `ctime_r()` is not declared. + + Whether `ctime_r()` is not declared. + * `HAVE_STRTOK_R` - Whether `strtok_r()` is available. + + Whether `strtok_r()` is available. + * `MISSING_STRTOK_R_DECL` - Whether `strtok_r()` is not declared. + + Whether `strtok_r()` is not declared. #]=============================================================================] include_guard(GLOBAL) @@ -57,7 +76,7 @@ function(_php_check_reentrant_function symbol header) message(CHECK_FAIL "missing") set( - MISSING_${const}_DECL 1 + MISSING_${const}_DECL TRUE CACHE INTERNAL "Define if ${symbol} is not declared." ) else() diff --git a/cmake/cmake/modules/PHP/CheckSegmentsAlignment.cmake b/cmake/cmake/modules/PHP/CheckSegmentsAlignment.cmake index bf04c878b..bf353acbc 100644 --- a/cmake/cmake/modules/PHP/CheckSegmentsAlignment.cmake +++ b/cmake/cmake/modules/PHP/CheckSegmentsAlignment.cmake @@ -80,7 +80,7 @@ else() endif() endif() -get_cmake_property(enabledLanguages ENABLED_LANGUAGES) +get_property(enabledLanguages GLOBAL PROPERTY ENABLED_LANGUAGES) if(CXX IN_LIST enabledLanguages) check_linker_flag( diff --git a/cmake/cmake/modules/PHP/CheckSysMacros.cmake b/cmake/cmake/modules/PHP/CheckSysMacros.cmake index 6436ce1e9..54c3fc94e 100644 --- a/cmake/cmake/modules/PHP/CheckSysMacros.cmake +++ b/cmake/cmake/modules/PHP/CheckSysMacros.cmake @@ -36,18 +36,29 @@ int main(void) ## Cache variables * `HAVE_SYS_TYPES_H` + Define to 1 if you have the `` header file. + * `HAVE_SYS_MKDEV_H` + Define to 1 if you have the `` header file. + * `HAVE_SYS_SYSMACROS_H` + Define to 1 if you have the `` header file. + * `MAJOR_IN_MKDEV` + Define to 1 if `major`, `minor`, and `makedev` are declared in ``. + * `MAJOR_IN_SYSMACROS` + Define to 1 if `major`, `minor`, and `makedev` are declared in ``. + * `HAVE_MAKEDEV` + Define to 1 if you have the `makedev` function. #]=============================================================================] diff --git a/cmake/cmake/modules/PHP/CheckTimeR.cmake b/cmake/cmake/modules/PHP/CheckTimeR.cmake index 898e4b3bf..8dc00036b 100644 --- a/cmake/cmake/modules/PHP/CheckTimeR.cmake +++ b/cmake/cmake/modules/PHP/CheckTimeR.cmake @@ -6,10 +6,13 @@ POSIX. ## Cache variables - PHP_HPUX_TIME_R - Whether HP-UX 10.x is used. - PHP_IRIX_TIME_R - Whether IRIX-style functions are used. +* `PHP_HPUX_TIME_R` + + Whether HP-UX 10.x is used. + +* `PHP_IRIX_TIME_R` + + Whether IRIX-style functions are used. #]=============================================================================] include_guard(GLOBAL) diff --git a/cmake/cmake/modules/PHP/CheckWrite.cmake b/cmake/cmake/modules/PHP/CheckWrite.cmake index 9315e4dcc..967bb2852 100644 --- a/cmake/cmake/modules/PHP/CheckWrite.cmake +++ b/cmake/cmake/modules/PHP/CheckWrite.cmake @@ -6,6 +6,7 @@ Check whether writing to stdout works. ## Cache variables * `PHP_WRITE_STDOUT` + Whether `write(2)` works. #]=============================================================================] @@ -32,7 +33,7 @@ cmake_push_check_state(RESET) check_include_file(unistd.h HAVE_UNISTD_H) if(HAVE_UNISTD_H) - list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_UNISTD_H=1) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_UNISTD_H) endif() check_source_runs(C [[ diff --git a/cmake/cmake/modules/PHP/Extensions.cmake b/cmake/cmake/modules/PHP/Extensions.cmake index 2e9ea0749..2b54237ca 100644 --- a/cmake/cmake/modules/PHP/Extensions.cmake +++ b/cmake/cmake/modules/PHP/Extensions.cmake @@ -74,7 +74,7 @@ function(php_extensions_preprocess) _php_extensions_sort(extensions) _php_extensions_eval_options("${extensions}") - get_cmake_property(alwaysEnabledExtensions PHP_ALWAYS_ENABLED_EXTENSIONS) + get_property(alwaysEnabledExtensions GLOBAL PROPERTY PHP_ALWAYS_ENABLED_EXTENSIONS) foreach(extension IN LISTS extensions) string(TOUPPER "${extension}" extensionUpper) @@ -218,7 +218,7 @@ function(_php_extensions_parse_dependencies extension result) if(allDependencies) list(REMOVE_DUPLICATES allDependencies) - get_cmake_property(allExtensions PHP_ALL_EXTENSIONS) + get_property(allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS) foreach(dependency ${allDependencies}) if(NOT "${dependency}" IN_LIST allExtensions) @@ -234,7 +234,7 @@ endfunction() function(_php_extensions_get_dependencies extension result) set(${result} PARENT_SCOPE) - get_cmake_property(deps PHP_EXTENSION_${extension}_DEPS) + get_property(deps GLOBAL PROPERTY PHP_EXTENSION_${extension}_DEPS) if(deps) set(${result} "${deps}" PARENT_SCOPE) endif() @@ -302,8 +302,8 @@ endfunction() # Parse and evaluate options of extensions. function(_php_extensions_eval_options directories) set(code "") - get_cmake_property(alwaysEnabledExtensions PHP_ALWAYS_ENABLED_EXTENSIONS) - get_cmake_property(allExtensions PHP_ALL_EXTENSIONS) + get_property(alwaysEnabledExtensions GLOBAL PROPERTY PHP_ALWAYS_ENABLED_EXTENSIONS) + get_property(allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS) foreach(extension IN LISTS extensions) # Skip if extension is always enabled or if dependency is not extension. @@ -375,8 +375,8 @@ function(php_extensions_postconfigure extension) MANUALLY_ADDED_DEPENDENCIES ) list(TRANSFORM dependencies REPLACE "^php_" "") - get_cmake_property(alwaysEnabledExtensions PHP_ALWAYS_ENABLED_EXTENSIONS) - get_cmake_property(allExtensions PHP_ALL_EXTENSIONS) + get_property(alwaysEnabledExtensions GLOBAL PROPERTY PHP_ALWAYS_ENABLED_EXTENSIONS) + get_property(allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS) foreach(dependency IN LISTS dependencies) string(TOUPPER "${dependency}" dependencyUpper) @@ -433,12 +433,12 @@ function(php_extensions_postconfigure extension) return() endif() - target_compile_definitions(php_${extension} PRIVATE ZEND_COMPILE_DL_EXT=1) + target_compile_definitions(php_${extension} PRIVATE ZEND_COMPILE_DL_EXT) set_target_properties( php_${extension} PROPERTIES - POSITION_INDEPENDENT_CODE TRUE + POSITION_INDEPENDENT_CODE ON ) # Set build-phase location for shared extensions. @@ -454,7 +454,7 @@ endfunction() # Prepend COMPILE_DL_ macros to extensions configuration headers and # define them for shared extensions. function(php_extensions_configure_headers) - get_cmake_property(extensions PHP_EXTENSIONS) + get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) foreach(extension ${extensions}) if(NOT TARGET php_${extension}) continue() @@ -464,7 +464,7 @@ function(php_extensions_configure_headers) get_target_property(type php_${extension} TYPE) if(type MATCHES "^(MODULE|SHARED)_LIBRARY$") - set(${macro} 1) + set(${macro} TRUE) endif() # Prepare config.h template. @@ -512,7 +512,7 @@ function(_php_extensions_validate) list(TRANSFORM dependencies REPLACE "^php_" "") - get_cmake_property(allExtensions PHP_ALL_EXTENSIONS) + get_property(allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS) foreach(dependency ${dependencies}) # Skip dependencies that are not PHP extensions. diff --git a/cmake/cmake/modules/PHP/FeatureSummary.cmake b/cmake/cmake/modules/PHP/FeatureSummary.cmake index 9a604890b..15158eca6 100644 --- a/cmake/cmake/modules/PHP/FeatureSummary.cmake +++ b/cmake/cmake/modules/PHP/FeatureSummary.cmake @@ -101,7 +101,7 @@ block() set(missingExtensions "") set(sharedExtensionsSummary "") - get_cmake_property(extensions PHP_EXTENSIONS) + get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) foreach(extension ${extensions}) if(NOT TARGET php_${extension}) @@ -120,7 +120,7 @@ block() list(TRANSFORM dependencies REPLACE "^php_" "") - get_cmake_property(allExtensions PHP_ALL_EXTENSIONS) + get_property(allExtensions GLOBAL PROPERTY PHP_ALL_EXTENSIONS) foreach(dependency ${dependencies}) # Skip dependencies that are not inside the current project. diff --git a/cmake/cmake/modules/PHP/StandardLibrary.cmake b/cmake/cmake/modules/PHP/StandardLibrary.cmake index 54ac9c716..c9afdb997 100644 --- a/cmake/cmake/modules/PHP/StandardLibrary.cmake +++ b/cmake/cmake/modules/PHP/StandardLibrary.cmake @@ -16,8 +16,7 @@ Determine the C standard library used for the build. * `musl` * `uclibc` -## Cache variables -* `__MUSL__` +* `__MUSL__` - Whether C standard library is musl. #]=============================================================================] include_guard(GLOBAL) @@ -109,7 +108,7 @@ else() endblock() endif() if(PHP_C_STANDARD_LIBRARY STREQUAL "musl") - set(__MUSL__ 1 CACHE INTERNAL "Whether musl libc is used.") + set(__MUSL__ TRUE) message(CHECK_PASS "musl") return() endif() diff --git a/cmake/cmake/modules/PHP/SystemExtensions.cmake b/cmake/cmake/modules/PHP/SystemExtensions.cmake index 162ce6591..1ef2ace74 100644 --- a/cmake/cmake/modules/PHP/SystemExtensions.cmake +++ b/cmake/cmake/modules/PHP/SystemExtensions.cmake @@ -17,41 +17,33 @@ Obsolete preprocessor macros that are not defined by this module: Conditionally defined preprocessor macros: * `__EXTENSIONS__` + Defined on Solaris and illumos-based systems. * `_XOPEN_SOURCE=500` + Defined on HP-UX. ## Result variables -* `PHP_SYSTEM_EXTENSIONS` - String for containing all system extensions definitions for usage in the - configuration header template. +* `PHP_SYSTEM_EXTENSIONS_CODE` -IMPORTED target: + The configuration header code containing all system extensions definitions. + +## IMPORTED target * `PHP::SystemExtensions` + Interface library target with all required compile definitions (`-D`). -## Usage: +## Basic usage -Include the module: +Targets that require some system extensions can link to `PHP::SystemExtensions`: ```cmake +# CMakeLists.txt include(PHP/SystemExtensions) -``` - -Add `@PHP_SYSTEM_EXTENSIONS@` placeholder to configuration header template: - -```c -# php_config.h -@PHP_SYSTEM_EXTENSIONS@ -``` - -Link targets that require system extensions: - -```cmake -target_link_libraries( ... PHP::SystemExtensions) +target_link_libraries( PHP::SystemExtensions) ``` When some check requires, for example, `_GNU_SOURCE` or some other extensions, @@ -64,10 +56,38 @@ cmake_push_check_state(RESET) cmake_pop_check_state() ``` +## Configuration header code + +To configure header file, add a placeholder to template, for example: + +```c +# config.h.in +@PHP_SYSTEM_EXTENSIONS_CODE@ +``` + +And include module: + +```cmake +# CMakeLists.txt +include(PHP/SystemExtensions) +configure_file(config.h.in config.h) +``` + +## Notes + Compile definitions are not appended to `CMAKE_C_FLAGS` for cleaner build -system: `string(APPEND CMAKE_C_FLAGS " -D=1 ")`. +system. For example, this is not done by this module: + +```cmake +string(APPEND CMAKE_C_FLAGS " -D=1 ")` +``` #]=============================================================================] +# Set configuration header code for consecutive module inclusions, if needed. +if(NOT PHP_SYSTEM_EXTENSIONS_CODE) + get_property(PHP_SYSTEM_EXTENSIONS_CODE GLOBAL PROPERTY _PHP_SYSTEM_EXTENSIONS_CODE) +endif() + include_guard(GLOBAL) include(CheckIncludeFile) @@ -217,7 +237,7 @@ endif() # Configuration header template. ################################################################################ -set(PHP_SYSTEM_EXTENSIONS [[ +set(PHP_SYSTEM_EXTENSIONS_CODE [[ /* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -295,7 +315,18 @@ set(PHP_SYSTEM_EXTENSIONS [[ # cmakedefine _XOPEN_SOURCE @_XOPEN_SOURCE@ #endif]]) -string(CONFIGURE "${PHP_SYSTEM_EXTENSIONS}" PHP_SYSTEM_EXTENSIONS) +string(CONFIGURE "${PHP_SYSTEM_EXTENSIONS_CODE}" PHP_SYSTEM_EXTENSIONS_CODE) + +define_property( + GLOBAL + PROPERTY _PHP_SYSTEM_EXTENSIONS_CODE + BRIEF_DOCS "Configuration header code with system extensions definitions" +) + +set_property( + GLOBAL + PROPERTY _PHP_SYSTEM_EXTENSIONS_CODE "${PHP_SYSTEM_EXTENSIONS_CODE}" +) unset(_XOPEN_SOURCE) diff --git a/cmake/cmake/modules/Packages/LibXml2.cmake b/cmake/cmake/modules/Packages/LibXml2.cmake index 1e7fa0c2b..f2d305d44 100644 --- a/cmake/cmake/modules/Packages/LibXml2.cmake +++ b/cmake/cmake/modules/Packages/LibXml2.cmake @@ -69,10 +69,10 @@ if(NOT LibXml2_FOUND) # Move dependency to PACKAGES_FOUND. block() - get_cmake_property(packagesNotFound PACKAGES_NOT_FOUND) + get_property(packagesNotFound GLOBAL PROPERTY PACKAGES_NOT_FOUND) list(REMOVE_ITEM packagesNotFound LibXml2) set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND packagesNotFound) - get_cmake_property(packagesFound PACKAGES_FOUND) + get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND) set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND LibXml2) endblock() diff --git a/cmake/cmake/platforms/Darwin.cmake b/cmake/cmake/platforms/Darwin.cmake index 966c5042f..0137d9f14 100644 --- a/cmake/cmake/platforms/Darwin.cmake +++ b/cmake/cmake/platforms/Darwin.cmake @@ -25,7 +25,7 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") endif() if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(DARWIN 1 CACHE INTERNAL "Define if the target system is Darwin") + set(DARWIN TRUE) # TODO: This is still needed for shared extensions on macOS, otherwise # undefined symbol errors happen in the linking step when using Clang. diff --git a/cmake/cmake/platforms/Windows.cmake b/cmake/cmake/platforms/Windows.cmake index 8f2c1a14e..2cb589aba 100644 --- a/cmake/cmake/platforms/Windows.cmake +++ b/cmake/cmake/platforms/Windows.cmake @@ -24,20 +24,20 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") # TODO: Update and fix this better. # PHP has custom syslog.h for Windows platform. - set(HAVE_SYSLOG_H 1) + set(HAVE_SYSLOG_H TRUE) # PHP has custom usleep for Windows platform. - set(HAVE_USLEEP 1) + set(HAVE_USLEEP TRUE) # PHP has custom nanosleep for Windows platform. - set(HAVE_NANOSLEEP 1) + set(HAVE_NANOSLEEP TRUE) # PHP supports socketpair by the emulation in win32/sockets.c - set(HAVE_SOCKETPAIR 1) + set(HAVE_SOCKETPAIR TRUE) # PHP has unconditional getaddrinfo() support on Windows for now. - set(HAVE_GETADDRINFO 1) + set(HAVE_GETADDRINFO TRUE) - set(HAVE_NICE 1) - set(HAVE_FNMATCH 1) + set(HAVE_NICE TRUE) + set(HAVE_FNMATCH TRUE) endif() diff --git a/cmake/ext/CMakeLists.txt b/cmake/ext/CMakeLists.txt index 266b70282..dd7f15ead 100644 --- a/cmake/ext/CMakeLists.txt +++ b/cmake/ext/CMakeLists.txt @@ -132,7 +132,7 @@ foreach(extension IN LISTS extensions) list(POP_BACK CMAKE_MESSAGE_CONTEXT) endforeach() -get_cmake_property(extensions PHP_EXTENSIONS) +get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) list(REVERSE extensions) set_property(GLOBAL PROPERTY PHP_EXTENSIONS ${extensions}) diff --git a/cmake/ext/bcmath/CMakeLists.txt b/cmake/ext/bcmath/CMakeLists.txt index a7df3f6c6..9d6231867 100644 --- a/cmake/ext/bcmath/CMakeLists.txt +++ b/cmake/ext/bcmath/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_BCMATH "Enable the bcmath extension" OFF) +option(EXT_BCMATH "Enable the bcmath extension") add_feature_info( "ext/bcmath" @@ -82,8 +82,8 @@ target_sources( libbcmath/src/zero.c ) -target_compile_definitions(php_bcmath PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_bcmath PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) -set(HAVE_BCMATH 1) +set(HAVE_BCMATH TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/bz2/CMakeLists.txt b/cmake/ext/bz2/CMakeLists.txt index b50ad90d1..79f20c7ef 100644 --- a/cmake/ext/bz2/CMakeLists.txt +++ b/cmake/ext/bz2/CMakeLists.txt @@ -30,7 +30,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_BZ2 "Enable the bz2 extension" OFF) +option(EXT_BZ2 "Enable the bz2 extension") add_feature_info( "ext/bz2" @@ -95,6 +95,6 @@ if(TARGET BZip2::BZip2) endif() endif() -set(HAVE_BZ2 1) +set(HAVE_BZ2 TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/calendar/CMakeLists.txt b/cmake/ext/calendar/CMakeLists.txt index 581abb749..ea0fb2568 100644 --- a/cmake/ext/calendar/CMakeLists.txt +++ b/cmake/ext/calendar/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_CALENDAR "Enable the calendar extension" OFF) +option(EXT_CALENDAR "Enable the calendar extension") add_feature_info( "ext/calendar" @@ -68,6 +68,6 @@ target_sources( julian.c ) -set(HAVE_CALENDAR 1) +set(HAVE_CALENDAR TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/com_dotnet/CMakeLists.txt b/cmake/ext/com_dotnet/CMakeLists.txt index 67f4dd805..078f1c22a 100644 --- a/cmake/ext/com_dotnet/CMakeLists.txt +++ b/cmake/ext/com_dotnet/CMakeLists.txt @@ -84,13 +84,13 @@ target_sources( target_compile_definitions( php_com_dotnet PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) target_link_libraries(php_com_dotnet PRIVATE oleaut32) check_include_file(mscoree.h HAVE_MSCOREE_H) -set(HAVE_COM_DOTNET 1) +set(HAVE_COM_DOTNET TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/ctype/CMakeLists.txt b/cmake/ext/ctype/CMakeLists.txt index c648cd3ef..6c3b8e2df 100644 --- a/cmake/ext/ctype/CMakeLists.txt +++ b/cmake/ext/ctype/CMakeLists.txt @@ -62,6 +62,6 @@ target_sources( ctype.stub.php ) -set(HAVE_CTYPE 1) +set(HAVE_CTYPE TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/curl/CMakeLists.txt b/cmake/ext/curl/CMakeLists.txt index 1aa03f349..ec1cdc86e 100644 --- a/cmake/ext/curl/CMakeLists.txt +++ b/cmake/ext/curl/CMakeLists.txt @@ -32,7 +32,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_CURL "Enable the curl extension" OFF) +option(EXT_CURL "Enable the curl extension") add_feature_info( "ext/curl" @@ -180,6 +180,6 @@ if(TARGET CURL::libcurl) endif() endif() -set(HAVE_CURL 1) +set(HAVE_CURL TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/date/CMakeLists.txt b/cmake/ext/date/CMakeLists.txt index 4901e46ec..cf1afbddb 100644 --- a/cmake/ext/date/CMakeLists.txt +++ b/cmake/ext/date/CMakeLists.txt @@ -66,13 +66,13 @@ target_compile_options( target_compile_definitions( php_date PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 - HAVE_TIMELIB_CONFIG_H=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE + HAVE_TIMELIB_CONFIG_H # The timelib uses C99 strtoll() function conditionally. HAVE_STRTOLL ) -set(HAVE_TIMELIB_CONFIG_H 1) +set(HAVE_TIMELIB_CONFIG_H TRUE) message(STATUS "Creating ext/date/lib/timelib_config.h") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lib/timelib_config.h [[ diff --git a/cmake/ext/dba/CMakeLists.txt b/cmake/ext/dba/CMakeLists.txt index e6ac8bc89..4e442aab7 100644 --- a/cmake/ext/dba/CMakeLists.txt +++ b/cmake/ext/dba/CMakeLists.txt @@ -117,7 +117,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_DBA "Enable the dba extension" OFF) +option(EXT_DBA "Enable the dba extension") add_feature_info( "ext/dba" EXT_DBA @@ -327,14 +327,14 @@ target_sources( dba.stub.php ) -target_compile_definitions(php_dba PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_dba PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) ################################################################################ # Constant databases (cdb). ################################################################################ if(EXT_DBA_CDB) target_sources(php_dba PRIVATE dba_cdb.c) - set(DBA_CDB 1) + set(DBA_CDB TRUE) if(EXT_DBA_CDB_EXTERNAL) find_package(Cdb) @@ -366,7 +366,7 @@ if(EXT_DBA_CDB) libcdb/cdb_make.c libcdb/uint32.c ) - set(DBA_CDB_BUILTIN 1) + set(DBA_CDB_BUILTIN TRUE) endif() endif() @@ -412,27 +412,27 @@ if(EXT_DBA_DB) if(BerkeleyDB_DB1_INCLUDE_DIR) set(DB1_INCLUDE_FILE "") - set(DBA_DB1 1) + set(DBA_DB1 TRUE) set(DB1_VERSION "Berkeley DB 1.85 emulation in DB") target_sources(php_dba PRIVATE dba_db1.c) endif() if(BerkeleyDB_VERSION VERSION_LESS_EQUAL 1 AND NOT EXT_DBA_DB1) set(DB1_INCLUDE_FILE "") - set(DBA_DB1 1) + set(DBA_DB1 TRUE) set(DB1_VERSION "Unknown DB1") target_sources(php_dba PRIVATE dba_db1.c) elseif(BerkeleyDB_VERSION VERSION_LESS_EQUAL 2) set(DB2_INCLUDE_FILE "") - set(DBA_DB2 1) + set(DBA_DB2 TRUE) target_sources(php_dba PRIVATE dba_db2.c) elseif(BerkeleyDB_VERSION VERSION_LESS_EQUAL 3) set(DB3_INCLUDE_FILE "") - set(DBA_DB3 1) + set(DBA_DB3 TRUE) target_sources(php_dba PRIVATE dba_db3.c) else() set(DB4_INCLUDE_FILE "") - set(DBA_DB4 1) + set(DBA_DB4 TRUE) target_sources(php_dba PRIVATE dba_db4.c) endif() endif() @@ -465,7 +465,7 @@ if(EXT_DBA_DBM) target_sources(php_dba PRIVATE dba_dbm.c) set(DBM_INCLUDE_FILE "") - set(DBA_DBM 1) + set(DBA_DBM TRUE) set(DBM_VERSION "${Dbm_IMPLEMENTATION}") endif() @@ -480,7 +480,7 @@ if(EXT_DBA_FLATFILE) libflatfile/flatfile.c ) - set(DBA_FLATFILE 1) + set(DBA_FLATFILE TRUE) endif() ################################################################################ @@ -508,7 +508,7 @@ if(EXT_DBA_GDBM) target_sources(php_dba PRIVATE dba_gdbm.c) set(GDBM_INCLUDE_FILE "") - set(DBA_GDBM 1) + set(DBA_GDBM TRUE) endif() ################################################################################ @@ -522,7 +522,7 @@ if(EXT_DBA_INIFILE) libinifile/inifile.c ) - set(DBA_INIFILE 1) + set(DBA_INIFILE TRUE) endif() ################################################################################ @@ -542,7 +542,7 @@ if(EXT_DBA_LMDB) target_sources(php_dba PRIVATE dba_lmdb.c) set(LMDB_INCLUDE_FILE "") - set(DBA_LMDB 1) + set(DBA_LMDB TRUE) endif() ################################################################################ @@ -573,7 +573,7 @@ if(EXT_DBA_NDBM) target_sources(php_dba PRIVATE dba_ndbm.c) set(NDBM_INCLUDE_FILE "") - set(DBA_NDBM 1) + set(DBA_NDBM TRUE) endif() ################################################################################ @@ -593,7 +593,7 @@ if(EXT_DBA_QDBM AND NOT EXT_DBA_DBM AND NOT EXT_DBA_GDBM) target_sources(php_dba PRIVATE dba_qdbm.c) set(QDBM_INCLUDE_FILE "") - set(DBA_QDBM 1) + set(DBA_QDBM TRUE) endif() ################################################################################ @@ -613,9 +613,9 @@ if(EXT_DBA_TCADB) target_sources(php_dba PRIVATE dba_tcadb.c) set(TCADB_INCLUDE_FILE "") - set(DBA_TCADB 1) + set(DBA_TCADB TRUE) endif() -set(HAVE_DBA 1) +set(HAVE_DBA TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/dl_test/CMakeLists.txt b/cmake/ext/dl_test/CMakeLists.txt index 0a467dc65..dff82804d 100644 --- a/cmake/ext/dl_test/CMakeLists.txt +++ b/cmake/ext/dl_test/CMakeLists.txt @@ -23,7 +23,7 @@ project( include(FeatureSummary) -option(EXT_DL_TEST "Enable the dl_test extension" OFF) +option(EXT_DL_TEST "Enable the dl_test extension") add_feature_info( "ext/dl_test" @@ -47,7 +47,7 @@ target_sources( target_compile_definitions( php_dl_test PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE # TODO: PHP_DL_TEST_EXPORTS is currently unused. $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>:PHP_DL_TEST_EXPORTS> ) diff --git a/cmake/ext/dom/CMakeLists.txt b/cmake/ext/dom/CMakeLists.txt index 0e9d29155..0b36c24b8 100644 --- a/cmake/ext/dom/CMakeLists.txt +++ b/cmake/ext/dom/CMakeLists.txt @@ -106,6 +106,6 @@ target_link_libraries(php_dom PRIVATE LibXml2::LibXml2) add_dependencies(php_dom php_libxml php_random) -set(HAVE_DOM 1) +set(HAVE_DOM TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/enchant/CMakeLists.txt b/cmake/ext/enchant/CMakeLists.txt index 5f1205873..60c650682 100644 --- a/cmake/ext/enchant/CMakeLists.txt +++ b/cmake/ext/enchant/CMakeLists.txt @@ -29,7 +29,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_ENCHANT "Enable the enchant extension" OFF) +option(EXT_ENCHANT "Enable the enchant extension") add_feature_info( "ext/enchant" @@ -90,6 +90,6 @@ endif() target_link_libraries(php_enchant PRIVATE Enchant::Enchant) -set(HAVE_ENCHANT 1) +set(HAVE_ENCHANT TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/exif/CMakeLists.txt b/cmake/ext/exif/CMakeLists.txt index dfcb25cde..e513d24c9 100644 --- a/cmake/ext/exif/CMakeLists.txt +++ b/cmake/ext/exif/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_EXIF "Enable the exif extension" OFF) +option(EXT_EXIF "Enable the exif extension") add_feature_info( "ext/exif" @@ -61,7 +61,7 @@ target_sources( exif.stub.php ) -target_compile_definitions(php_exif PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_exif PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) # Exif extension optionally depends on the mbstring extension when decoding # multibyte data in EXIF tags. @@ -69,6 +69,6 @@ if(EXT_MBSTRING) add_dependencies(php_exif php_mbstring) endif() -set(HAVE_EXIF 1) +set(HAVE_EXIF TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/ffi/CMakeLists.txt b/cmake/ext/ffi/CMakeLists.txt index 4b6605246..33db14135 100644 --- a/cmake/ext/ffi/CMakeLists.txt +++ b/cmake/ext/ffi/CMakeLists.txt @@ -32,7 +32,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_FFI "Enable the ffi extension" OFF) +option(EXT_FFI "Enable the ffi extension") add_feature_info( "ext/ffi" @@ -66,7 +66,7 @@ target_sources( ffi.stub.php ) -target_compile_definitions(php_ffi PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_ffi PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(FFI 3.0.11) set_package_properties( @@ -101,6 +101,6 @@ if(TARGET FFI::FFI) cmake_pop_check_state() endif() -set(HAVE_FFI 1) +set(HAVE_FFI TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/filter/CMakeLists.txt b/cmake/ext/filter/CMakeLists.txt index fc347f46b..45c6f5b37 100644 --- a/cmake/ext/filter/CMakeLists.txt +++ b/cmake/ext/filter/CMakeLists.txt @@ -68,6 +68,6 @@ target_sources( php_filter.h ) -target_compile_definitions(php_filter PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_filter PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) add_dependencies(php_filter php_pcre) diff --git a/cmake/ext/ftp/CMakeLists.txt b/cmake/ext/ftp/CMakeLists.txt index c37dfc2da..ce4c7ee70 100644 --- a/cmake/ext/ftp/CMakeLists.txt +++ b/cmake/ext/ftp/CMakeLists.txt @@ -38,7 +38,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_FTP "Enable the ftp extension" OFF) +option(EXT_FTP "Enable the ftp extension") add_feature_info( "ext/ftp" @@ -92,7 +92,7 @@ if(EXT_FTP_SSL OR EXT_OPENSSL) target_link_libraries(php_ftp PRIVATE OpenSSL::SSL) - set(HAVE_FTP_SSL 1) + set(HAVE_FTP_SSL TRUE) endif() add_feature_info( @@ -101,6 +101,6 @@ add_feature_info( "FTP over SSL support" ) -set(HAVE_FTP 1) +set(HAVE_FTP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/gd/CMakeLists.txt b/cmake/ext/gd/CMakeLists.txt index 418f38a3c..cf8b9e8e2 100644 --- a/cmake/ext/gd/CMakeLists.txt +++ b/cmake/ext/gd/CMakeLists.txt @@ -83,7 +83,7 @@ include(FeatureSummary) include(PHP/CheckCompilerFlag) include(PHP/SearchLibraries) -option(EXT_GD "Enable the gd extension" OFF) +option(EXT_GD "Enable the gd extension") add_feature_info( "ext/gd" @@ -284,12 +284,12 @@ if(NOT EXT_GD_EXTERNAL) libgd/wbmp.h ) - set(HAVE_GD_BUNDLED 1) + set(HAVE_GD_BUNDLED TRUE) # With bundled GD library these are always available. - set(HAVE_GD_PNG 1) - set(HAVE_GD_BMP 1) - set(HAVE_GD_TGA 1) + set(HAVE_GD_PNG TRUE) + set(HAVE_GD_BMP TRUE) + set(HAVE_GD_TGA TRUE) target_compile_definitions( php_gd @@ -338,7 +338,7 @@ if(NOT EXT_GD_EXTERNAL) target_link_libraries(php_gd PRIVATE PNG::PNG) - set(HAVE_LIBPNG 1) + set(HAVE_LIBPNG TRUE) if(EXT_GD_AVIF) find_package(libavif 0.8.2) @@ -351,8 +351,8 @@ if(NOT EXT_GD_EXTERNAL) target_link_libraries(php_gd PRIVATE libavif::libavif) - set(HAVE_LIBAVIF 1) - set(HAVE_GD_AVIF 1) + set(HAVE_LIBAVIF TRUE) + set(HAVE_GD_AVIF TRUE) endif() if(EXT_GD_WEBP) @@ -366,8 +366,8 @@ if(NOT EXT_GD_EXTERNAL) target_link_libraries(php_gd PRIVATE WebP::WebP) - set(HAVE_LIBWEBP 1) - set(HAVE_GD_WEBP 1) + set(HAVE_LIBWEBP TRUE) + set(HAVE_GD_WEBP TRUE) endif() if(EXT_GD_JPEG) @@ -381,8 +381,8 @@ if(NOT EXT_GD_EXTERNAL) target_link_libraries(php_gd PRIVATE JPEG::JPEG) - set(HAVE_LIBJPEG 1) - set(HAVE_GD_JPG 1) + set(HAVE_LIBJPEG TRUE) + set(HAVE_GD_JPG TRUE) endif() if(EXT_GD_XPM) @@ -396,8 +396,8 @@ if(NOT EXT_GD_EXTERNAL) target_link_libraries(php_gd PRIVATE XPM::XPM) - set(HAVE_XPM 1) - set(HAVE_GD_XPM 1) + set(HAVE_XPM TRUE) + set(HAVE_GD_XPM TRUE) endif() if(EXT_GD_FREETYPE) @@ -411,13 +411,13 @@ if(NOT EXT_GD_EXTERNAL) target_link_libraries(php_gd PRIVATE Freetype::Freetype) - set(HAVE_LIBFREETYPE 1) - set(HAVE_GD_FREETYPE 1) + set(HAVE_LIBFREETYPE TRUE) + set(HAVE_GD_FREETYPE TRUE) endif() if(EXT_GD_JIS) - set(JISX0208 1) - set(USE_GD_JISX0208 1) + set(JISX0208 TRUE) + set(USE_GD_JISX0208 TRUE) endif() # Do sanity check when all required packages are found. diff --git a/cmake/ext/gettext/CMakeLists.txt b/cmake/ext/gettext/CMakeLists.txt index 73b1ee94b..fafb429b7 100644 --- a/cmake/ext/gettext/CMakeLists.txt +++ b/cmake/ext/gettext/CMakeLists.txt @@ -30,7 +30,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_GETTEXT "Enable the gettext extension" OFF) +option(EXT_GETTEXT "Enable the gettext extension") add_feature_info( "ext/gettext" @@ -84,7 +84,7 @@ if(TARGET Intl::Intl) ) endif() - set(HAVE_LIBINTL 1) + set(HAVE_LIBINTL TRUE) check_library_exists(Intl::Intl ngettext "" HAVE_NGETTEXT) check_library_exists(Intl::Intl dngettext "" HAVE_DNGETTEXT) diff --git a/cmake/ext/gmp/CMakeLists.txt b/cmake/ext/gmp/CMakeLists.txt index f1b539595..0ab88d398 100644 --- a/cmake/ext/gmp/CMakeLists.txt +++ b/cmake/ext/gmp/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_GMP "Enable the gmp extension" OFF) +option(EXT_GMP "Enable the gmp extension") add_feature_info( "ext/gmp" @@ -65,7 +65,7 @@ target_sources( php_gmp_int.h ) -target_compile_definitions(php_gmp PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_gmp PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(GMP 4.2) set_package_properties( @@ -79,6 +79,6 @@ target_link_libraries(php_gmp PUBLIC GMP::GMP) add_dependencies(php_gmp php_random) -set(HAVE_GMP 1) +set(HAVE_GMP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/hash/CMakeLists.txt b/cmake/ext/hash/CMakeLists.txt index 15d9b61df..8cec88fe8 100644 --- a/cmake/ext/hash/CMakeLists.txt +++ b/cmake/ext/hash/CMakeLists.txt @@ -30,7 +30,7 @@ add_feature_info( "HASH message digest framework" ) -option(EXT_HASH_MHASH "Enable the mhash support (deprecated as of PHP 8.1)" OFF) +option(EXT_HASH_MHASH "Enable the mhash support (deprecated as of PHP 8.1)") add_feature_info( "ext/hash with mhash" @@ -44,7 +44,7 @@ if(EXT_HASH_MHASH) "Support for mhash in the hash extension is deprecated as of PHP 8.1.0" ) - set(PHP_MHASH_BC 1) + set(PHP_MHASH_BC TRUE) endif() add_library(php_hash STATIC) @@ -96,7 +96,7 @@ target_sources( target_include_directories(php_hash PRIVATE xxhash) if(WORDS_BIGENDIAN) - set(HAVE_SLOW_HASH3 1) + set(HAVE_SLOW_HASH3 TRUE) message(WARNING "Using slow SHA3 implementation on bigendian") else() block() @@ -143,7 +143,7 @@ else() KeccakP200_excluded KeccakP400_excluded KeccakP800_excluded - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) endif() diff --git a/cmake/ext/iconv/CMakeLists.txt b/cmake/ext/iconv/CMakeLists.txt index 9db56cb17..f8a743921 100644 --- a/cmake/ext/iconv/CMakeLists.txt +++ b/cmake/ext/iconv/CMakeLists.txt @@ -74,7 +74,7 @@ target_sources( target_compile_definitions( php_iconv PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$:PHP_ICONV_EXPORTS> ) @@ -102,7 +102,7 @@ if(TARGET Iconv::Iconv) check_library_exists(Iconv::Iconv libiconv "" HAVE_LIBICONV) if(HAVE_LIBICONV) - set(ICONV_ALIASED_LIBICONV 1) + set(ICONV_ALIASED_LIBICONV TRUE) else() check_library_exists(Iconv::Iconv iconv "" _HAVE_ICONV) endif() @@ -126,7 +126,7 @@ if(TARGET Iconv::Iconv) cmake_pop_check_state() if(_have_gnu_libiconv) message(CHECK_PASS "GNU libiconv") - set(HAVE_LIBICONV 1) + set(HAVE_LIBICONV TRUE) set(PHP_ICONV_IMPL "libiconv") endif() @@ -251,6 +251,6 @@ if(TARGET Iconv::Iconv) endif() endif() -set(HAVE_ICONV 1) +set(HAVE_ICONV TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/imap/CMakeLists.txt b/cmake/ext/imap/CMakeLists.txt index 3ba0816e5..0b65b12dd 100644 --- a/cmake/ext/imap/CMakeLists.txt +++ b/cmake/ext/imap/CMakeLists.txt @@ -43,7 +43,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_IMAP "Enable the imap extension" OFF) +option(EXT_IMAP "Enable the imap extension") add_feature_info( "ext/imap" @@ -92,7 +92,7 @@ target_sources( php_imap.stub.php ) -target_compile_definitions(php_imap PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_imap PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(Cclient) set_package_properties( @@ -135,7 +135,7 @@ if(TARGET Cclient::Cclient) target_link_libraries(php_imap PRIVATE Kerberos::Krb5 Kerberos::GSSAPI) if(Kerberos_FOUND) - set(HAVE_IMAP_KRB 1) + set(HAVE_IMAP_KRB TRUE) message(CHECK_PASS "yes") else() message(CHECK_FAIL "failed") @@ -176,7 +176,7 @@ if(TARGET Cclient::Cclient) target_link_libraries(php_imap PRIVATE OpenSSL::SSL) if(OpenSSL_FOUND) - set(HAVE_IMAP_SSL 1) + set(HAVE_IMAP_SSL TRUE) message(CHECK_PASS "yes") else() message(CHECK_FAIL "failed") @@ -195,6 +195,6 @@ if(TARGET Cclient::Cclient) endblock() endif() -set(HAVE_IMAP 1) +set(HAVE_IMAP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/intl/CMakeLists.txt b/cmake/ext/intl/CMakeLists.txt index d98cfcb3b..eabe5fb0c 100644 --- a/cmake/ext/intl/CMakeLists.txt +++ b/cmake/ext/intl/CMakeLists.txt @@ -30,7 +30,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/CheckCompilerFlag) -option(EXT_INTL "Enable the intl extension" OFF) +option(EXT_INTL "Enable the intl extension") add_feature_info( "ext/intl" @@ -176,7 +176,7 @@ target_compile_definitions( __STDC_LIMIT_MACROS __STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$:UNISTR_FROM_CHAR_EXPLICIT=explicit;UNISTR_FROM_STRING_EXPLICIT=explicit> ) diff --git a/cmake/ext/json/CMakeLists.txt b/cmake/ext/json/CMakeLists.txt index 8cf920ac1..57e2133b4 100644 --- a/cmake/ext/json/CMakeLists.txt +++ b/cmake/ext/json/CMakeLists.txt @@ -38,7 +38,7 @@ target_sources( php_json.h ) -target_compile_definitions(php_json PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_json PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) if(BISON_FOUND) bison_target( @@ -65,7 +65,7 @@ if(RE2C_FOUND) endif() if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(HAVE_JSON 1) + set(HAVE_JSON TRUE) endif() configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/ldap/CMakeLists.txt b/cmake/ext/ldap/CMakeLists.txt index 11e66f90c..e6b7879a3 100644 --- a/cmake/ext/ldap/CMakeLists.txt +++ b/cmake/ext/ldap/CMakeLists.txt @@ -39,7 +39,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_LDAP "Enable the ldap extension" OFF) +option(EXT_LDAP "Enable the ldap extension") add_feature_info( "ext/ldap" @@ -80,7 +80,7 @@ target_sources( ldap.stub.php ) -target_compile_definitions(php_ldap PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_ldap PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(LDAP) set_package_properties( @@ -152,9 +152,9 @@ if(EXT_LDAP_SASL) target_link_libraries(php_ldap PRIVATE SASL::SASL) - set(HAVE_LDAP_SASL 1) + set(HAVE_LDAP_SASL TRUE) endif() -set(HAVE_LDAP 1) +set(HAVE_LDAP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/libxml/CMakeLists.txt b/cmake/ext/libxml/CMakeLists.txt index bf715c4b7..14ff8433f 100644 --- a/cmake/ext/libxml/CMakeLists.txt +++ b/cmake/ext/libxml/CMakeLists.txt @@ -55,7 +55,7 @@ target_sources( target_compile_definitions( php_libxml PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$:LIBXML_STATIC;LIBXML_STATIC_FOR_DLL> ) @@ -79,6 +79,6 @@ endif() target_link_libraries(php_libxml PUBLIC LibXml2::LibXml2) -set(HAVE_LIBXML 1) +set(HAVE_LIBXML TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/mbstring/CMakeLists.txt b/cmake/ext/mbstring/CMakeLists.txt index 78eab683e..581393a79 100644 --- a/cmake/ext/mbstring/CMakeLists.txt +++ b/cmake/ext/mbstring/CMakeLists.txt @@ -37,7 +37,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_MBSTRING "Enable the mbstring extension" OFF) +option(EXT_MBSTRING "Enable the mbstring extension") add_feature_info( "ext/mbstring" @@ -187,21 +187,21 @@ if(EXT_MBSTRING_MBREGEX) else() message(CHECK_FAIL "yes") - set(PHP_ONIG_BAD_KOI8_ENTRY 1) + set(PHP_ONIG_BAD_KOI8_ENTRY TRUE) endif() endif() target_compile_definitions( php_mbstring PRIVATE - $<$>:ONIG_ESCAPE_UCHAR_COLLISION=1> + $<$>:ONIG_ESCAPE_UCHAR_COLLISION> $<$>:UChar=OnigUChar> # TODO: On Windows, the Oniguruma library is only usable as a static # library ATM, code change required to link with a DLL. $<$:ONIG_EXTERN=extern> ) - set(HAVE_MBREGEX 1) + set(HAVE_MBREGEX TRUE) target_sources( php_mbstring @@ -215,7 +215,7 @@ if(EXT_MBSTRING_MBREGEX) ) endif() -target_compile_definitions(php_mbstring PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_mbstring PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) target_include_directories( php_mbstring @@ -225,6 +225,6 @@ target_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libmbfl/mbfl ) -set(HAVE_MBSTRING 1) +set(HAVE_MBSTRING TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/mysqli/CMakeLists.txt b/cmake/ext/mysqli/CMakeLists.txt index b1fc6a0fb..4758f7f29 100644 --- a/cmake/ext/mysqli/CMakeLists.txt +++ b/cmake/ext/mysqli/CMakeLists.txt @@ -49,7 +49,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/Set) -option(EXT_MYSQLI "Enable the mysqli extension" OFF) +option(EXT_MYSQLI "Enable the mysqli extension") add_feature_info( "ext/mysqli" @@ -118,7 +118,7 @@ target_sources( add_dependencies(php_mysqli php_mysqlnd php_spl) -target_compile_definitions(php_mysqli PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_mysqli PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) if(EXT_MYSQL_SOCKET) if(EXT_MYSQL_SOCKET_PATH) diff --git a/cmake/ext/mysqlnd/CMakeLists.txt b/cmake/ext/mysqlnd/CMakeLists.txt index 4dc013524..53c559387 100644 --- a/cmake/ext/mysqlnd/CMakeLists.txt +++ b/cmake/ext/mysqlnd/CMakeLists.txt @@ -53,7 +53,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_MYSQLND "Enable the mysqlnd extension" OFF) +option(EXT_MYSQLND "Enable the mysqlnd extension") add_feature_info( "ext/mysqlnd" @@ -159,7 +159,7 @@ target_sources( php_mysqlnd.h ) -target_compile_definitions(php_mysqlnd PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_mysqlnd PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) target_link_libraries( php_mysqlnd @@ -178,10 +178,10 @@ if(EXT_MYSQLND_COMPRESSION) target_link_libraries(php_mysqlnd PRIVATE ZLIB::ZLIB) - set(MYSQLND_COMPRESSION_ENABLED 1) + set(MYSQLND_COMPRESSION_ENABLED TRUE) endif() -set(MYSQLND_SSL_SUPPORTED 1) +set(MYSQLND_SSL_SUPPORTED TRUE) if( ( @@ -203,7 +203,7 @@ if( target_link_libraries(php_mysqlnd PRIVATE OpenSSL::Crypto) endif() - set(MYSQLND_HAVE_SSL 1) + set(MYSQLND_HAVE_SSL TRUE) add_dependencies(php_mysqlnd php_hash) endif() diff --git a/cmake/ext/oci8/CMakeLists.txt b/cmake/ext/oci8/CMakeLists.txt index 9dd49ec16..b5031e8c2 100644 --- a/cmake/ext/oci8/CMakeLists.txt +++ b/cmake/ext/oci8/CMakeLists.txt @@ -47,7 +47,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_OCI8 "Enable the oci8 extension" OFF) +option(EXT_OCI8 "Enable the oci8 extension") add_feature_info( "ext/oci8" @@ -146,6 +146,6 @@ cmake_language( CALL _php_oci8_notice ) -set(HAVE_OCI8 1) +set(HAVE_OCI8 TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/odbc/CMakeLists.txt b/cmake/ext/odbc/CMakeLists.txt index b646858ab..5e2534ef7 100644 --- a/cmake/ext/odbc/CMakeLists.txt +++ b/cmake/ext/odbc/CMakeLists.txt @@ -290,7 +290,7 @@ target_sources( php_odbc.c ) -target_compile_definitions(php_odbc PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_odbc PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) if(NOT EXT_ODBC_TYPE STREQUAL "auto") set(ODBC_USE_DRIVER "${EXT_ODBC_TYPE}") @@ -348,44 +348,44 @@ else() endif() if(PHP_ODBC_TYPE STREQUAL "adabas") - set(HAVE_ADABAS 1) + set(HAVE_ADABAS TRUE) elseif(PHP_ODBC_TYPE STREQUAL "dbmaker") - set(HAVE_DBMAKER 1) + set(HAVE_DBMAKER TRUE) elseif(PHP_ODBC_TYPE MATCHES "^(empress|empress-bcs)$") - set(HAVE_EMPRESS 1) + set(HAVE_EMPRESS TRUE) elseif(PHP_ODBC_TYPE STREQUAL "esoob") - set(HAVE_ESOOB 1) + set(HAVE_ESOOB TRUE) elseif(PHP_ODBC_TYPE STREQUAL "ibm-db2") - set(HAVE_IBMDB2 1) + set(HAVE_IBMDB2 TRUE) elseif(PHP_ODBC_TYPE STREQUAL "iodbc") - set(HAVE_IODBC 1) + set(HAVE_IODBC TRUE) elseif(PHP_ODBC_TYPE STREQUAL "sapdb") - set(HAVE_SAPDB 1) + set(HAVE_SAPDB TRUE) elseif(PHP_ODBC_TYPE STREQUAL "solid") # Set based on the Solid version: if(ODBC_LIBRARY MATCHES [[23\.(a|so)$]]) - set(HAVE_SOLID 1) + set(HAVE_SOLID TRUE) elseif(ODBC_LIBRARY MATCHES [[30\.(a|so)$]]) - set(HAVE_SOLID_30 1) + set(HAVE_SOLID_30 TRUE) else() - set(HAVE_SOLID_35 1) + set(HAVE_SOLID_35 TRUE) endif() # Additional configuration for using obsolete header on obsolete # systems. if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(SS_LINUX 1) + set(SS_LINUX TRUE) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set(SS_FBX 1) + set(SS_FBX TRUE) endif() elseif(PHP_ODBC_TYPE STREQUAL "unixODBC") - set(HAVE_UNIXODBC 1) + set(HAVE_UNIXODBC TRUE) elseif(PHP_ODBC_TYPE STREQUAL "custom-odbc") - set(HAVE_CODBC 1) + set(HAVE_CODBC TRUE) endif() if(NOT EXT_ODBC_TYPE MATCHES "^(dbmaker|solid)$") - set(HAVE_SQLDATASOURCES 1) + set(HAVE_SQLDATASOURCES TRUE) endif() if(TARGET ODBC::ODBC) @@ -462,6 +462,6 @@ if(EXT_ODBC_VERSION) set(ODBCVER "${EXT_ODBC_VERSION}") endif() -set(HAVE_UODBC 1) +set(HAVE_UODBC TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/opcache/CMakeLists.txt b/cmake/ext/opcache/CMakeLists.txt index b6302ec12..9949fe791 100644 --- a/cmake/ext/opcache/CMakeLists.txt +++ b/cmake/ext/opcache/CMakeLists.txt @@ -116,10 +116,10 @@ set_target_properties( PHP_ZEND_EXTENSION TRUE ) -target_compile_definitions(php_opcache PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_opcache PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) if(EXT_OPCACHE_HUGE_CODE_PAGES) - set(HAVE_HUGE_CODE_PAGES 1) + set(HAVE_HUGE_CODE_PAGES TRUE) endif() ################################################################################ @@ -138,7 +138,7 @@ if(EXT_OPCACHE_JIT) WARNING "JIT is not supported by target architecture ${CMAKE_SYSTEM_PROCESSOR}" ) - set_property(CACHE EXT_OPCACHE_JIT PROPERTY VALUE 0) + set_property(CACHE EXT_OPCACHE_JIT PROPERTY VALUE OFF) elseif( CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64.*$" @@ -148,7 +148,7 @@ if(EXT_OPCACHE_JIT) WARNING "JIT is not supported on Apple Silicon with thread safety enabled" ) - set_property(CACHE EXT_OPCACHE_JIT PROPERTY VALUE 0) + set_property(CACHE EXT_OPCACHE_JIT PROPERTY VALUE OFF) endif() endif() @@ -261,10 +261,10 @@ if(EXT_OPCACHE_JIT) target_link_libraries(php_opcache PRIVATE Capstone::Capstone) - set(HAVE_CAPSTONE 1) + set(HAVE_CAPSTONE TRUE) endif() - set(HAVE_JIT 1) + set(HAVE_JIT TRUE) endif() add_feature_info( diff --git a/cmake/ext/opcache/cmake/CheckSHM.cmake b/cmake/ext/opcache/cmake/CheckSHM.cmake index b508d9caf..fda17cddd 100644 --- a/cmake/ext/opcache/cmake/CheckSHM.cmake +++ b/cmake/ext/opcache/cmake/CheckSHM.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckSHM + Check for shared memory (SHM) operations functions and required libraries. If no SHM support is found, a FATAL error is thrown. @@ -6,15 +8,21 @@ If no SHM support is found, a FATAL error is thrown. ## Cache variables * `HAVE_SHM_IPC` + Whether SysV IPC SHM support is available. + * `HAVE_SHM_MMAP_ANON` + Whether `mmap(MAP_ANON)` SHM support is found. + * `HAVE_SHM_MMAP_POSIX` + Whether POSIX `mmap()` SHM support is found. IMPORTED target: * `PHP::CheckSHMLibrary` + If there is additional library to be linked for using SHM POSIX functions. #]=============================================================================] diff --git a/cmake/ext/openssl/CMakeLists.txt b/cmake/ext/openssl/CMakeLists.txt index 6ce78a7ee..af81dc160 100644 --- a/cmake/ext/openssl/CMakeLists.txt +++ b/cmake/ext/openssl/CMakeLists.txt @@ -56,7 +56,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_OPENSSL "Enable the openssl extension" OFF) +option(EXT_OPENSSL "Enable the openssl extension") add_feature_info( "ext/openssl" @@ -171,10 +171,10 @@ if(TARGET OpenSSL::SSL) cmake_pop_check_state() if(EXT_OPENSSL_SYSTEM_CIPHERS) - set(USE_OPENSSL_SYSTEM_CIPHERS 1) + set(USE_OPENSSL_SYSTEM_CIPHERS TRUE) endif() endif() -set(HAVE_OPENSSL 1) +set(HAVE_OPENSSL TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/pcntl/CMakeLists.txt b/cmake/ext/pcntl/CMakeLists.txt index d7425f25d..fcd24df68 100644 --- a/cmake/ext/pcntl/CMakeLists.txt +++ b/cmake/ext/pcntl/CMakeLists.txt @@ -76,7 +76,7 @@ target_sources( php_signal.c ) -target_compile_definitions(php_pcntl PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_pcntl PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) # Check for required functions. block() @@ -114,7 +114,7 @@ cmake_push_check_state(RESET) cmake_pop_check_state() if(HAVE_STRUCT_SIGINFO_T) - target_compile_definitions(php_pcntl PRIVATE HAVE_STRUCT_SIGINFO_T=1) + target_compile_definitions(php_pcntl PRIVATE HAVE_STRUCT_SIGINFO_T) endif() configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/pcre/CMakeLists.txt b/cmake/ext/pcre/CMakeLists.txt index 2ecfc0c0b..731b27571 100644 --- a/cmake/ext/pcre/CMakeLists.txt +++ b/cmake/ext/pcre/CMakeLists.txt @@ -45,7 +45,6 @@ option( EXT_PCRE_EXTERNAL "Use external (system) PCRE library in pcre extension instead of the bundled\ PCRE library that comes with PHP sources" - OFF ) add_feature_info( @@ -78,7 +77,7 @@ target_sources( php_pcre.h ) -target_compile_definitions(php_pcre PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_pcre PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) set(PCRE2_CODE_UNIT_WIDTH 8) @@ -203,7 +202,7 @@ else() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(PCRE2_STATIC 1) + set(PCRE2_STATIC TRUE) endif() target_compile_definitions( @@ -214,12 +213,12 @@ else() HAVE_CONFIG_H ) - set(HAVE_BUNDLED_PCRE 1) + set(HAVE_BUNDLED_PCRE TRUE) message(CHECK_START "Checking whether to enable PCRE JIT support") if(EXT_PCRE_JIT) - set(HAVE_PCRE_JIT_SUPPORT 1) + set(HAVE_PCRE_JIT_SUPPORT TRUE) message(CHECK_PASS "yes") @@ -246,7 +245,7 @@ else() target_compile_definitions( php_pcre PRIVATE - $<$:HAVE_PCRE_VALGRIND_SUPPORT=1> + $<$:HAVE_PCRE_VALGRIND_SUPPORT> ) endif() endif() diff --git a/cmake/ext/pdo_dblib/CMakeLists.txt b/cmake/ext/pdo_dblib/CMakeLists.txt index 20d055301..33c0b7f1f 100644 --- a/cmake/ext/pdo_dblib/CMakeLists.txt +++ b/cmake/ext/pdo_dblib/CMakeLists.txt @@ -29,7 +29,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_PDO_DBLIB "Enable the pdo_dblib extension" OFF) +option(EXT_PDO_DBLIB "Enable the pdo_dblib extension") add_feature_info( "ext/pdo_dblib" @@ -68,7 +68,7 @@ add_dependencies(php_pdo_dblib php_pdo) target_compile_definitions( php_pdo_dblib PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE PDO_DBLIB_FLAVOUR="freetds" ) @@ -88,6 +88,6 @@ set_package_properties( target_link_libraries(php_pdo_dblib PRIVATE FreeTDS::FreeTDS) -set(HAVE_PDO_DBLIB 1) +set(HAVE_PDO_DBLIB TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/pdo_firebird/CMakeLists.txt b/cmake/ext/pdo_firebird/CMakeLists.txt index 1e7852ed1..a010e226d 100644 --- a/cmake/ext/pdo_firebird/CMakeLists.txt +++ b/cmake/ext/pdo_firebird/CMakeLists.txt @@ -29,7 +29,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_PDO_FIREBIRD "Enable the pdo_firebird extension" OFF) +option(EXT_PDO_FIREBIRD "Enable the pdo_firebird extension") add_feature_info( "ext/pdo_firebird" @@ -97,6 +97,6 @@ if(TARGET Firebird::Firebird) endif() endif() -set(HAVE_PDO_FIREBIRD 1) +set(HAVE_PDO_FIREBIRD TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/pdo_mysql/CMakeLists.txt b/cmake/ext/pdo_mysql/CMakeLists.txt index feb3a73f6..455f12ec9 100644 --- a/cmake/ext/pdo_mysql/CMakeLists.txt +++ b/cmake/ext/pdo_mysql/CMakeLists.txt @@ -44,7 +44,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/Set) -option(EXT_PDO_MYSQL "Enable the pdo_mysql extension" OFF) +option(EXT_PDO_MYSQL "Enable the pdo_mysql extension") add_feature_info( "ext/pdo_mysql" @@ -94,7 +94,7 @@ add_dependencies(php_pdo_mysql php_pdo) target_compile_definitions( php_pdo_mysql PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) target_include_directories( diff --git a/cmake/ext/pdo_odbc/CMakeLists.txt b/cmake/ext/pdo_odbc/CMakeLists.txt index 72a7a2004..5c2950571 100644 --- a/cmake/ext/pdo_odbc/CMakeLists.txt +++ b/cmake/ext/pdo_odbc/CMakeLists.txt @@ -87,7 +87,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/Set) -option(EXT_PDO_ODBC "Enable the pdo_odbc extension" OFF) +option(EXT_PDO_ODBC "Enable the pdo_odbc extension") add_feature_info( "ext/pdo_odbc" EXT_PDO_ODBC diff --git a/cmake/ext/pdo_pgsql/CMakeLists.txt b/cmake/ext/pdo_pgsql/CMakeLists.txt index 7f143e015..d44640f82 100644 --- a/cmake/ext/pdo_pgsql/CMakeLists.txt +++ b/cmake/ext/pdo_pgsql/CMakeLists.txt @@ -29,7 +29,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_PDO_PGSQL "Enable the pdo_pgsql extension" OFF) +option(EXT_PDO_PGSQL "Enable the pdo_pgsql extension") add_feature_info( "ext/pdo_pgsql" @@ -95,6 +95,6 @@ if(TARGET PostgreSQL::PostgreSQL) endif() endif() -set(HAVE_PDO_PGSQL 1) +set(HAVE_PDO_PGSQL TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/pdo_sqlite/CMakeLists.txt b/cmake/ext/pdo_sqlite/CMakeLists.txt index 06489c043..e38dc8691 100644 --- a/cmake/ext/pdo_sqlite/CMakeLists.txt +++ b/cmake/ext/pdo_sqlite/CMakeLists.txt @@ -83,7 +83,7 @@ set_package_properties( target_link_libraries(php_pdo_sqlite PRIVATE SQLite::SQLite3) if(TARGET SQLite::SQLite3) - set(HAVE_PDO_SQLITELIB 1) + set(HAVE_PDO_SQLITELIB TRUE) check_library_exists( SQLite::SQLite3 diff --git a/cmake/ext/pgsql/CMakeLists.txt b/cmake/ext/pgsql/CMakeLists.txt index d6f80fc21..eb17ef4d2 100644 --- a/cmake/ext/pgsql/CMakeLists.txt +++ b/cmake/ext/pgsql/CMakeLists.txt @@ -29,7 +29,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_PGSQL "Enable the pgsql extension" OFF) +option(EXT_PGSQL "Enable the pgsql extension") add_feature_info( "ext/pgsql" @@ -65,7 +65,7 @@ target_sources( target_compile_definitions( php_pgsql PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$:PGSQL_EXPORTS> ) @@ -114,6 +114,6 @@ if(TARGET PostgreSQL::PostgreSQL) ) endif() -set(HAVE_PGSQL 1) +set(HAVE_PGSQL TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/phar/CMakeLists.txt b/cmake/ext/phar/CMakeLists.txt index 63f4cccb6..3a5a00d15 100644 --- a/cmake/ext/phar/CMakeLists.txt +++ b/cmake/ext/phar/CMakeLists.txt @@ -77,7 +77,7 @@ target_sources( php_phar.h ) -target_compile_definitions(php_phar PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_phar PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) target_link_options( php_phar diff --git a/cmake/ext/posix/CMakeLists.txt b/cmake/ext/posix/CMakeLists.txt index b965b4b3c..e6904188f 100644 --- a/cmake/ext/posix/CMakeLists.txt +++ b/cmake/ext/posix/CMakeLists.txt @@ -71,7 +71,7 @@ target_sources( posix.stub.php ) -target_compile_definitions(php_posix PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_posix PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) check_symbol_exists(ctermid "stdio.h" HAVE_CTERMID) cmake_push_check_state(RESET) @@ -129,6 +129,6 @@ cmake_push_check_state(RESET) ) cmake_pop_check_state() -set(HAVE_POSIX 1) +set(HAVE_POSIX TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/posix/cmake/CheckTtynameR.cmake b/cmake/ext/posix/cmake/CheckTtynameR.cmake index 9229ca45d..1a3994f47 100644 --- a/cmake/ext/posix/cmake/CheckTtynameR.cmake +++ b/cmake/ext/posix/cmake/CheckTtynameR.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckTtynameR + Check `ttyname_r()`. On Solaris/illumos `ttyname_r()` works only with larger buffers (>= 128), @@ -16,6 +18,7 @@ check_symbol_exists(ttyname_r unistd.h HAVE_TTYNAME_R) ## Cache variables * `HAVE_TTYNAME_R` + Whether `ttyname_r()` works as expected. #]=============================================================================] diff --git a/cmake/ext/pspell/CMakeLists.txt b/cmake/ext/pspell/CMakeLists.txt index 3b4bc30af..18a0224a3 100644 --- a/cmake/ext/pspell/CMakeLists.txt +++ b/cmake/ext/pspell/CMakeLists.txt @@ -29,7 +29,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/CheckCompilerFlag) -option(EXT_PSPELL "Enable the pspell extension" OFF) +option(EXT_PSPELL "Enable the pspell extension") add_feature_info( "ext/pspell" @@ -82,6 +82,6 @@ set_package_properties( target_link_libraries(php_pspell PRIVATE Aspell::Aspell) -set(HAVE_PSPELL 1) +set(HAVE_PSPELL TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/random/CMakeLists.txt b/cmake/ext/random/CMakeLists.txt index 60fb64bb9..8505b466b 100644 --- a/cmake/ext/random/CMakeLists.txt +++ b/cmake/ext/random/CMakeLists.txt @@ -44,7 +44,7 @@ target_sources( php_random.h ) -target_compile_definitions(php_random PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_random PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) check_symbol_exists(arc4random_buf "stdlib.h" HAVE_DECL_ARC4RANDOM_BUF) check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM) diff --git a/cmake/ext/readline/CMakeLists.txt b/cmake/ext/readline/CMakeLists.txt index 19d26d416..877881316 100644 --- a/cmake/ext/readline/CMakeLists.txt +++ b/cmake/ext/readline/CMakeLists.txt @@ -44,7 +44,7 @@ include(CMakePushCheckState) include(FeatureSummary) include(PHP/CheckCompilerFlag) -option(EXT_READLINE "Enable the readline extension (only for CLI-based SAPIs)" OFF) +option(EXT_READLINE "Enable the readline extension (only for CLI-based SAPIs)") add_feature_info( "ext/readline" @@ -141,7 +141,7 @@ if(NOT EXT_READLINE_LIBREADLINE) ) endif() - set(HAVE_LIBEDIT 1) + set(HAVE_LIBEDIT TRUE) else() message( WARNING @@ -208,8 +208,8 @@ else() ) endif() - set(HAVE_HISTORY_LIST 1) - set(HAVE_LIBREADLINE 1) + set(HAVE_HISTORY_LIST TRUE) + set(HAVE_LIBREADLINE TRUE) endif() configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/reflection/CMakeLists.txt b/cmake/ext/reflection/CMakeLists.txt index cc57c8a8b..35b1c49ad 100644 --- a/cmake/ext/reflection/CMakeLists.txt +++ b/cmake/ext/reflection/CMakeLists.txt @@ -31,7 +31,7 @@ target_sources( target_compile_definitions( php_reflection PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) add_dependencies(php_reflection php_random) diff --git a/cmake/ext/session/CMakeLists.txt b/cmake/ext/session/CMakeLists.txt index 1c96ba483..e6bbe0ad4 100644 --- a/cmake/ext/session/CMakeLists.txt +++ b/cmake/ext/session/CMakeLists.txt @@ -95,7 +95,7 @@ target_sources( target_compile_definitions( php_session PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) add_dependencies( @@ -141,10 +141,10 @@ if(EXT_SESSION_MM) target_link_libraries(php_session PUBLIC MM::MM) if(TARGET MM::MM) - set(HAVE_LIBMM 1) + set(HAVE_LIBMM TRUE) endif() endif() -set(HAVE_PHP_SESSION 1) +set(HAVE_PHP_SESSION TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/session/cmake/CheckPreadPwrite.cmake b/cmake/ext/session/cmake/CheckPreadPwrite.cmake index 4111d8f28..db4b3121b 100644 --- a/cmake/ext/session/cmake/CheckPreadPwrite.cmake +++ b/cmake/ext/session/cmake/CheckPreadPwrite.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckPreadPwrite + Check whether `pread()` and `pwrite()` work. Module first checks whether functions are available on the system, and then @@ -14,13 +16,20 @@ check_symbol_exists( unistd.h HAVE_) ## Cache variables * `HAVE_PREAD` - Whether `pread()` is available. + + Whether `pread()` is available. + * `PHP_PREAD_64` - Whether pread64 is default. + + Whether pread64 is default. + * `HAVE_PWRITE` - Whether `pwrite()` is available. + + Whether `pwrite()` is available. + * `PHP_PWRITE_64` - Whether pwrite64 is default. + + Whether pwrite64 is default. #]=============================================================================] include_guard(GLOBAL) @@ -127,7 +136,7 @@ function(_php_check_pread) cmake_pop_check_state() if(PHP_PREAD_64) - set(HAVE_PREAD 1 CACHE INTERNAL "Whether pread() works") + set(HAVE_PREAD TRUE CACHE INTERNAL "Whether pread() works") endif() endif() @@ -234,7 +243,7 @@ function(_php_check_pwrite) cmake_pop_check_state() if(PHP_PWRITE_64) - set(HAVE_PWRITE 1 CACHE INTERNAL "Whether pwrite() works") + set(HAVE_PWRITE TRUE CACHE INTERNAL "Whether pwrite() works") endif() endif() diff --git a/cmake/ext/shmop/CMakeLists.txt b/cmake/ext/shmop/CMakeLists.txt index fc72ae1e3..a8cd4c604 100644 --- a/cmake/ext/shmop/CMakeLists.txt +++ b/cmake/ext/shmop/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_SHMOP "Enable the shmop extension" OFF) +option(EXT_SHMOP "Enable the shmop extension") add_feature_info( "ext/shmop" @@ -61,6 +61,6 @@ target_sources( shmop.stub.php ) -set(HAVE_SHMOP 1) +set(HAVE_SHMOP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/simplexml/CMakeLists.txt b/cmake/ext/simplexml/CMakeLists.txt index 116f51d55..bdfcee8c1 100644 --- a/cmake/ext/simplexml/CMakeLists.txt +++ b/cmake/ext/simplexml/CMakeLists.txt @@ -87,6 +87,6 @@ set_package_properties( target_link_libraries(php_simplexml PRIVATE LibXml2::LibXml2) -set(HAVE_SIMPLEXML 1) +set(HAVE_SIMPLEXML TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/skeleton/CMakeLists.txt.in b/cmake/ext/skeleton/CMakeLists.txt.in index 80a48dc04..8f028ff45 100644 --- a/cmake/ext/skeleton/CMakeLists.txt.in +++ b/cmake/ext/skeleton/CMakeLists.txt.in @@ -44,7 +44,7 @@ include(CMakeDependentOption) include(FeatureSummary) # Boolean option that enables (ON) or disables (OFF) the extension. -option(EXT_%EXTNAMECAPS% "Enable the %EXTNAME% extension" OFF) +option(EXT_%EXTNAMECAPS% "Enable the %EXTNAME% extension") # Extension features are visible in the configuration summary output. add_feature_info( @@ -94,7 +94,7 @@ target_compile_definitions( php_%EXTNAME% PRIVATE # Enable "Thread Safety Resource Manager Local Storage" static cache. - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) # Configure extension as Zend extension. Zend extensions are loaded with the @@ -117,6 +117,6 @@ install( DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/ext/%EXTNAME% ) -set(PHP_EXTENSION_%EXTNAMECAPS% 1) +set(PHP_EXTENSION_%EXTNAMECAPS% TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/skeleton/cmake/modules/FindPHP.cmake b/cmake/ext/skeleton/cmake/modules/FindPHP.cmake index 2204d44dd..4cfa6ba80 100644 --- a/cmake/ext/skeleton/cmake/modules/FindPHP.cmake +++ b/cmake/ext/skeleton/cmake/modules/FindPHP.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# FindPHP + Find PHP. Components: diff --git a/cmake/ext/snmp/CMakeLists.txt b/cmake/ext/snmp/CMakeLists.txt index 56aacc7fd..395f445b2 100644 --- a/cmake/ext/snmp/CMakeLists.txt +++ b/cmake/ext/snmp/CMakeLists.txt @@ -30,7 +30,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_SNMP "Enable the snmp extension" OFF) +option(EXT_SNMP "Enable the snmp extension") add_feature_info( "ext/snmp" @@ -99,6 +99,6 @@ if(TARGET NetSnmp::NetSnmp) cmake_pop_check_state() endif() -set(HAVE_SNMP 1) +set(HAVE_SNMP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/soap/CMakeLists.txt b/cmake/ext/soap/CMakeLists.txt index 5eae153ca..1209248ac 100644 --- a/cmake/ext/soap/CMakeLists.txt +++ b/cmake/ext/soap/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_SOAP "Enable the soap extension" OFF) +option(EXT_SOAP "Enable the soap extension") add_feature_info( "ext/soap" @@ -70,7 +70,7 @@ target_sources( target_compile_definitions( php_soap PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>>:LIBXML_STATIC> ) @@ -91,7 +91,7 @@ if(EXT_SESSION) add_dependencies(php_soap php_session) endif() -set(HAVE_PHP_SOAP 1) -set(HAVE_SOAP 1) +set(HAVE_PHP_SOAP TRUE) +set(HAVE_SOAP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/sockets/CMakeLists.txt b/cmake/ext/sockets/CMakeLists.txt index c6c2835e4..44791fa73 100644 --- a/cmake/ext/sockets/CMakeLists.txt +++ b/cmake/ext/sockets/CMakeLists.txt @@ -33,7 +33,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_SOCKETS "Enable the sockets extension" OFF) +option(EXT_SOCKETS "Enable the sockets extension") add_feature_info( "ext/sockets" @@ -78,7 +78,7 @@ target_sources( target_compile_definitions( php_sockets PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$:__APPLE_USE_RFC_3542> $<$:PHP_SOCKETS_EXPORTS> ) @@ -133,7 +133,7 @@ cmake_push_check_state(RESET) check_type_size("struct ucred" STRUCT_UCRED) cmake_pop_check_state() if(HAVE_STRUCT_UCRED) - set(ANC_CREDS_UCRED 1) + set(ANC_CREDS_UCRED TRUE) endif() # Check for struct cmsgcred. @@ -142,9 +142,9 @@ cmake_push_check_state(RESET) check_type_size("struct cmsgcred" STRUCT_CMSGCRED) cmake_pop_check_state() if(HAVE_STRUCT_CMSGCRED) - set(ANC_CREDS_CMSGCRED 1) + set(ANC_CREDS_CMSGCRED TRUE) endif() -set(HAVE_SOCKETS 1) +set(HAVE_SOCKETS TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/sodium/CMakeLists.txt b/cmake/ext/sodium/CMakeLists.txt index 73d6e2f51..097d4347e 100644 --- a/cmake/ext/sodium/CMakeLists.txt +++ b/cmake/ext/sodium/CMakeLists.txt @@ -30,7 +30,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/CheckCompilerFlag) -option(EXT_SODIUM "Enable the sodium extension" OFF) +option(EXT_SODIUM "Enable the sodium extension") add_feature_info( "ext/sodium" @@ -91,6 +91,6 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 4) endif() endif() -set(HAVE_LIBSODIUMLIB 1) +set(HAVE_LIBSODIUMLIB TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/spl/CMakeLists.txt b/cmake/ext/spl/CMakeLists.txt index 369dae7cb..adfe57313 100644 --- a/cmake/ext/spl/CMakeLists.txt +++ b/cmake/ext/spl/CMakeLists.txt @@ -59,6 +59,6 @@ target_sources( spl_observer.h ) -target_compile_definitions(php_spl PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_spl PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) add_dependencies(php_spl php_json php_pcre php_standard) diff --git a/cmake/ext/sqlite3/CMakeLists.txt b/cmake/ext/sqlite3/CMakeLists.txt index 0a1a5c96b..dfe4f00c3 100644 --- a/cmake/ext/sqlite3/CMakeLists.txt +++ b/cmake/ext/sqlite3/CMakeLists.txt @@ -62,7 +62,7 @@ target_sources( sqlite3.stub.php ) -target_compile_definitions(php_sqlite3 PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_sqlite3 PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(SQLite3 ${PHP_SQLITE_MIN_VERSION}) set_package_properties( @@ -97,10 +97,10 @@ if(TARGET SQLite::SQLite3) ) if(NOT HAVE_SQLITE3_LOAD_EXTENSION) - set(SQLITE_OMIT_LOAD_EXTENSION 1) + set(SQLITE_OMIT_LOAD_EXTENSION TRUE) endif() endif() -set(HAVE_SQLITE3 1) +set(HAVE_SQLITE3 TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/standard/CMakeLists.txt b/cmake/ext/standard/CMakeLists.txt index b806d053d..07396a338 100644 --- a/cmake/ext/standard/CMakeLists.txt +++ b/cmake/ext/standard/CMakeLists.txt @@ -40,7 +40,7 @@ add_feature_info( "PHP core extension" ) -option(EXT_STANDARD_ARGON2 "Include the Argon2 support in password_*" OFF) +option(EXT_STANDARD_ARGON2 "Include the Argon2 support in password_*") add_feature_info( "ext/standard Argon2" @@ -48,7 +48,7 @@ add_feature_info( "Argon2 hashing support in password_*() PHP functions" ) -option(EXT_STANDARD_EXTERNAL_LIBCRYPT "Use external libcrypt or libxcrypt" OFF) +option(EXT_STANDARD_EXTERNAL_LIBCRYPT "Use external libcrypt or libxcrypt") add_feature_info( "External librcypt" @@ -213,7 +213,7 @@ target_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libavifinfo ) -target_compile_definitions(php_standard PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_standard PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) # The standard extension depends on the generated Zend language parser. add_dependencies(php_standard Zend::Zend) @@ -259,7 +259,7 @@ if(EXT_STANDARD_ARGON2) target_link_libraries(php_standard PRIVATE Argon2::Argon2) - set(HAVE_ARGON2LIB 1) + set(HAVE_ARGON2LIB TRUE) endif() ################################################################################ @@ -277,7 +277,7 @@ if(NOT EXT_STANDARD_EXTERNAL_LIBCRYPT) php_crypt_r.c ) - set(PHP_USE_PHP_CRYPT_R 1) + set(PHP_USE_PHP_CRYPT_R TRUE) else() find_package(Crypt) set_package_properties( @@ -342,7 +342,7 @@ if(NOT HAVE_FORK) check_symbol_exists(CreateProcess "windows.h" HAVE_CREATEPROCESS) endif() if(HAVE_FORK OR HAVE_CREATEPROCESS) - set(PHP_CAN_SUPPORT_PROC_OPEN 1) + set(PHP_CAN_SUPPORT_PROC_OPEN TRUE) message(CHECK_PASS "yes") else() @@ -524,6 +524,6 @@ endblock() # TODO: Check whether to enable the chroot() function by checking which SAPI is # being built. -set(ENABLE_CHROOT_FUNC 1) +set(ENABLE_CHROOT_FUNC TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/standard/cmake/CheckCrypt.cmake b/cmake/ext/standard/cmake/CheckCrypt.cmake index e59848c7f..4d0c1b685 100644 --- a/cmake/ext/standard/cmake/CheckCrypt.cmake +++ b/cmake/ext/standard/cmake/CheckCrypt.cmake @@ -1,15 +1,17 @@ #[=============================================================================[ +# CheckCrypt + Check whether the `crypt` library works as expected for PHP by running a set of PHP-specific checks. ## Cache variables -* HAVE_CRYPT_H -* HAVE_CRYPT -* HAVE_CRYPT_R -* CRYPT_R_CRYPTD -* CRYPT_R_STRUCT_CRYPT_DATA -* CRYPT_R_GNU_SOURCE +* `HAVE_CRYPT_H` +* `HAVE_CRYPT` +* `HAVE_CRYPT_R` +* `CRYPT_R_CRYPTD` +* `CRYPT_R_STRUCT_CRYPT_DATA` +* `CRYPT_R_GNU_SOURCE` #]=============================================================================] include_guard(GLOBAL) @@ -131,7 +133,7 @@ function(_php_check_crypt_r result) if(CRYPT_R_GNU_SOURCE) set( - CRYPT_R_STRUCT_CRYPT_DATA 1 + CRYPT_R_STRUCT_CRYPT_DATA TRUE CACHE INTERNAL "Define if crypt_r uses struct crypt_data" ) @@ -155,7 +157,7 @@ function(_php_check_crypt_r result) if(_CRYPT_R_STRUCT_CRYPT_DATA) set( - CRYPT_R_STRUCT_CRYPT_DATA 1 + CRYPT_R_STRUCT_CRYPT_DATA TRUE CACHE INTERNAL "Define if crypt_r uses struct crypt_data" ) @@ -184,11 +186,11 @@ function(_php_check_crypt_is_usable) set(CMAKE_REQUIRED_QUIET TRUE) if(HAVE_UNISTD_H) - list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_UNISTD_H=1) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_UNISTD_H) endif() if(HAVE_CRYPT_H) - list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_CRYPT_H=1) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_CRYPT_H) endif() set(CMAKE_REQUIRED_LIBRARIES Crypt::Crypt) diff --git a/cmake/ext/standard/cmake/CheckFclose.cmake b/cmake/ext/standard/cmake/CheckFclose.cmake index e107b9b85..6b105ed0e 100644 --- a/cmake/ext/standard/cmake/CheckFclose.cmake +++ b/cmake/ext/standard/cmake/CheckFclose.cmake @@ -1,10 +1,13 @@ #[=============================================================================[ +# CheckFclose + Check if `fclose` declaration is missing. Some systems have broken header files like SunOS has. This check is obsolete on current Solaris/illumos versions. ## Result variables * MISSING_FCLOSE_DECL + Whether `fclose` declaration is missing. #]=============================================================================] @@ -23,7 +26,7 @@ cmake_pop_check_state() if(NOT _HAVE_FCLOSE) message(CHECK_FAIL "missing") - set(MISSING_FCLOSE_DECL 1) + set(MISSING_FCLOSE_DECL TRUE) else() message(CHECK_PASS "found") endif() diff --git a/cmake/ext/standard/cmake/CheckFnmatch.cmake b/cmake/ext/standard/cmake/CheckFnmatch.cmake index 46121adc3..5191605fb 100644 --- a/cmake/ext/standard/cmake/CheckFnmatch.cmake +++ b/cmake/ext/standard/cmake/CheckFnmatch.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckFnmatch + Check for a working POSIX `fnmatch()` function. Some versions of Solaris (2.4), SCO, and the GNU C Library have a broken or @@ -11,6 +13,7 @@ https://www.gnu.org/software/gnulib/MODULES.html#module=fnmatch ## Cache variables * `HAVE_FNMATCH` + Whether `fnmatch` is a working POSIX variant. #]=============================================================================] diff --git a/cmake/ext/standard/cmake/CheckStrptime.cmake b/cmake/ext/standard/cmake/CheckStrptime.cmake index f75156740..fca1720fb 100644 --- a/cmake/ext/standard/cmake/CheckStrptime.cmake +++ b/cmake/ext/standard/cmake/CheckStrptime.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckStrptime + Check `strptime()` and its declaration. Note: This module is obsolete. PHP `strptime()` is deprecated as of PHP 8.1.0. @@ -6,11 +8,13 @@ Note: This module is obsolete. PHP `strptime()` is deprecated as of PHP 8.1.0. ## Cache variables * `HAVE_STRPTIME` + Whether `strptime()` is available. ## Result variables * `HAVE_STRPTIME_DECL_FAILS` + Whether `strptime()` declaration fails. #]=============================================================================] @@ -35,7 +39,7 @@ cmake_push_check_state(RESET) cmake_pop_check_state() if(HAVE_STRPTIME) - set(HAVE_STRPTIME_DECL_FAILS 1) + set(HAVE_STRPTIME_DECL_FAILS TRUE) return() endif() @@ -73,7 +77,7 @@ cmake_pop_check_state() if(NOT HAVE_STRPTIME_DECL) message(CHECK_PASS "yes") - set(HAVE_STRPTIME_DECL_FAILS 1) + set(HAVE_STRPTIME_DECL_FAILS TRUE) else() message(CHECK_FAIL "no") endif() diff --git a/cmake/ext/sysvmsg/CMakeLists.txt b/cmake/ext/sysvmsg/CMakeLists.txt index 395a8bc3b..b5644e776 100644 --- a/cmake/ext/sysvmsg/CMakeLists.txt +++ b/cmake/ext/sysvmsg/CMakeLists.txt @@ -37,7 +37,7 @@ include(CheckIncludeFile) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_SYSVMSG "Enable the sysvmsg extension" OFF) +option(EXT_SYSVMSG "Enable the sysvmsg extension") add_feature_info( "ext/sysvmsg" @@ -80,6 +80,6 @@ target_sources( sysvmsg.stub.php ) -set(HAVE_SYSVMSG 1) +set(HAVE_SYSVMSG TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/sysvsem/CMakeLists.txt b/cmake/ext/sysvsem/CMakeLists.txt index e1bd2df7d..9f912c2d3 100644 --- a/cmake/ext/sysvsem/CMakeLists.txt +++ b/cmake/ext/sysvsem/CMakeLists.txt @@ -37,7 +37,7 @@ include(CMakeDependentOption) include(CMakePushCheckState) include(FeatureSummary) -option(EXT_SYSVSEM "Enable the sysvsem extension" OFF) +option(EXT_SYSVSEM "Enable the sysvsem extension") add_feature_info( "ext/sysvsem" @@ -75,6 +75,6 @@ cmake_push_check_state(RESET) check_type_size("union semun" SEMUN) cmake_pop_check_state() -set(HAVE_SYSVSEM 1) +set(HAVE_SYSVSEM TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/sysvshm/CMakeLists.txt b/cmake/ext/sysvshm/CMakeLists.txt index c5f2127b1..411ded0ba 100644 --- a/cmake/ext/sysvshm/CMakeLists.txt +++ b/cmake/ext/sysvshm/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_SYSVSHM "Enable the sysvshm extension" OFF) +option(EXT_SYSVSHM "Enable the sysvshm extension") add_feature_info( "ext/sysvshm" @@ -61,6 +61,6 @@ target_sources( sysvshm.stub.php ) -set(HAVE_SYSVSHM 1) +set(HAVE_SYSVSHM TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/tidy/CMakeLists.txt b/cmake/ext/tidy/CMakeLists.txt index 2d54d1eaa..1e3dac0eb 100644 --- a/cmake/ext/tidy/CMakeLists.txt +++ b/cmake/ext/tidy/CMakeLists.txt @@ -31,7 +31,7 @@ include(CMakeDependentOption) include(FeatureSummary) include(PHP/CheckCompilerFlag) -option(EXT_TIDY "Enable the tidy extension" OFF) +option(EXT_TIDY "Enable the tidy extension") add_feature_info( "ext/tidy" @@ -78,7 +78,7 @@ if(Tidy_VERSION VERSION_LESS 5.7.20) endif() endif() -target_compile_definitions(php_tidy PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_tidy PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(Tidy) set_package_properties( @@ -95,6 +95,6 @@ if(TARGET Tidy::Tidy) check_library_exists(Tidy::Tidy tidyReleaseDate "" HAVE_TIDYRELEASEDATE) endif() -set(HAVE_TIDY 1) +set(HAVE_TIDY TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/tokenizer/CMakeLists.txt b/cmake/ext/tokenizer/CMakeLists.txt index 4787809fc..196d2b549 100644 --- a/cmake/ext/tokenizer/CMakeLists.txt +++ b/cmake/ext/tokenizer/CMakeLists.txt @@ -86,6 +86,6 @@ if(PHP_SOURCE_DIR) ) endif() -set(HAVE_TOKENIZER 1) +set(HAVE_TOKENIZER TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/xml/CMakeLists.txt b/cmake/ext/xml/CMakeLists.txt index ec55b12ca..805cc5192 100644 --- a/cmake/ext/xml/CMakeLists.txt +++ b/cmake/ext/xml/CMakeLists.txt @@ -87,7 +87,7 @@ target_sources( php_xml.h ) -target_compile_definitions(php_xml PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_xml PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) if(NOT EXT_LIBXML AND NOT EXT_XML_EXPAT) message( @@ -130,9 +130,9 @@ else() target_link_libraries(php_xml PRIVATE EXPAT::EXPAT) - set(HAVE_LIBEXPAT 1) + set(HAVE_LIBEXPAT TRUE) endif() -set(HAVE_XML 1) +set(HAVE_XML TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/xmlreader/CMakeLists.txt b/cmake/ext/xmlreader/CMakeLists.txt index f9ac15b14..f77b3d2e2 100644 --- a/cmake/ext/xmlreader/CMakeLists.txt +++ b/cmake/ext/xmlreader/CMakeLists.txt @@ -86,6 +86,6 @@ endif() add_dependencies(php_xmlreader php_libxml) -set(HAVE_XMLREADER 1) +set(HAVE_XMLREADER TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/xmlwriter/CMakeLists.txt b/cmake/ext/xmlwriter/CMakeLists.txt index 750cba49d..c5a435252 100644 --- a/cmake/ext/xmlwriter/CMakeLists.txt +++ b/cmake/ext/xmlwriter/CMakeLists.txt @@ -83,6 +83,6 @@ target_link_libraries(php_xmlwriter PRIVATE LibXml2::LibXml2) # ensures proper error reporting and support for streams. add_dependencies(php_xmlwriter php_libxml) -set(HAVE_XMLWRITER 1) +set(HAVE_XMLWRITER TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/xsl/CMakeLists.txt b/cmake/ext/xsl/CMakeLists.txt index 954f6eccb..c0b03777f 100644 --- a/cmake/ext/xsl/CMakeLists.txt +++ b/cmake/ext/xsl/CMakeLists.txt @@ -29,7 +29,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_XSL "Enable the xsl extension" OFF) +option(EXT_XSL "Enable the xsl extension") add_feature_info( "ext/xsl" @@ -102,7 +102,7 @@ set_package_properties( target_link_libraries(php_xsl PRIVATE LibXslt::LibXslt) if(TARGET LibXslt::LibExslt) - set(HAVE_XSL_EXSLT 1) + set(HAVE_XSL_EXSLT TRUE) target_link_libraries(php_xsl PRIVATE LibXslt::LibExslt) @@ -120,6 +120,6 @@ add_feature_info( "support for XSLT extensions (EXSLT)" ) -set(HAVE_XSL 1) +set(HAVE_XSL TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/zend_test/CMakeLists.txt b/cmake/ext/zend_test/CMakeLists.txt index 6484750bf..2e5d322e5 100644 --- a/cmake/ext/zend_test/CMakeLists.txt +++ b/cmake/ext/zend_test/CMakeLists.txt @@ -28,7 +28,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_ZEND_TEST "Enable the zend_test extension" OFF) +option(EXT_ZEND_TEST "Enable the zend_test extension") add_feature_info( "ext/zend_test" @@ -71,7 +71,7 @@ target_sources( target_compile_definitions( php_zend_test PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE # TODO: PHP_ZEND_TEST_EXPORTS is currently unused. $<$:PHP_ZEND_TEST_EXPORTS> ) diff --git a/cmake/ext/zip/CMakeLists.txt b/cmake/ext/zip/CMakeLists.txt index 9d41d74ea..d33049f91 100644 --- a/cmake/ext/zip/CMakeLists.txt +++ b/cmake/ext/zip/CMakeLists.txt @@ -29,7 +29,7 @@ include(CheckLibraryExists) include(CMakeDependentOption) include(FeatureSummary) -option(EXT_ZIP "Enable the zip extension" OFF) +option(EXT_ZIP "Enable the zip extension") add_feature_info( "ext/zip" @@ -99,8 +99,8 @@ if( ) # TODO: Adjust this if the libzip is a static library. if(TODO) - set(ZIP_STATIC 1) - #set(LZMA_API_STATIC 1) + set(ZIP_STATIC TRUE) + #set(LZMA_API_STATIC TRUE) endif() endif() @@ -159,6 +159,6 @@ if(TARGET libzip::libzip) ) endif() -set(HAVE_ZIP 1) +set(HAVE_ZIP TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/ext/zlib/CMakeLists.txt b/cmake/ext/zlib/CMakeLists.txt index 4e55b8462..e598bd2d9 100644 --- a/cmake/ext/zlib/CMakeLists.txt +++ b/cmake/ext/zlib/CMakeLists.txt @@ -29,7 +29,7 @@ project( include(CMakeDependentOption) include(FeatureSummary) -option(EXT_ZLIB "Enable the zlib extension" OFF) +option(EXT_ZLIB "Enable the zlib extension") add_feature_info( "ext/zlib" @@ -65,7 +65,7 @@ target_sources( zlib.stub.php ) -target_compile_definitions(php_zlib PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_zlib PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) find_package(ZLIB ${PHP_ZLIB_MIN_VERSION}) set_package_properties( @@ -77,6 +77,6 @@ set_package_properties( target_link_libraries(php_zlib PRIVATE ZLIB::ZLIB) -set(HAVE_ZLIB 1) +set(HAVE_ZLIB TRUE) configure_file(config.cmake.h.in config.h) diff --git a/cmake/main/CMakeLists.txt b/cmake/main/CMakeLists.txt index 26a145839..3df95625e 100644 --- a/cmake/main/CMakeLists.txt +++ b/cmake/main/CMakeLists.txt @@ -127,7 +127,7 @@ set_property( php_main_internal_functions php_main_internal_functions_cli APPEND - PROPERTY COMPILE_DEFINITIONS ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + PROPERTY COMPILE_DEFINITIONS ZEND_ENABLE_STATIC_TSRMLS_CACHE ) # Add main PUBLIC/INTERFACE compile properties to configuration. @@ -270,26 +270,26 @@ function(_php_main_create_internal_functions) set(EXT_MODULE_PTRS "") # Add artifacts of static enabled PHP extensions to symbol definitions. - get_cmake_property(php_extensions PHP_EXTENSIONS) - foreach(extension IN LISTS php_extensions) + get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) + foreach(extension IN LISTS extensions) # Skip if extension is shared. - get_target_property(extension_type php_${extension} TYPE) - if(extension_type MATCHES "^(MODULE|SHARED)_LIBRARY$") + get_target_property(type php_${extension} TYPE) + if(type MATCHES "^(MODULE|SHARED)_LIBRARY$") continue() endif() - file(GLOB_RECURSE extension_headers ${PHP_SOURCE_DIR}/ext/${extension}/*.h) + file(GLOB_RECURSE headers ${PHP_SOURCE_DIR}/ext/${extension}/*.h) - foreach(extension_header IN LISTS extension_headers) - file(READ "${extension_header}" file_content) - string(FIND "${file_content}" "phpext_" pattern_index) + foreach(header IN LISTS headers) + file(READ "${header}" content) + string(FIND "${content}" "phpext_" index) - if(NOT pattern_index EQUAL -1) - cmake_path(GET extension_header FILENAME file_name) + if(NOT index EQUAL -1) + cmake_path(GET header FILENAME filename) string( APPEND EXT_INCLUDE_CODE - "#include \"ext/${extension}/${file_name}\"\n" + "#include \"ext/${extension}/${filename}\"\n" ) endif() endforeach() @@ -393,7 +393,7 @@ function(_php_main_create_files) # Add sapis configuration. set(config "") - get_cmake_property(sapis PHP_SAPIS) + get_property(sapis GLOBAL PROPERTY PHP_SAPIS) list(SORT sapis COMPARE NATURAL) foreach(sapi IN LISTS sapis) if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/sapi/${sapi}/config.h) @@ -407,7 +407,7 @@ function(_php_main_create_files) # Add extensions configuration. set(config "") - get_cmake_property(extensions PHP_EXTENSIONS) + get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) list(SORT extensions COMPARE NATURAL) foreach(extension IN LISTS extensions) if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ext/${extension}/config.h) @@ -478,7 +478,7 @@ function(_php_main_create_files) add_dependencies(php_main php_main_build_defs_h) #]] - set(HAVE_BUILD_DEFS_H 1) + set(HAVE_BUILD_DEFS_H TRUE) set(PHP_CONFIG_H_WINDOWS 0) set(file php_config.h) endif() diff --git a/cmake/main/php_config.cmake.h.in b/cmake/main/php_config.cmake.h.in index 0187cf2b9..19bf339e1 100644 --- a/cmake/main/php_config.cmake.h.in +++ b/cmake/main/php_config.cmake.h.in @@ -670,7 +670,7 @@ /* The size of 'ssize_t', as computed by sizeof. */ @SIZEOF_SSIZE_T_CODE@ -@PHP_SYSTEM_EXTENSIONS@ +@PHP_SYSTEM_EXTENSIONS_CODE@ /* Define if processor uses big-endian word. */ #cmakedefine WORDS_BIGENDIAN diff --git a/cmake/pear/CMakeLists.txt b/cmake/pear/CMakeLists.txt index 59721268a..4e31b8764 100644 --- a/cmake/pear/CMakeLists.txt +++ b/cmake/pear/CMakeLists.txt @@ -47,7 +47,7 @@ include(FeatureSummary) include(PHP/Install) include(PHP/Set) -option(PHP_PEAR "Install PEAR" OFF) +option(PHP_PEAR "Install PEAR") add_feature_info( "PEAR" diff --git a/cmake/sapi/CMakeLists.txt b/cmake/sapi/CMakeLists.txt index b3565efb8..7e8c1ec4b 100644 --- a/cmake/sapi/CMakeLists.txt +++ b/cmake/sapi/CMakeLists.txt @@ -66,7 +66,7 @@ foreach(sapi IN LISTS sapis) endforeach() # Check if at least one SAPI is enabled. -get_cmake_property(sapis PHP_SAPIS) +get_property(sapis GLOBAL PROPERTY PHP_SAPIS) if(NOT sapis) message( WARNING diff --git a/cmake/sapi/apache2handler/CMakeLists.txt b/cmake/sapi/apache2handler/CMakeLists.txt index 86291ee82..6b2ad3ee1 100644 --- a/cmake/sapi/apache2handler/CMakeLists.txt +++ b/cmake/sapi/apache2handler/CMakeLists.txt @@ -30,11 +30,7 @@ cmake -B php-build -DAPACHE2HANDLER=ON -DApache_EXECUTABLE=/opt/apache2/bin/apxs include(FeatureSummary) -option( - SAPI_APACHE2HANDLER - "Enable the shared Apache 2 handler SAPI module" - OFF -) +option(SAPI_APACHE2HANDLER "Enable the shared Apache 2 handler SAPI module") add_feature_info( "sapi/apache2handler" @@ -68,7 +64,7 @@ set_target_properties( target_compile_definitions( php_apache2handler PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) find_package(Apache 2.0.44) diff --git a/cmake/sapi/cgi/CMakeLists.txt b/cmake/sapi/cgi/CMakeLists.txt index 15c7093c4..b1c8be658 100644 --- a/cmake/sapi/cgi/CMakeLists.txt +++ b/cmake/sapi/cgi/CMakeLists.txt @@ -36,7 +36,7 @@ target_sources( cgi_main.stub.php ) -target_compile_definitions(php_cgi PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_cgi PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) target_link_libraries( php_cgi @@ -65,10 +65,9 @@ check_struct_has_member("struct sockaddr_un" sun_len sys/un.h HAVE_SOCKADDR_UN_S message(CHECK_START "Checking whether accept() requires cross-process locking") if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") - set(USE_LOCKING 1) + set(USE_LOCKING TRUE) message(CHECK_PASS "yes") else() - set(USE_LOCKING 0) message(CHECK_FAIL "no") endif() diff --git a/cmake/sapi/cli/CMakeLists.txt b/cmake/sapi/cli/CMakeLists.txt index b402fb274..8090417ee 100644 --- a/cmake/sapi/cli/CMakeLists.txt +++ b/cmake/sapi/cli/CMakeLists.txt @@ -96,7 +96,7 @@ target_sources( target_compile_definitions( php_cli PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) target_link_libraries( @@ -152,7 +152,7 @@ if(SAPI_CLI_WIN_NO_CONSOLE) target_compile_definitions( php_cli_win_no_console PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE ) target_link_libraries( diff --git a/cmake/sapi/embed/CMakeLists.txt b/cmake/sapi/embed/CMakeLists.txt index 88e983a6f..5d2b47622 100644 --- a/cmake/sapi/embed/CMakeLists.txt +++ b/cmake/sapi/embed/CMakeLists.txt @@ -18,7 +18,7 @@ to use PHP. include(FeatureSummary) -option(SAPI_EMBED "Enable the Embed SAPI module" OFF) +option(SAPI_EMBED "Enable the Embed SAPI module") add_feature_info( "sapi/embed" @@ -49,7 +49,7 @@ target_link_libraries( PHP::PHP ) -target_compile_definitions(php_embed PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_embed PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) set_target_properties( php_embed diff --git a/cmake/sapi/fpm/CMakeLists.txt b/cmake/sapi/fpm/CMakeLists.txt index 694700a69..3e70bd16b 100644 --- a/cmake/sapi/fpm/CMakeLists.txt +++ b/cmake/sapi/fpm/CMakeLists.txt @@ -102,7 +102,7 @@ include(PHP/Set) # FPM configuration. ################################################################################ -option(SAPI_FPM "Enable the FPM SAPI module" OFF) +option(SAPI_FPM "Enable the FPM SAPI module") add_feature_info( "sapi/fpm" SAPI_FPM @@ -230,7 +230,7 @@ target_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/fpm ) -target_compile_definitions(php_fpm PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +target_compile_definitions(php_fpm PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) target_link_libraries( php_fpm @@ -470,7 +470,7 @@ if(SAPI_FPM_SYSTEMD) target_link_libraries(php_fpm PRIVATE Systemd::Systemd) if(TARGET Systemd::Systemd) - set(HAVE_SYSTEMD 1) + set(HAVE_SYSTEMD TRUE) target_sources(php_fpm PRIVATE fpm/fpm_systemd.c) endif() @@ -498,7 +498,7 @@ if(SAPI_FPM_ACL) check_include_file(sys/acl.h HAVE_SYS_ACL_H) cmake_pop_check_state() - set(HAVE_FPM_ACL 1) + set(HAVE_FPM_ACL TRUE) endif() endif() @@ -514,7 +514,7 @@ if(SAPI_FPM_APPARMOR) target_link_libraries(php_fpm PRIVATE AppArmor::AppArmor) if(TARGET AppArmor::AppArmor) - set(HAVE_APPARMOR 1) + set(HAVE_APPARMOR TRUE) endif() endif() @@ -530,7 +530,7 @@ if(SAPI_FPM_SELINUX) target_link_libraries(php_fpm PRIVATE SELinux::SELinux) if(TARGET SELinux::SELinux) - set(HAVE_SELINUX 1) + set(HAVE_SELINUX TRUE) endif() endif() diff --git a/cmake/sapi/fpm/cmake/CheckListeningQueue.cmake b/cmake/sapi/fpm/cmake/CheckListeningQueue.cmake index c57329deb..3620ed9fd 100644 --- a/cmake/sapi/fpm/cmake/CheckListeningQueue.cmake +++ b/cmake/sapi/fpm/cmake/CheckListeningQueue.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckListeningQueue + Check FPM listening queue implementation. ## Cache variables diff --git a/cmake/sapi/fpm/cmake/CheckTrace.cmake b/cmake/sapi/fpm/cmake/CheckTrace.cmake index 14bd0062e..17acc071c 100644 --- a/cmake/sapi/fpm/cmake/CheckTrace.cmake +++ b/cmake/sapi/fpm/cmake/CheckTrace.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckTrace + Check FPM trace implementation. ## Cache variables diff --git a/cmake/sapi/fuzzer/CMakeLists.txt b/cmake/sapi/fuzzer/CMakeLists.txt index 579428fdb..3778ced86 100644 --- a/cmake/sapi/fuzzer/CMakeLists.txt +++ b/cmake/sapi/fuzzer/CMakeLists.txt @@ -35,7 +35,6 @@ include(PHP/CheckCompilerFlag) option( SAPI_FUZZER "Enable the fuzzer SAPI module - Clang fuzzing test module (for developers)" - OFF ) add_feature_info( diff --git a/cmake/sapi/litespeed/CMakeLists.txt b/cmake/sapi/litespeed/CMakeLists.txt index 3652b9b2e..f8efe4012 100644 --- a/cmake/sapi/litespeed/CMakeLists.txt +++ b/cmake/sapi/litespeed/CMakeLists.txt @@ -20,7 +20,7 @@ endif() include(FeatureSummary) -option(SAPI_LITESPEED "Enable the LiteSpeed SAPI module" OFF) +option(SAPI_LITESPEED "Enable the LiteSpeed SAPI module") add_feature_info( "sapi/litespeed" diff --git a/cmake/sapi/phpdbg/CMakeLists.txt b/cmake/sapi/phpdbg/CMakeLists.txt index 454b57cbe..62646a9a0 100644 --- a/cmake/sapi/phpdbg/CMakeLists.txt +++ b/cmake/sapi/phpdbg/CMakeLists.txt @@ -130,7 +130,7 @@ add_executable(PHP:phpdbg ALIAS php_phpdbg) target_compile_definitions( php_phpdbg PRIVATE - ZEND_ENABLE_STATIC_TSRMLS_CACHE=1 + ZEND_ENABLE_STATIC_TSRMLS_CACHE $<$:YY_NO_UNISTD_H> $,PHPDBG_DEBUG=1,PHPDBG_DEBUG=0> ) @@ -197,10 +197,10 @@ if(SAPI_PHPDBG_READLINE OR EXT_READLINE) target_link_libraries(php_phpdbg PRIVATE Editline::Editline) - set(HAVE_LIBEDIT 1) + set(HAVE_LIBEDIT TRUE) endif() - set(HAVE_PHPDBG_READLINE 1) + set(HAVE_PHPDBG_READLINE TRUE) else() message(CHECK_FAIL "disabled") endif() @@ -227,6 +227,7 @@ if(SAPI_PHPDBG_SHARED) target_compile_definitions( php_phpdbg_shared PRIVATE + ZEND_ENABLE_STATIC_TSRMLS_CACHE $ $<$:YY_NO_UNISTD_H> $,PHPDBG_DEBUG=1,PHPDBG_DEBUG=0> @@ -306,7 +307,7 @@ if(HAVE_UFFDIO_WRITEPROTECT_MODE_WP) endif() if(PHP_THREAD_SAFETY OR Threads_FOUND) - set(HAVE_USERFAULTFD_WRITEFAULT 1) + set(HAVE_USERFAULTFD_WRITEFAULT TRUE) endif() endif() if(HAVE_USERFAULTFD_WRITEFAULT) diff --git a/cmake/sapi/phpdbg/cmake/CheckTiocgwinsz.cmake b/cmake/sapi/phpdbg/cmake/CheckTiocgwinsz.cmake index 0baa53370..28921bd51 100644 --- a/cmake/sapi/phpdbg/cmake/CheckTiocgwinsz.cmake +++ b/cmake/sapi/phpdbg/cmake/CheckTiocgwinsz.cmake @@ -1,4 +1,6 @@ #[=============================================================================[ +# CheckTiocgwinsz + Check if any of the expected headers define `TIOCGWINSZ`. Some systems define `TIOCGWINSZ` (Terminal Input Output Control Get WINdow SiZe) @@ -8,6 +10,7 @@ on Autoconf's `AC_HEADER_TIOCGWINSZ` macro approach. ## Cache variables * `GWINSZ_IN_SYS_IOCTL` + Whether `sys/ioctl.h` defines `TIOCGWINSZ`. #]=============================================================================] diff --git a/cmake/scripts/CMakeLists.txt b/cmake/scripts/CMakeLists.txt index 9acd68589..6ba2dc914 100644 --- a/cmake/scripts/CMakeLists.txt +++ b/cmake/scripts/CMakeLists.txt @@ -40,7 +40,7 @@ block() message(STATUS "Creating scripts/php-config") - get_cmake_property(sapis PHP_SAPIS) + get_property(sapis GLOBAL PROPERTY PHP_SAPIS) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.27) set(sapis "$, >") else()