From 9d1b82ba0939fd08ccaa203245cf1ceb30c25d22 Mon Sep 17 00:00:00 2001 From: ph10 Date: Tue, 28 Apr 2020 14:26:24 +0000 Subject: [PATCH] Patch CMakeLists.txt to properly test for mkostemp. --- CMakeLists.txt | 14 ++++++++++++-- ChangeLog | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58af430..8768bdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,8 +88,9 @@ # 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-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. +# 2020-04-25 Carlo added function check for mkostemp used in ProtExecAllocator PROJECT(PCRE2 C) @@ -118,6 +119,7 @@ FIND_PACKAGE( Editline ) INCLUDE(CheckCSourceCompiles) INCLUDE(CheckFunctionExists) +INCLUDE(CheckSymbolExists) INCLUDE(CheckIncludeFile) INCLUDE(CheckTypeSize) @@ -323,7 +325,15 @@ IF(PCRE2_SUPPORT_JIT) ENDIF(PCRE2_SUPPORT_JIT) 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) IF(PCRE2GREP_SUPPORT_JIT) diff --git a/ChangeLog b/ChangeLog index 909a789..6ca023f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -114,6 +114,9 @@ variables. pcre2-config, the libpcre*.pc files, SOVERSION, VERSION and the 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 ------------------------------