]> gitweb.michael.orlitzky.com - apply-default-acl.git/blob - configure.ac
configure.ac: add checks for openat() and O_NOFOLLOW.
[apply-default-acl.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.68])
5 AC_INIT([apply-default-acl], [0.0.6], [michael@orlitzky.com])
6 AM_INIT_AUTOMAKE([foreign]) # don't bug me a bout README, NEWS, etc.
7 AC_CONFIG_SRCDIR([src/apply-default-acl.c])
8 AC_CONFIG_FILES([Makefile src/Makefile])
9
10 # Checks for programs.
11 AC_PROG_CC
12 AM_PROG_AR
13
14 # Predefined header checks.
15 AC_HEADER_STAT # sys/stat.h
16 AC_HEADER_STDBOOL # stdbool.h
17 AC_HEADER_STDC # stdlib.h string.h (implied: errno.h limits.h stdio.h)
18 AC_TYPE_MODE_T
19
20 # Check for header files not covered by the predefined macros above.
21 AC_CHECK_HEADERS([ fcntl.h ftw.h getopt.h libgen.h limits.h sys/acl.h ])
22 AC_CHECK_HEADERS([ sys/libacl.h sys/types.h unistd.h ])
23
24 # We need openat() with O_NOFOLLOW from POSIX-2008. Without them, we
25 # can't operate securely; I would rather refuse to be built.
26 AC_CHECK_FUNC(openat,
27 [],
28 AC_MSG_ERROR(missing required openat function))
29 AC_CHECK_DECLS([O_NOFOLLOW],
30 [],
31 [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
32 [[#include <fcntl.h>]])
33
34 LT_INIT
35 AC_OUTPUT