]> gitweb.michael.orlitzky.com - apply-default-acl.git/blob - configure.ac
configure.ac: place build artifacts in the "build-aux" directory.
[apply-default-acl.git] / configure.ac
1 AC_PREREQ([2.68])
2 AC_INIT([apply-default-acl], [0.4.2], [michael@orlitzky.com])
3 # Store build artifacts in this directory to keep the house clean.
4 AC_CONFIG_AUX_DIR([build-aux])
5 AM_INIT_AUTOMAKE([-Wall foreign no-dist-gzip dist-xz tar-ustar])
6 AC_CONFIG_FILES([Makefile src/Makefile])
7 AC_CONFIG_SRCDIR([src/apply-default-acl.c])
8 AC_CONFIG_MACRO_DIRS([m4])
9
10 # Checks for programs.
11 AC_PROG_CC
12 AM_PROG_AR
13
14 # Predefined header checks.
15 AC_HEADER_DIRENT # dirent.h
16 AC_HEADER_STAT # sys/stat.h
17 AC_HEADER_STDBOOL # stdbool.h
18 AC_HEADER_STDC # stdlib.h string.h (implied: errno.h stdio.h)
19
20 # Check for header files not covered by the predefined macros above.
21 AC_HEADER_REQUIRE(acl/libacl.h)
22 AC_HEADER_REQUIRE(fcntl.h)
23 AC_HEADER_REQUIRE(getopt.h)
24 AC_HEADER_REQUIRE(libgen.h)
25 AC_HEADER_REQUIRE(limits.h)
26 AC_HEADER_REQUIRE(linux/xattr.h)
27 AC_HEADER_REQUIRE(sys/acl.h)
28 AC_HEADER_REQUIRE(unistd.h)
29
30 # We need openat() with O_NOFOLLOW from POSIX-2008. Without them, we
31 # can't operate securely; I would rather refuse to be built.
32 AC_CHECK_FUNC(openat,
33 [],
34 AC_MSG_ERROR(missing required openat function))
35 AC_CHECK_DECLS([O_DIRECTORY],
36 [],
37 [AC_MSG_ERROR(missing required O_DIRECTORY flag in fcntl.h)],
38 [[#include <fcntl.h>]])
39 AC_CHECK_DECLS([O_NOFOLLOW],
40 [],
41 [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
42 [[#include <fcntl.h>]])
43 AC_CHECK_DECLS([O_PATH],
44 [],
45 [AC_MSG_ERROR(missing required O_PATH flag in fcntl.h)],
46 [[#define _GNU_SOURCE
47 #include <fcntl.h>]])
48
49 # And check for the GNU/BSD extension asprintf(), which lets us avoid
50 # praying to the PATH_MAX gods while constructing long paths.
51 AC_CHECK_FUNC(asprintf,
52 [],
53 AC_MSG_ERROR(missing required asprintf function))
54
55 LT_INIT
56 AC_OUTPUT