]> gitweb.michael.orlitzky.com - apply-default-acl.git/blob - configure.ac
configure.ac: "autoupdate" to autoconf-2.71.
[apply-default-acl.git] / configure.ac
1 AC_PREREQ([2.68])
2 AC_INIT([apply-default-acl], [0.4.4], [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 src/libadacl.pc])
7 AC_CONFIG_SRCDIR([src/apply-default-acl.c])
8 AC_CONFIG_MACRO_DIRS([m4])
9
10 # Not used, but keeps the build log clean.
11 AC_CONFIG_HEADERS([config.h])
12
13 # Adds --with-pkgconfigdir to the ./configure script and defines
14 # the @pkgconfigdir@ variable to be used elsewhere.
15 PKG_INSTALLDIR
16
17 # Checks for programs.
18 AC_PROG_CC
19 AM_PROG_AR
20
21 # Predefined header checks.
22 AC_HEADER_DIRENT # dirent.h
23 AC_HEADER_STAT # sys/stat.h
24 AC_HEADER_STDBOOL # stdbool.h
25 AC_HEADER_STDC # stdlib.h string.h (implied: errno.h stdio.h)
26
27 # Check for header files not covered by the predefined macros above.
28 AC_HEADER_REQUIRE(acl/libacl.h)
29 AC_HEADER_REQUIRE(fcntl.h)
30 AC_HEADER_REQUIRE(getopt.h)
31 AC_HEADER_REQUIRE(libgen.h)
32 AC_HEADER_REQUIRE(limits.h)
33 AC_HEADER_REQUIRE(linux/xattr.h)
34 AC_HEADER_REQUIRE(sys/acl.h)
35 AC_HEADER_REQUIRE(unistd.h)
36
37 # We need openat() with O_NOFOLLOW from POSIX-2008. Without them, we
38 # can't operate securely; I would rather refuse to be built.
39 AC_CHECK_FUNC(openat,
40 [],
41 AC_MSG_ERROR(missing required openat function))
42 AC_CHECK_DECLS([O_DIRECTORY],
43 [],
44 [AC_MSG_ERROR(missing required O_DIRECTORY flag in fcntl.h)],
45 [[#include <fcntl.h>]])
46 AC_CHECK_DECLS([O_NOFOLLOW],
47 [],
48 [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
49 [[#include <fcntl.h>]])
50 AC_CHECK_DECLS([O_PATH],
51 [],
52 [AC_MSG_ERROR(missing required O_PATH flag in fcntl.h)],
53 [[#define _GNU_SOURCE
54 #include <fcntl.h>]])
55
56 # And check for the GNU/BSD extension asprintf(), which lets us avoid
57 # praying to the PATH_MAX gods while constructing long paths.
58 AC_CHECK_FUNC(asprintf,
59 [],
60 AC_MSG_ERROR(missing required asprintf function))
61
62 LT_INIT([disable-static])
63 AC_OUTPUT