]> granicus.if.org Git - check/commitdiff
cmake: include getline.c into libcompat if getline() is missing
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 3 Jul 2014 18:43:49 +0000 (18:43 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 3 Jul 2014 18:43:49 +0000 (18:43 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1174 64e312b2-a51f-0410-8e61-82d0ca0eb02a

CMakeLists.txt
lib/CMakeLists.txt

index 36b131fd3ac0fead07d57206f7f8dc4c37816bba..e0e3789a73c8fb0a87977b33f46cf004fdd7fe49 100644 (file)
@@ -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)
index 458621bd473916ec546d11e8fbed1d8f6ee47a91..7f903ec4b893dc080da1667a1ffb66265964efcd 100644 (file)
@@ -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)