X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=cmake%2Fconfig-ix.cmake;h=d0d8531bff3b7ba2da8564fce6f9c168c1d8d60d;hb=03ccdb5b1dbb95714f2fd86540292567c8442a6b;hp=e5bcc0e9b11a28ed6c15e8976d92690f476649d9;hpb=dfa0e92fa034019252305d62e42387bf6a758500;p=oota-llvm.git diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index e5bcc0e9b11..d0d8531bff3 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -4,6 +4,7 @@ if( WIN32 AND NOT CYGWIN ) endif() include(CheckIncludeFile) +include(CheckIncludeFileCXX) include(CheckLibraryExists) include(CheckSymbolExists) include(CheckFunctionExists) @@ -37,7 +38,7 @@ endfunction() check_include_file(argz.h HAVE_ARGZ_H) check_include_file(assert.h HAVE_ASSERT_H) check_include_file(ctype.h HAVE_CTYPE_H) -check_include_file(cxxabi.h HAVE_CXXABI_H) +check_include_file_cxx(cxxabi.h HAVE_CXXABI_H) check_include_file(dirent.h HAVE_DIRENT_H) check_include_file(dl.h HAVE_DL_H) check_include_file(dld.h HAVE_DLD_H) @@ -339,12 +340,13 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif() endif() -include(GetHostTriple) -get_host_triple(LLVM_HOST_TRIPLE) - # By default, we target the host, but this can be overridden at CMake # invocation time. -set(LLVM_HOSTTRIPLE "${LLVM_HOST_TRIPLE}") +include(GetHostTriple) +get_host_triple(LLVM_INFERRED_HOST_TRIPLE) + +set(LLVM_HOST_TRIPLE "${LLVM_INFERRED_HOST_TRIPLE}" CACHE STRING + "Host on which LLVM binaries will run") # Determine the native architecture. string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH) @@ -364,6 +366,8 @@ elseif (LLVM_NATIVE_ARCH MATCHES "sparc") set(LLVM_NATIVE_ARCH Sparc) elseif (LLVM_NATIVE_ARCH MATCHES "powerpc") set(LLVM_NATIVE_ARCH PowerPC) +elseif (LLVM_NATIVE_ARCH MATCHES "aarch64") + set(LLVM_NATIVE_ARCH AArch64) elseif (LLVM_NATIVE_ARCH MATCHES "arm") set(LLVM_NATIVE_ARCH ARM) elseif (LLVM_NATIVE_ARCH MATCHES "mips") @@ -374,10 +378,20 @@ elseif (LLVM_NATIVE_ARCH MATCHES "msp430") set(LLVM_NATIVE_ARCH MSP430) elseif (LLVM_NATIVE_ARCH MATCHES "hexagon") set(LLVM_NATIVE_ARCH Hexagon) +elseif (LLVM_NATIVE_ARCH MATCHES "s390x") + set(LLVM_NATIVE_ARCH SystemZ) else () message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}") endif () +# If build targets includes "host", then replace with native architecture. +list(FIND LLVM_TARGETS_TO_BUILD "host" idx) +if( NOT idx LESS 0 ) + list(REMOVE_AT LLVM_TARGETS_TO_BUILD ${idx}) + list(APPEND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH}) + list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD) +endif() + list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX) if (NATIVE_ARCH_IDX EQUAL -1) message(STATUS @@ -410,7 +424,6 @@ endif( MINGW ) if( MSVC ) set(error_t int) - set(LTDL_SHLIBPATH_VAR "PATH") set(LTDL_SYSSEARCHPATH "") set(LTDL_DLOPEN_DEPLIBS 1) set(SHLIBEXT ".lib") @@ -421,7 +434,6 @@ if( MSVC ) set(stricmp "_stricmp") set(strdup "_strdup") else( MSVC ) - set(LTDL_SHLIBPATH_VAR "LD_LIBRARY_PATH") set(LTDL_SYSSEARCHPATH "") # TODO set(LTDL_DLOPEN_DEPLIBS 0) # TODO endif( MSVC )