X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=configure.ac;h=c16c0d78f1228e6d600080d19f4eec0177bd4c50;hb=09fd7a1e32362e536f282f30c2ad0b098fd60197;hp=4f4f2da7161199ee4d851a7ee4bcef7bac92b21d;hpb=a605ae954b9b9c378d6a0b21058f4b4b410f8ab7;p=apply-default-acl.git diff --git a/configure.ac b/configure.ac index 4f4f2da..c16c0d7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,23 +1,53 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - AC_PREREQ([2.68]) -AC_INIT([apply-default-acl], [0.0.5], [michael@orlitzky.com]) -AM_INIT_AUTOMAKE -AC_CONFIG_SRCDIR([src/apply-default-acl.c]) +AC_INIT([apply-default-acl], [0.4.0], [michael@orlitzky.com]) +AM_INIT_AUTOMAKE([-Wall foreign no-dist-gzip dist-xz]) AC_CONFIG_FILES([Makefile src/Makefile]) +AC_CONFIG_SRCDIR([src/apply-default-acl.c]) +AC_CONFIG_MACRO_DIRS([m4]) # Checks for programs. AC_PROG_CC +AM_PROG_AR # Predefined header checks. +AC_HEADER_DIRENT # dirent.h 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 sys/acl.h sys/libacl.h ]) -AC_CHECK_HEADERS([ sys/types.h unistd.h ]) +AC_HEADER_REQUIRE(acl/libacl.h) +AC_HEADER_REQUIRE(fcntl.h) +AC_HEADER_REQUIRE(getopt.h) +AC_HEADER_REQUIRE(libgen.h) +AC_HEADER_REQUIRE(linux/xattr.h) +AC_HEADER_REQUIRE(sys/acl.h) +AC_HEADER_REQUIRE(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_DIRECTORY], + [], + [AC_MSG_ERROR(missing required O_DIRECTORY flag in fcntl.h)], + [[#include ]]) +AC_CHECK_DECLS([O_NOFOLLOW], + [], + [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)], + [[#include ]]) +AC_CHECK_DECLS([O_PATH], + [], + [AC_MSG_ERROR(missing required O_PATH flag in fcntl.h)], + [[#define _GNU_SOURCE + #include ]]) + +# And check for the GNU/BSD extension asprintf(), which lets us avoid +# praying to the PATH_MAX gods while constructing long paths. +AC_CHECK_FUNC(asprintf, + [], + AC_MSG_ERROR(missing required asprintf function)) +LT_INIT AC_OUTPUT