]> gitweb.michael.orlitzky.com - apply-default-acl.git/blob - configure.ac
5b10ac690b535c4e41ec68ab08e0477a667bacaa
[apply-default-acl.git] / configure.ac
1 AC_PREREQ([2.68])
2 AC_INIT([apply-default-acl], [0.3.0], [michael@orlitzky.com])
3 AM_INIT_AUTOMAKE([-Wall foreign no-dist-gzip dist-xz])
4 AC_CONFIG_SRCDIR([src/apply-default-acl.c])
5 AC_CONFIG_FILES([Makefile src/Makefile])
6
7 # Checks for programs.
8 AC_PROG_CC
9 AM_PROG_AR
10
11 # Predefined header checks.
12 AC_HEADER_STAT # sys/stat.h
13 AC_HEADER_STDBOOL # stdbool.h
14 AC_HEADER_STDC # stdlib.h string.h (implied: errno.h limits.h stdio.h)
15
16 # Check for header files not covered by the predefined macros above.
17 AC_CHECK_HEADERS([ fcntl.h getopt.h libgen.h limits.h linux/xattr.h ])
18 AC_CHECK_HEADERS([ sys/acl.h sys/libacl.h sys/types.h unistd.h ])
19
20 # We need openat() with O_NOFOLLOW from POSIX-2008. Without them, we
21 # can't operate securely; I would rather refuse to be built.
22 AC_CHECK_FUNC(openat,
23 [],
24 AC_MSG_ERROR(missing required openat function))
25 AC_CHECK_DECLS([O_DIRECTORY],
26 [],
27 [AC_MSG_ERROR(missing required O_DIRECTORY flag in fcntl.h)],
28 [[#include <fcntl.h>]])
29 AC_CHECK_DECLS([O_NOFOLLOW],
30 [],
31 [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
32 [[#include <fcntl.h>]])
33 AC_CHECK_DECLS([O_PATH],
34 [],
35 [AC_MSG_ERROR(missing required O_PATH flag in fcntl.h)],
36 [[#define _GNU_SOURCE
37 #include <fcntl.h>]])
38
39 LT_INIT
40 AC_OUTPUT