cmake: support older versions

This commit is contained in:
Vitor Santos Costa 2015-10-20 08:07:42 +01:00
parent 20c87f1ab6
commit 318b2e8df2
4 changed files with 28 additions and 18 deletions

View File

@ -178,7 +178,6 @@ ENDIF("${isSystemDir}" STREQUAL "-1")
#
set ( YAP_MALLOC_T void *)
set ( MIN_STACKSPACE 1024*SIZEOF_INT_P )
set ( MIN_HEAPSPACE 2*1024*SIZEOF_INT_P )
set ( MIN_TRAILSPACE 512*SIZEOF_INT_P )
@ -314,6 +313,8 @@ endif (YAP_CALL_TRACER)
#set( CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBS} ${CMAKE_REQUIRED_LIBRARIES} )
#target_link_libraries(libYap ${READLINE_LIBS})
option (YAPOR "or-p" OFF)
option (YAP_THREADS
"support system threads" OFF)
macro_optional_find_package (Threads OFF)
@ -458,15 +459,23 @@ option (WITH_YAP_STATIC
#TODO:
option (WITH_YAP_MALLOC
"use malloc to allocate memory" ON)
if (YAP_MALLOC)
"use malloc to allocate memory" OFF)
# modern systems do this.
set ( MALLOC_T "void *" )
if (YAPOR)
set ( USE_DL_MALLOC 1 )
set ( USE_SYSTEM_MALLOC 0 )
else()
# use default allocator
set ( USE_SYSTEM_MALLOC 1 )
set ( USE_DL_MALLOC 0 )
set ( USE_SYSTEM_MMAP 0 )
set ( USE_SYSTEM_SHM 0 )
endif()
option(YAP_CONDOR
option(WITH_YAP_CONDOR
"allow YAP to be used from condor" OFF)
if (YAP_MALLOC)
if (WITH_YAP_MALLOC)
# use default allocator
set ( YAP_STATIC ON )
set ( YAP_DLL OFF )
@ -496,6 +505,7 @@ target_link_libraries(libYap
${GMP_LIBRARIES}
${READLINE_LIBS}
${CMAKE_DL_LIBS}
m
)
add_executable (yap-bin ${CONSOLE_SOURCES})

View File

@ -252,7 +252,7 @@ check_function_exists( labs HAVE_LABS )
check_function_exists( link HAVE_LINK)
check_function_exists( localtime HAVE_LOCALTIME )
check_function_exists( lstat HAVE_LSTAT )
check_function_exists(mallinfo HAVE_MALLINFO)
check_symbol_exists( mallinfo " malloc.h" HAVE_MALLINFO)
check_function_exists(mbscoll HAVE_MBSCOLL)
check_function_exists(mbscasecoll HAVE_MBSCASECOLL)
check_function_exists(mbsnrtowcs HAVE_MBSNRTOWCS)

View File

@ -1613,17 +1613,17 @@ signal. */
/* malloc_t */
#ifndef MALLOC_T
#cmakedefine MALLOC_T "${MALLOC_T}"
#define MALLOC_T "void *"
#endif
/* max number of threads, default 1 or 1024 */
#ifndef MAX_THRADS
#cmakedefine MAX_THREADS ${MAX_THREADS}
#ifndef MAX_THREADS
#define MAX_THREADS ${MAX_THREADS}
#endif
/* maximum amount of or-parallelism */
#ifndef MAX_WORKERS
#cmakedefine MAX_WORKERS ${MAX_WORKERS}
#define MAX_WORKERS ${MAX_WORKERS}
#endif
/* o not use realloc() from HP-UX 10.20 together with MPI */
@ -1818,37 +1818,37 @@ signal. */
/* use Doug Lea's malloc for all allocation */
#ifndef USE_DL_MALLOC
#cmakedefine USE_DL_MALLOC ${USE_DL_MALLOC}
#define USE_DL_MALLOC ${USE_DL_MALLOC}
#endif
/* use bignums/rationals in YAP code. */
#ifndef USE_GMP
#cmakedefine USE_GMP ${USE_GMP}
#define USE_GMP ${USE_GMP}
#endif
/* use Judy library for UDI indexing in YAP code. */
#ifndef USE_JUDY
#cmakedefine USE_JUDY ${USE_JUDY}
#define USE_JUDY ${USE_JUDY}
#endif
/* do not use our own locking routines */
#ifndef USE_PTHREAD_LOCKING
#cmakedefine USE_PTHREAD_LOCKING ${USE_PTHREAD_LOCKING}
#define USE_PTHREAD_LOCKING ${USE_PTHREAD_LOCKING}
#endif
/* use OS malloc for all allocation */
#ifndef USE_SYSTEM_MALLOC
#cmakedefine USE_SYSTEM_MALLOC ${USE_SYSTEM_MALLOC}
#define USE_SYSTEM_MALLOC ${USE_SYSTEM_MALLOC}
#endif
/* use mmap in or-parallel allocation */
#ifndef USE_SYSTEM_MMAP
#cmakedefine USE_SYSTEM_MMAP ${USE_SYSTEM_MMAP}
#define USE_SYSTEM_MMAP ${USE_SYSTEM_MMAP}
#endif
/* use shm in or-parallel allocation */
#ifndef USE_SYSTEM_SHM
#cmakedefine USE_SYSTEM_SHM ${USE_SYSTEM_SHM}
#define USE_SYSTEM_SHM ${USE_SYSTEM_SHM}
#endif
/* Whether daylight savings time offset is set via the altzone variable */

View File

@ -1,7 +1,7 @@
option (HORUS "enable HORUS graphical model tookit" ON)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
#cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)