Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/php.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion cmake/Zend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ target_include_directories(
target_compile_definitions(
zend
PRIVATE
ZEND_ENABLE_STATIC_TSRMLS_CACHE=1
ZEND_ENABLE_STATIC_TSRMLS_CACHE
PUBLIC
$<$<PLATFORM_ID:Windows>:LIBZEND_EXPORTS>
)
Expand Down
16 changes: 6 additions & 10 deletions cmake/Zend/cmake/CheckDlsym.cmake
Original file line number Diff line number Diff line change
@@ -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.
#]=============================================================================]

Expand All @@ -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(
Expand Down Expand Up @@ -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")
Expand Down
11 changes: 11 additions & 0 deletions cmake/Zend/cmake/CheckFloatPrecision.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
#[=============================================================================[
# CheckFloatPrecision

Check for x87 floating point internal precision control.

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.
#]=============================================================================]

Expand Down
2 changes: 2 additions & 0 deletions cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
29 changes: 14 additions & 15 deletions cmake/Zend/cmake/CheckMMAlignment.cmake
Original file line number Diff line number Diff line change
@@ -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`
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion cmake/Zend/cmake/CheckStackLimit.cmake
Original file line number Diff line number Diff line change
@@ -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.
#]=============================================================================]

Expand Down
5 changes: 5 additions & 0 deletions cmake/Zend/cmake/CheckStrerrorR.cmake
Original file line number Diff line number Diff line change
@@ -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.
#]=============================================================================]
Expand Down
2 changes: 2 additions & 0 deletions cmake/Zend/cmake/Fibers.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#[=============================================================================[
# Fibers

Check if Fibers can be used.

This module adds Boost fiber assembly files support if available for the
Expand Down
2 changes: 2 additions & 0 deletions cmake/Zend/cmake/MaxExecutionTimers.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#[=============================================================================[
# MaxExecutionTimers

Check whether to enable Zend max execution timers.

## Cache variables
Expand Down
6 changes: 2 additions & 4 deletions cmake/cmake/CMakeDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
23 changes: 9 additions & 14 deletions cmake/cmake/Configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions cmake/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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()

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake/Flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake/Requirements.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if(
endif()

################################################################################
# Find sendmail binary.
# Find mailer.
################################################################################
find_package(Sendmail)

Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake/Testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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$")
Expand Down
4 changes: 2 additions & 2 deletions cmake/cmake/modules/FindBerkeleyDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading