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)