aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <doug.gregor@gmail.com>2009-06-05 23:46:34 +0000
committerDouglas Gregor <doug.gregor@gmail.com>2009-06-05 23:46:34 +0000
commit5d8931b1f32da14c80befa3c87c4c5f966ffdb13 (patch)
tree1eaf4dc7a831b0386b5586653499d8b7eda1d8fb
parent7388a9ac0d5834359ec19fbcd25a1d89b4415629 (diff)
downloadexternal_llvm-5d8931b1f32da14c80befa3c87c4c5f966ffdb13.zip
external_llvm-5d8931b1f32da14c80befa3c87c4c5f966ffdb13.tar.gz
external_llvm-5d8931b1f32da14c80befa3c87c4c5f966ffdb13.tar.bz2
More portability checks for CMake's config.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72975 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt4
-rwxr-xr-xcmake/config-ix.cmake3
-rw-r--r--include/llvm/Config/config.h.cmake8
3 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0de1e08..8133398 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -150,11 +150,13 @@ include(config-ix)
option(LLVM_ENABLE_PIC "Build Position-Independent Code" OFF)
+set(ENABLE_PIC 0)
if( LLVM_ENABLE_PIC )
if( SUPPORTS_FPIC_FLAG )
message(STATUS "Building with -fPIC")
add_llvm_definitions(-fPIC)
- else( SUPPORTS_FPIC_FLAG )
+ set(ENABLE_PIC 1)
+ else( SUPPORTS_FPIC_FLAG )
message(STATUS "Warning: -fPIC not supported.")
endif()
endif()
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 7cddf59..c18ac44 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -1,6 +1,7 @@
# include checks
include(CheckIncludeFile)
+check_include_file(alloca.h HAVE_ALLOCA_H)
check_include_file(argz.h HAVE_ARGZ_H)
check_include_file(assert.h HAVE_ASSERT_H)
check_include_file(dirent.h HAVE_DIRENT_H)
@@ -34,6 +35,7 @@ check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+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)
@@ -47,6 +49,7 @@ check_library_exists(dl dlopen "" HAVE_LIBDL)
# function checks
include(CheckSymbolExists)
include(CheckFunctionExists)
+check_symbol_exists(alloca alloca.h HAVE_ALLOCA)
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)
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index ed77874..33e2e00 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -18,17 +18,17 @@
#undef ENABLE_CBE_PRINTF_A
/* Define if position independent code is enabled */
-#undef ENABLE_PIC
+#cmakedefine ENABLE_PIC ${ENABLE_PIC}
/* Define if threads enabled */
#cmakedefine ENABLE_THREADS ${ENABLE_THREADS}
/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
+#cmakedefine HAVE_ALLOCA ${HAVE_ALLOCA}
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
-#undef HAVE_ALLOCA_H
+#cmakedefine HAVE_ALLOCA_H ${HAVE_ALLOCA_H}
/* Define to 1 if you have the `argz_append' function. */
#undef HAVE_ARGZ_APPEND
@@ -414,7 +414,7 @@
#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
+#cmakedefine HAVE_SYS_WAIT_H ${HAVE_SYS_WAIT_H}
/* Define to 1 if the system has the type `uint64_t'. */
#undef HAVE_UINT64_T