summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2011-01-31 18:25:25 +0000
committerOscar Fuentes <ofv@wanadoo.es>2011-01-31 18:25:25 +0000
commit78e2074eeeee266f4b6b212800f00e9acddecb15 (patch)
tree8da51a08f42fbb365a48f69eaf52ad6c5ec8a30c /cmake
parent4e3740ee6ddfc5895061245364de21e3f73517fe (diff)
downloadllvm-78e2074eeeee266f4b6b212800f00e9acddecb15.tar.gz
llvm-78e2074eeeee266f4b6b212800f00e9acddecb15.tar.bz2
llvm-78e2074eeeee266f4b6b212800f00e9acddecb15.tar.xz
Adds some platform checks to cmake/config-ix.cmake and fixes checking
for dlopen/dlerror. Patch by arrowdodger! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/config-ix.cmake30
1 files changed, 27 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 4a87a23aed..4cb68dfb1a 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -89,6 +89,7 @@ check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE)
check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT)
check_function_exists(isatty HAVE_ISATTY)
+check_symbol_exists(index strings.h HAVE_INDEX)
check_symbol_exists(isinf cmath HAVE_ISINF_IN_CMATH)
check_symbol_exists(isinf math.h HAVE_ISINF_IN_MATH_H)
check_symbol_exists(finite ieeefp.h HAVE_FINITE_IN_IEEEFP_H)
@@ -97,6 +98,12 @@ check_symbol_exists(isnan math.h HAVE_ISNAN_IN_MATH_H)
check_symbol_exists(ceilf math.h HAVE_CEILF)
check_symbol_exists(floorf math.h HAVE_FLOORF)
check_symbol_exists(fmodf math.h HAVE_FMODF)
+if( HAVE_SETJMP_H )
+ check_symbol_exists(longjmp setjmp.h HAVE_LONGJMP)
+ check_symbol_exists(setjmp setjmp.h HAVE_SETJMP)
+ check_symbol_exists(siglongjmp setjmp.h HAVE_SIGLONGJMP)
+ check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP)
+endif()
check_symbol_exists(nearbyintf math.h HAVE_NEARBYINTF)
check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
check_symbol_exists(malloc_zone_statistics malloc/malloc.h
@@ -106,9 +113,11 @@ check_symbol_exists(mkstemp "stdlib.h;unistd.h" HAVE_MKSTEMP)
check_symbol_exists(mktemp "stdlib.h;unistd.h" HAVE_MKTEMP)
check_symbol_exists(closedir "sys/types.h;dirent.h" HAVE_CLOSEDIR)
check_symbol_exists(opendir "sys/types.h;dirent.h" HAVE_OPENDIR)
+check_symbol_exists(readdir "sys/types.h;dirent.h" HAVE_READDIR)
check_symbol_exists(getcwd unistd.h HAVE_GETCWD)
check_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
check_symbol_exists(getrlimit "sys/types.h;sys/time.h;sys/resource.h" HAVE_GETRLIMIT)
+check_symbol_exists(rindex strings.h HAVE_RINDEX)
check_symbol_exists(strchr string.h HAVE_STRCHR)
check_symbol_exists(strcmp string.h HAVE_STRCMP)
check_symbol_exists(strdup string.h HAVE_STRDUP)
@@ -117,7 +126,18 @@ if( NOT LLVM_ON_WIN32 )
check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
endif()
check_symbol_exists(sbrk unistd.h HAVE_SBRK)
+check_symbol_exists(srand48 stdlib.h HAVE_RAND48_SRAND48)
+if( HAVE_RAND48_SRAND48 )
+ check_symbol_exists(lrand48 stdlib.h HAVE_RAND48_LRAND48)
+ if( HAVE_RAND48_LRAND48 )
+ check_symbol_exists(drand48 stdlib.h HAVE_RAND48_DRAND48)
+ if( HAVE_RAND48_DRAND48 )
+ set(HAVE_RAND48 1 CACHE INTERNAL "are srand48/lrand48/drand48 available?")
+ endif()
+ endif()
+endif()
check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
+check_symbol_exists(strtoq stdlib.h HAVE_STRTOQ)
check_symbol_exists(strerror string.h HAVE_STRERROR)
check_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
check_symbol_exists(strerror_s string.h HAVE_STRERROR_S)
@@ -134,11 +154,15 @@ if( HAVE_ARGZ_H )
check_symbol_exists(argz_next argz.h HAVE_ARGZ_NEXT)
check_symbol_exists(argz_stringify argz.h HAVE_ARGZ_STRINGIFY)
endif()
-if( HAVE_DLFCN_H AND HAVE_LIBDL )
- list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
+if( HAVE_DLFCN_H )
+ if( HAVE_LIBDL )
+ list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
+ endif()
check_symbol_exists(dlerror dlfcn.h HAVE_DLERROR)
check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
- list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
+ if( HAVE_LIBDL )
+ list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
+ endif()
endif()
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)