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)
"#include <dirent.h>\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 <unistd.h>\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,
ENDIF(MSVC)
IF(ENABLE_TEST)
-ADD_CUSTOM_TARGET(run_all_tests)
+ ADD_CUSTOM_TARGET(run_all_tests)
ENDIF(ENABLE_TEST)
add_subdirectory(libarchive)