summaryrefslogtreecommitdiff
path: root/configure.cmake
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-01-15 01:34:26 +0100
committerSergei Golubchik <serg@mariadb.org>2018-01-15 15:57:04 +0100
commitd8001106c97db246b33b977c09986beea22941bb (patch)
treec5896bead5c4ac1a0ffff0a188f44722f33e2b29 /configure.cmake
parentd31ee64da68a8fee9334c7b0bcab98cb636af36f (diff)
downloadmariadb-git-d8001106c97db246b33b977c09986beea22941bb.tar.gz
MDEV-14469 build with cmake -DMYSQL_MAINTAINER_MODE=ON fails: 'readdir_r' is deprecated
1. test readdir_r() availability under -Werror 2. don't protect readdir() with mutexes, it's not needed for the way we use readdir()
Diffstat (limited to 'configure.cmake')
-rw-r--r--configure.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/configure.cmake b/configure.cmake
index 4051b553747..470fb719fb8 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -407,7 +407,6 @@ CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
CHECK_FUNCTION_EXISTS (pthread_threadmask HAVE_PTHREAD_THREADMASK)
CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP)
CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV)
-CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R)
CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK)
CHECK_FUNCTION_EXISTS (re_comp HAVE_RE_COMP)
CHECK_FUNCTION_EXISTS (regcomp HAVE_REGCOMP)
@@ -465,6 +464,16 @@ IF(HAVE_SYS_EVENT_H)
CHECK_FUNCTION_EXISTS (kqueue HAVE_KQUEUE)
ENDIF()
+# readdir_r might exist, but be marked deprecated
+SET(CMAKE_REQUIRED_FLAGS -Werror)
+CHECK_CXX_SOURCE_COMPILES(
+"#include <dirent.h>
+int main() {
+ readdir_r(0,0,0);
+ return 0;
+ }" HAVE_READDIR_R)
+SET(CMAKE_REQUIRED_FLAGS)
+
#--------------------------------------------------------------------
# Support for WL#2373 (Use cycle counter for timing)
#--------------------------------------------------------------------