From: brarcher Date: Thu, 3 Jul 2014 18:43:49 +0000 (+0000) Subject: cmake: include getline.c into libcompat if getline() is missing X-Git-Tag: 0.10.0~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=408f9a3fd46cbf1ef6e78926654bda3cbc753578;p=check cmake: include getline.c into libcompat if getline() is missing git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1174 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 36b131f..e0e3789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,7 @@ ck_check_include_file("time.h" HAVE_TIME_H) ############################################################################### # Check functions check_function_exists(fork HAVE_FORK) +check_function_exists(getline HAVE_GETLINE) check_function_exists(getpid HAVE_GETPID) check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) check_function_exists(localtime_r HAVE_DECL_LOCALTIME_R) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 458621b..7f903ec 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -28,6 +28,10 @@ if (NOT HAVE_LIBRT) set(SOURCES ${SOURCES} timer_settime.c) endif(NOT HAVE_LIBRT) +if(NOT HAVE_GETLINE) + set(SOURCES ${SOURCES} getline.c) +endif(NOT HAVE_GETLINE) + if(NOT HAVE_GETTIMEOFDAY) set(SOURCES ${SOURCES} gettimeofday.c) endif(NOT HAVE_GETTIMEOFDAY)