diff --git a/cmake/config/common.cmake b/cmake/config/common.cmake index 2e31bf4dd9..be69a892fd 100644 --- a/cmake/config/common.cmake +++ b/cmake/config/common.cmake @@ -36,6 +36,7 @@ EFL_OPTION(ENABLE_VALGRIND "Enable valgrind support" "${SUGGEST_VALGRIND}" DEPEN HEADER_CHECK(alloca.h) HEADER_CHECK(asm/hwcap.h) +HEADER_CHECK(bsd/string.h) HEADER_CHECK(dirent.h) HEADER_CHECK(execinfo.h) HEADER_CHECK(mcheck.h) @@ -80,7 +81,12 @@ FUNC_CHECK(shm_open INCLUDE_FILES sys/mman.h sys/stat.h fcntl.h LIBRARIES rt) FUNC_CHECK(siglongjmp INCLUDE_FILES setjmp.h) FUNC_CHECK(splice INCLUDE_FILES fcntl.h DEFINITIONS "-D_GNU_SOURCE=1") FUNC_CHECK(strerror_r INCLUDE_FILES string.h) -FUNC_CHECK(strlcpy INCLUDE_FILES bsd/string.h) + +if(HAVE_BSD_STRING_H) + FUNC_CHECK(strlcpy INCLUDE_FILES bsd/string.h LIBRARIES bsd) +else() + FUNC_CHECK(strlcpy INCLUDE_FILES string.h) +endif() TYPE_CHECK(siginfo_t INCLUDE_FILES signal.h) diff --git a/src/lib/eina/CMakeLists.txt b/src/lib/eina/CMakeLists.txt index bd23e782e8..4c5ee50faa 100644 --- a/src/lib/eina/CMakeLists.txt +++ b/src/lib/eina/CMakeLists.txt @@ -22,6 +22,10 @@ set(LIBRARIES rt ) +if(HAVE_BSD_STRING_H) + list(APPEND LIBRARIES bsd) +endif() + set(PUBLIC_HEADERS Eina.h eina_accessor.h diff --git a/src/lib/eina/eina_str.c b/src/lib/eina/eina_str.c index dcf93c3ca4..b9f0c034ff 100644 --- a/src/lib/eina/eina_str.c +++ b/src/lib/eina/eina_str.c @@ -28,6 +28,10 @@ #include #include +#ifdef HAVE_BSD_STRING_H +# include +#endif + #ifdef HAVE_ICONV # include # include