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