aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/config-ix.cmake
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-12-01 14:51:49 -0800
committerStephen Hines <srhines@google.com>2014-12-02 16:08:10 -0800
commit37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch)
tree8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /cmake/config-ix.cmake
parentd2327b22152ced7bc46dc629fc908959e8a52d03 (diff)
downloadexternal_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'cmake/config-ix.cmake')
-rwxr-xr-xcmake/config-ix.cmake32
1 files changed, 29 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index b862ceb..5204f6c 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -42,7 +42,6 @@ function(check_type_exists type files variable)
endfunction()
# include checks
-check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
check_include_file(dirent.h HAVE_DIRENT_H)
check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(errno.h HAVE_ERRNO_H)
@@ -50,6 +49,7 @@ check_include_file(execinfo.h HAVE_EXECINFO_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(limits.h HAVE_LIMITS_H)
+check_include_file(link.h HAVE_LINK_H)
check_include_file(malloc.h HAVE_MALLOC_H)
check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H)
check_include_file(ndir.h HAVE_NDIR_H)
@@ -80,6 +80,13 @@ check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT)
check_include_file(mach/mach.h HAVE_MACH_MACH_H)
check_include_file(mach-o/dyld.h HAVE_MACH_O_DYLD_H)
+# size_t must be defined before including cxxabi.h on FreeBSD 10.0.
+check_cxx_source_compiles("
+#include <stddef.h>
+#include <cxxabi.h>
+int main() { return 0; }
+" HAVE_CXXABI_H)
+
# library checks
if( NOT PURE_WINDOWS )
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
@@ -258,12 +265,12 @@ endif ()
if( LLVM_ENABLE_FFI )
find_path(FFI_INCLUDE_PATH ffi.h PATHS ${FFI_INCLUDE_DIR})
- if( FFI_INCLUDE_PATH )
+ if( EXISTS "${FFI_INCLUDE_PATH}/ffi.h" )
set(FFI_HEADER ffi.h CACHE INTERNAL "")
set(HAVE_FFI_H 1 CACHE INTERNAL "")
else()
find_path(FFI_INCLUDE_PATH ffi/ffi.h PATHS ${FFI_INCLUDE_DIR})
- if( FFI_INCLUDE_PATH )
+ if( EXISTS "${FFI_INCLUDE_PATH}/ffi/ffi.h" )
set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "")
set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "")
endif()
@@ -490,3 +497,22 @@ if (LLVM_ENABLE_SPHINX)
else()
message(STATUS "Sphinx disabled.")
endif()
+
+set(LLVM_BINDINGS "")
+if(WIN32)
+ message(STATUS "Go bindings disabled.")
+else()
+ find_program(GO_EXECUTABLE NAMES go DOC "go executable")
+ if(GO_EXECUTABLE STREQUAL "GO_EXECUTABLE-NOTFOUND")
+ message(STATUS "Go bindings disabled.")
+ else()
+ execute_process(COMMAND ${GO_EXECUTABLE} run ${CMAKE_SOURCE_DIR}/bindings/go/conftest.go
+ RESULT_VARIABLE GO_CONFTEST)
+ if(GO_CONFTEST STREQUAL "0")
+ set(LLVM_BINDINGS "${LLVM_BINDINGS} go")
+ message(STATUS "Go bindings enabled.")
+ else()
+ message(STATUS "Go bindings disabled, need at least Go 1.2.")
+ endif()
+ endif()
+endif()