From fb3f4e690672c342d0bf050ce15a0d80365d3c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 17 Feb 2019 19:40:16 +0100 Subject: Add CMake check if the getline function is defined instead of listing the systems and versions that need to be defined. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This resolves FTBFS on FreeBSD 12. Signed-off-by: Slávek Banko (cherry picked from commit 0542509fc175c7b5a76cd31901834a2530ae4718) --- ConfigureChecks.cmake | 1 + config.h.cmake | 3 +++ vcs/clearcase/CMakeLists.txt | 1 + vcs/clearcase/clearcasemanipulator.cpp | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index d46b7e33..83bcbfc6 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -31,6 +31,7 @@ endif( ) check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H ) check_function_exists( "mkfifo" HAVE_MKFIFO ) +check_symbol_exists( "getline" "stdio.h" HAVE_GETLINE ) ##### check for berkeley db #################### diff --git a/config.h.cmake b/config.h.cmake index 790ee5b3..86f9566a 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -8,3 +8,6 @@ // lib/catalog #cmakedefine USE_DB_H_PATH <@USE_DB_H_PATH@> + +// vcs/clearcase +#cmakedefine HAVE_GETLINE 1 diff --git a/vcs/clearcase/CMakeLists.txt b/vcs/clearcase/CMakeLists.txt index 4dbed390..90d83940 100644 --- a/vcs/clearcase/CMakeLists.txt +++ b/vcs/clearcase/CMakeLists.txt @@ -13,6 +13,7 @@ add_subdirectory( integrator ) include_directories( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib/interfaces ${CMAKE_SOURCE_DIR}/lib/interfaces/extensions ${CMAKE_SOURCE_DIR}/lib/util diff --git a/vcs/clearcase/clearcasemanipulator.cpp b/vcs/clearcase/clearcasemanipulator.cpp index 5c9563f9..65f05c4e 100644 --- a/vcs/clearcase/clearcasemanipulator.cpp +++ b/vcs/clearcase/clearcasemanipulator.cpp @@ -9,6 +9,7 @@ // Copyright: See COPYING file that comes with this distribution // // +#include "config.h" #include "clearcasemanipulator.h" #include @@ -23,9 +24,8 @@ #include #endif -#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) || (defined(__NetBSD__) && (__NetBSD_Version__ < 599001500)) || defined(__DragonFly__) +#if !defined( HAVE_GETLINE ) //this function is taken from GNU libc -//it does not exist on macos int getline(char **lineptr, size_t *n, FILE *stream) { static char line[256]; -- cgit v1.2.3