AC_CHECK_HEADERS([ fcntl.h ftw.h getopt.h libgen.h limits.h sys/acl.h ])
AC_CHECK_HEADERS([ sys/libacl.h sys/types.h unistd.h ])
-LT_INIT
+# We need openat() with O_NOFOLLOW from POSIX-2008. Without them, we
+# can't operate securely; I would rather refuse to be built.
+AC_CHECK_FUNC(openat,
+ [],
+ AC_MSG_ERROR(missing required openat function))
+AC_CHECK_DECLS([O_NOFOLLOW],
+ [],
+ [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
+ [[#include <fcntl.h>]])
+LT_INIT
AC_OUTPUT