X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cmake%2Fconfig-ix.cmake;h=27f2964038ba4084264a2017b4cc08a71e4a9913;hb=8f40b24ca13940ece7c401b73b902c05a4ee4481;hp=ca5e0bfe384cb8ae11ee942aad060732e793a711;hpb=6a660d4a438ba79d5d1aaccfe2ffecdef3d7d2f1;p=oota-llvm.git diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index ca5e0bfe384..27f2964038b 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -3,6 +3,12 @@ include(CheckLibraryExists) include(CheckSymbolExists) include(CheckFunctionExists) include(CheckCXXSourceCompiles) +include(TestBigEndian) + +if( UNIX AND NOT BEOS ) + # Used by check_symbol_exists: + set(CMAKE_REQUIRED_LIBRARIES m) +endif() # Helper macros and functions macro(add_cxx_include result files) @@ -62,7 +68,9 @@ check_include_file(sys/wait.h HAVE_SYS_WAIT_H) check_include_file(termios.h HAVE_TERMIOS_H) check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(utime.h HAVE_UTIME_H) +check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H) check_include_file(windows.h HAVE_WINDOWS_H) +check_include_file(fenv.h HAVE_FENV_H) # library checks if( NOT LLVM_ON_WIN32 ) @@ -84,6 +92,7 @@ check_symbol_exists(isnan cmath HAVE_ISNAN_IN_CMATH) 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(nearbyintf math.h HAVE_NEARBYINTF) check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO) check_symbol_exists(malloc_zone_statistics malloc/malloc.h HAVE_MALLOC_ZONE_STATISTICS) @@ -99,6 +108,9 @@ 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) check_symbol_exists(setenv stdlib.h HAVE_SETENV) +if ( LLVM_ON_WIN32 ) + check_symbol_exists(_chsize_s io.h HAVE__CHSIZE_S) +endif() check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC) if( LLVM_USING_GLIBC ) @@ -136,7 +148,6 @@ function(llvm_find_program name) mark_as_advanced(HAVE_${NAME}) else(LLVM_PATH_${NAME}) set(HAVE_${NAME} "" CACHE INTERNAL "Is ${name} available ?") - unset(LLVM_PATH_${NAME} CACHE) endif(LLVM_PATH_${NAME}) endfunction() @@ -158,6 +169,8 @@ if( NOT WIN32 ) check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG) endif() +check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) + include(GetTargetTriple) get_target_triple(LLVM_HOSTTRIPLE) @@ -188,26 +201,27 @@ elseif (LLVM_NATIVE_ARCH MATCHES "arm") set(LLVM_NATIVE_ARCH ARM) elseif (LLVM_NATIVE_ARCH MATCHES "mips") set(LLVM_NATIVE_ARCH Mips) -elseif (LLVM_NATIVE_ARCH MATCHES "pic16") - set(LLVM_NATIVE_ARCH "PIC16") elseif (LLVM_NATIVE_ARCH MATCHES "xcore") set(LLVM_NATIVE_ARCH XCore) elseif (LLVM_NATIVE_ARCH MATCHES "msp430") set(LLVM_NATIVE_ARCH MSP430) else () - message(STATUS + message(STATUS "Unknown architecture ${LLVM_NATIVE_ARCH}; lli will not JIT code") set(LLVM_NATIVE_ARCH) endif () - + if (LLVM_NATIVE_ARCH) list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX) if (NATIVE_ARCH_IDX EQUAL -1) - message(STATUS + message(STATUS "Native target ${LLVM_NATIVE_ARCH} is not selected; lli will not JIT code") set(LLVM_NATIVE_ARCH) else () message(STATUS "Native target architecture is ${LLVM_NATIVE_ARCH}") + set(LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target) + set(LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo) + set(LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter) endif () endif() @@ -253,13 +267,20 @@ else( ENABLE_THREADS ) message(STATUS "Threads disabled.") endif() +set(LLVM_PREFIX ${CMAKE_INSTALL_PREFIX}) + configure_file( ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/config.h.cmake ${LLVM_BINARY_DIR}/include/llvm/Config/config.h ) configure_file( - ${LLVM_MAIN_INCLUDE_DIR}/llvm/System/DataTypes.h.cmake - ${LLVM_BINARY_DIR}/include/llvm/System/DataTypes.h + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config.h.cmake + ${LLVM_BINARY_DIR}/include/llvm/Config/llvm-config.h + ) + +configure_file( + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake + ${LLVM_BINARY_DIR}/include/llvm/Support/DataTypes.h )