Patch CMakeLists.txt to properly test for mkostemp.

This commit is contained in:
Philip.Hazel 2020-04-28 14:26:24 +00:00
parent b940ed7520
commit bf4ca900f3
2 changed files with 15 additions and 2 deletions

View File

@ -88,8 +88,9 @@
# 2020-03-24 PH changed CMAKE_MODULE_PATH definition to add, not replace # 2020-03-24 PH changed CMAKE_MODULE_PATH definition to add, not replace
# 2020-04-08 Carlo added function check for secure_getenv, fixed strerror # 2020-04-08 Carlo added function check for secure_getenv, fixed strerror
# 2020-04-16 enh added check for __attribute__((uninitialized)) # 2020-04-16 enh added check for __attribute__((uninitialized))
# 2020=04-25 PH applied patches from Uwe Korn to support pkg-config and # 2020-04-25 PH applied patches from Uwe Korn to support pkg-config and
# library versioning. # library versioning.
# 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator
PROJECT(PCRE2 C) PROJECT(PCRE2 C)
@ -118,6 +119,7 @@ FIND_PACKAGE( Editline )
INCLUDE(CheckCSourceCompiles) INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckFunctionExists) INCLUDE(CheckFunctionExists)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckIncludeFile) INCLUDE(CheckIncludeFile)
INCLUDE(CheckTypeSize) INCLUDE(CheckTypeSize)
@ -323,7 +325,15 @@ IF(PCRE2_SUPPORT_JIT)
ENDIF(PCRE2_SUPPORT_JIT) ENDIF(PCRE2_SUPPORT_JIT)
IF(PCRE2_SUPPORT_JIT_SEALLOC) IF(PCRE2_SUPPORT_JIT_SEALLOC)
SET(SLJIT_PROT_EXECUTABLE_ALLOCATOR 1) SET(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
CHECK_SYMBOL_EXISTS(mkostemp stdlib.h REQUIRED)
UNSET(CMAKE_REQUIRED_DEFINITIONS)
IF(${REQUIRED})
ADD_DEFINITIONS(-D_GNU_SOURCE)
SET(SLJIT_PROT_EXECUTABLE_ALLOCATOR 1)
ELSE(${REQUIRED})
SET(PCRE2_SUPPORT_JIT_SEALLOC OFF)
ENDIF(${REQUIRED})
ENDIF(PCRE2_SUPPORT_JIT_SEALLOC) ENDIF(PCRE2_SUPPORT_JIT_SEALLOC)
IF(PCRE2GREP_SUPPORT_JIT) IF(PCRE2GREP_SUPPORT_JIT)

View File

@ -114,6 +114,9 @@ variables.
pcre2-config, the libpcre*.pc files, SOVERSION, VERSION and the pcre2-config, the libpcre*.pc files, SOVERSION, VERSION and the
MACHO_*_VERSIONS settings for CMake builds. MACHO_*_VERSIONS settings for CMake builds.
28. Another patch to CMakeLists.txt to check for mkostemp (configure already
does). Patch by Carlo Marcelo Arenas Belon.
Version 10.34 21-November-2019 Version 10.34 21-November-2019
------------------------------ ------------------------------