From: Tim Kientzle Date: Wed, 20 Apr 2011 05:49:49 +0000 (-0400) Subject: Fix probe for readlinkat(). In particular, it was X-Git-Tag: v3.0.0a~429 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df401b4a2132d9a7eaded8229485033c57e7ffe3;p=thirdparty%2Flibarchive.git Fix probe for readlinkat(). In particular, it was mis-probed on some older versions of GNU libc. SVN-Revision: 3257 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4525cda7b..c9aa60ddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -630,7 +630,6 @@ CHECK_FUNCTION_EXISTS_GLIBC(openat HAVE_OPENAT) CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE) CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL) CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK) -CHECK_FUNCTION_EXISTS_GLIBC(readlinkat HAVE_READLINKAT) CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT) CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE) @@ -677,6 +676,13 @@ CHECK_C_SOURCE_COMPILES( "#include \nint main() {DIR *d; struct dirent e,*r; return readdir_r(d,&e,&r);}" HAVE_READDIR_R) + +# Only detect readlinkat() if we also have AT_FDCWD in unistd.h. +CHECK_C_SOURCE_COMPILES( + "#include \nint main() {return readlinkat(AT_FDCWD, NULL, 0);}" + HAVE_READLINKAT) + + # To verify major(), we need to both include the header # of interest and verify that the result can be linked. # CHECK_FUNCTION_EXISTS doesn't accept a header argument, @@ -1026,7 +1032,7 @@ IF(MSVC) ENDIF(MSVC) IF(ENABLE_TEST) -ADD_CUSTOM_TARGET(run_all_tests) + ADD_CUSTOM_TARGET(run_all_tests) ENDIF(ENABLE_TEST) add_subdirectory(libarchive)