]> gitweb.michael.orlitzky.com - apply-default-acl.git/blobdiff - configure.ac
libadacl.c: use O_PATH in safe_open() for added safety.
[apply-default-acl.git] / configure.ac
index 2df766b6a77383d45bf588f811a0387c5641d8f7..c9abffe2ddf21acb9769e734e58d80ba3bee6a3e 100644 (file)
@@ -1,21 +1,32 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
 AC_PREREQ([2.68])
-AC_INIT([apply-default-acl], [0.0.3], [michael@orlitzky.com])
-AM_INIT_AUTOMAKE
+AC_INIT([apply-default-acl], [0.1.3], [michael@orlitzky.com])
+AM_INIT_AUTOMAKE([-Wall foreign no-dist-gzip dist-xz])
 AC_CONFIG_SRCDIR([src/apply-default-acl.c])
 AC_CONFIG_FILES([Makefile src/Makefile])
 
 # Checks for programs.
 AC_PROG_CC
+AM_PROG_AR
 
-# Checks for header files.
-AC_CHECK_HEADERS([limits.h stdlib.h string.h sys/acl.h unistd.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STDBOOL
+# Predefined header checks.
+AC_HEADER_STAT    # sys/stat.h
+AC_HEADER_STDBOOL # stdbool.h
+AC_HEADER_STDC    # stdlib.h string.h (implied: errno.h limits.h stdio.h)
 AC_TYPE_MODE_T
 
+# Check for header files not covered by the predefined macros above.
+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 ])
+
+# 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