From 0a1ca5e1cc883c08b7ba069bd0065672d2674a25 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Fri, 2 Oct 2009 00:45:10 +0000 Subject: [PATCH] make compilation succeed on macosx; this will still run macs out of disk space. Also, it disables a number of binaries that probably should be supported on macs. --- CMakeLists.txt | 8 ++++++++ benchmarks/CMakeLists.txt | 6 +++++- src/apps/referential/CMakeLists.txt | 2 ++ test/stasis/fault_injection/CMakeLists.txt | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f3808c..988a0bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,14 @@ int main(int argc, char * argv[]) { } " HAVE_O_DIRECT) +CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE +#include + +int main(int argc, char * argv[]) { + getline(0,0,0); +} +" HAVE_GETLINE) + MACRO(CREATE_CHECK NAME) ADD_EXECUTABLE(${NAME} ${NAME}.c) TARGET_LINK_LIBRARIES(${NAME} ${COMMON_LIBRARIES}) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 193692a..fb14bb0 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,3 +1,4 @@ +IF(HAVE_GETLINE) ADD_EXECUTABLE(rose rose.cpp) TARGET_LINK_LIBRARIES(rose ${COMMON_LIBRARIES}) @@ -10,6 +11,9 @@ TARGET_LINK_LIBRARIES(roseTableTpcCH-workload1 ${COMMON_LIBRARIES}) ADD_EXECUTABLE(roseTableTpcCH-workload2 roseTableTpcCH-workload2.cpp) TARGET_LINK_LIBRARIES(roseTableTpcCH-workload2 ${COMMON_LIBRARIES}) +ENDIF(HAVE_GETLINE) + + CREATE_EXECUTABLE(lhtableThreaded) CREATE_EXECUTABLE(naiveHash) CREATE_EXECUTABLE(naiveMultiThreaded) @@ -30,4 +34,4 @@ CREATE_EXECUTABLE(distributedLsnFree) IF(CHECK_LIBRARY) ADD_TEST(rose rose) ENDIF(CHECK_LIBRARY) -CREATE_EXECUTABLE(slotted) \ No newline at end of file +CREATE_EXECUTABLE(slotted) diff --git a/src/apps/referential/CMakeLists.txt b/src/apps/referential/CMakeLists.txt index d075351..26b4c50 100644 --- a/src/apps/referential/CMakeLists.txt +++ b/src/apps/referential/CMakeLists.txt @@ -1,3 +1,4 @@ +if(HAVE_GETLINE) SUBDIRS(lang) ADD_LIBRARY(referential algebra.c dml.c ddl.c tuple.c lang/ast.c) TARGET_LINK_LIBRARIES(referential ${COMMON_LIBRARIES}) @@ -5,3 +6,4 @@ SET(COMMON_LIBRARIES referential refparse ${COMMON_LIBRARIES}) IF(CHECK_LIBRARY) CREATE_CHECK_OPT(toplevel ${CMAKE_CURRENT_SOURCE_DIR}/test-script.ref) ENDIF(CHECK_LIBRARY) +endif(HAVE_GETLINE) diff --git a/test/stasis/fault_injection/CMakeLists.txt b/test/stasis/fault_injection/CMakeLists.txt index 4a7884b..3349609 100644 --- a/test/stasis/fault_injection/CMakeLists.txt +++ b/test/stasis/fault_injection/CMakeLists.txt @@ -1,3 +1,4 @@ +IF(HAVE_GETLINE) # XXX HACK. Assume we're not on linux if we don't have getline, then don't even try to get this directory to build. ADD_EXECUTABLE(check_faultInjection fitest.c fisubject.c fichecker.c) TARGET_LINK_LIBRARIES(check_faultInjection ${COMMON_LIBRARIES}) @@ -12,3 +13,4 @@ CONFIGURE_FILE( COPYONLY ) ADD_TEST(check_faultInjection check_faultInjection) +ENDIF(HAVE_GETLINE)