From 9590c532b892743040b7a3ea8a8308098e1aff1e Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Fri, 26 Feb 2016 17:01:45 +0000 Subject: [PATCH] [CMAKE] Update build on recent Haiku MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch updates cmake build scripts to build on Haiku. It adds Haiku x86_64 to config.guess. Please consider reviewing. Pathc by Jérôme Duval. llvm-svn: 262038 --- llvm/cmake/config-ix.cmake | 2 +- llvm/cmake/config.guess | 3 +++ llvm/include/llvm/Support/Host.h | 2 +- llvm/lib/Support/CMakeLists.txt | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index f699211..c5be442 100755 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -13,7 +13,7 @@ include(TestBigEndian) include(HandleLLVMStdlib) -if( UNIX AND NOT BEOS ) +if( UNIX AND NOT (BEOS OR HAIKU) ) # Used by check_symbol_exists: set(CMAKE_REQUIRED_LIBRARIES m) endif() diff --git a/llvm/cmake/config.guess b/llvm/cmake/config.guess index b209a1a..8bf4226 100644 --- a/llvm/cmake/config.guess +++ b/llvm/cmake/config.guess @@ -1203,6 +1203,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) # Haiku running on x86_64. + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h index 8f4bf3c..8114f9b 100644 --- a/llvm/include/llvm/Support/Host.h +++ b/llvm/include/llvm/Support/Host.h @@ -16,7 +16,7 @@ #include "llvm/ADT/StringMap.h" -#if defined(__linux__) || defined(__GNU__) +#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) #include #else #if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32) diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index 0eb4a61..bccbdfc 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -23,7 +23,9 @@ elseif( CMAKE_HOST_UNIX ) if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ ) set(system_libs ${system_libs} z) endif() - set(system_libs ${system_libs} m) + if( UNIX AND NOT (BEOS OR HAIKU) ) + set(system_libs ${system_libs} m) + endif() endif( MSVC OR MINGW ) add_llvm_library(LLVMSupport -- 2.7.4