xref: /freebsd/contrib/pjdfstest/configure.ac (revision c6989859ae9388eeb46a24fe88f9b8d07101c710)
1AC_PREREQ(2.61)
2AC_INIT([pjdfstest],[0.1],)
3AC_CONFIG_AUX_DIR([.])
4AM_INIT_AUTOMAKE
5AC_CONFIG_HEADERS([config.h])
6AC_CONFIG_FILES([ \
7    Makefile \
8])
9
10AC_CANONICAL_HOST
11
12AC_PROG_CC([cc])
13
14# For _GNU_SOURCE on Linux, etc.
15AC_USE_SYSTEM_EXTENSIONS
16
17AC_CHECK_HEADERS([ \
18    sys/mkdev.h \
19])
20
21#HAS_FREEBSD_ACL
22
23AC_CHECK_FUNC([bindat],
24	      [AC_DEFINE([HAVE_BINDAT], [1], [Define if bindat exists])])
25AC_CHECK_FUNC([chflags],
26	      [AC_DEFINE([HAVE_CHFLAGS], [1], [Define if chflags exists])])
27AC_CHECK_FUNC([chflagsat],
28	      [AC_DEFINE([HAVE_CHFLAGSAT], [1], [Define if chflagsat exists])])
29AC_CHECK_FUNC([connectat],
30	      [AC_DEFINE([HAVE_CONNECTAT], [1], [Define if connectat exists])])
31AC_CHECK_FUNC([faccessat],
32	      [AC_DEFINE([HAVE_FACCESSAT], [1], [Define if faccessat exists])])
33AC_CHECK_FUNC([fchflags],
34	      [AC_DEFINE([HAVE_FCHFLAGS], [1], [Define if fchflags exists])])
35AC_CHECK_FUNC([fchmodat],
36	      [AC_DEFINE([HAVE_FCHMODAT], [1], [Define if fchmodat exists])])
37AC_CHECK_FUNC([fchownat],
38	      [AC_DEFINE([HAVE_FCHOWNAT], [1], [Define if fchownat exists])])
39AC_CHECK_FUNC([fstatat],
40	      [AC_DEFINE([HAVE_FSTATAT], [1], [Define if fstatat exists])])
41AC_CHECK_FUNC([lchflags],
42	      [AC_DEFINE([HAVE_LCHFLAGS], [1], [Define if lchflags exists])])
43AC_CHECK_FUNC([lchmod],
44	      [AC_DEFINE([HAVE_LCHMOD], [1], [Define if lchmod exists])])
45AC_CHECK_FUNC([linkat],
46	      [AC_DEFINE([HAVE_LINKAT], [1], [Define if linkat exists])])
47AC_CHECK_FUNC([lpathconf],
48	      [AC_DEFINE([HAVE_LPATHCONF], [1], [Define if lpathconf exists])])
49AC_CHECK_FUNC([mkdirat],
50	      [AC_DEFINE([HAVE_MKDIRAT], [1], [Define if mkdirat exists])])
51AC_CHECK_FUNC([mkfifoat],
52	      [AC_DEFINE([HAVE_MKFIFOAT], [1], [Define if mkfifoat exists])])
53AC_CHECK_FUNC([mknodat],
54	      [AC_DEFINE([HAVE_MKNODAT], [1], [Define if mknodat exists])])
55AC_CHECK_FUNC([openat],
56	      [AC_DEFINE([HAVE_OPENAT], [1], [Define if openat exists])])
57AC_CHECK_FUNC([posix_fallocate],
58	      [AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Define if posix_fallocate exists])])
59AC_CHECK_FUNC([readlinkat],
60	      [AC_DEFINE([HAVE_READLINKAT], [1], [Define if readlinkat exists])])
61AC_CHECK_FUNC([renameat],
62	      [AC_DEFINE([HAVE_RENAMEAT], [1], [Define if renameat exists])])
63AC_CHECK_FUNC([symlinkat],
64	      [AC_DEFINE([HAVE_SYMLINKAT], [1], [Define if symlinkat exists])])
65AC_CHECK_FUNC([utimensat],
66	      [AC_DEFINE([HAVE_UTIMENSAT], [1], [Define if utimensat exists])])
67
68# ACL test battery.
69AC_CHECK_HEADER([sys/acl.h], [has_sys_acl_h=yes], [has_sys_acl_h=no])
70has_acl_funcs=no
71if test x$has_sys_acl_h = xyes; then
72	AC_DEFINE([HAVE_SYS_ACL_H], [1],
73		  [Define to 1 if sys/acl.h is available])
74	AC_CHECK_FUNCS([acl_create_entry_np acl_from_text acl_get_entry acl_get_file acl_set_file],
75		       [has_acl_funcs=yes],[])
76fi
77if test x$has_acl_funcs = xyes; then
78	# Check for NFSv4 ACL support.
79	AC_CHECK_DECL([ACL_TYPE_NFS4],
80		      [has_nfsv4_acl_support=yes], [has_nfsv4_acl_support=no],[[#include <sys/acl.h>]])
81	if test x$has_nfsv4_acl_support = xyes; then
82	      AC_DEFINE([HAS_NFSV4_ACL_SUPPORT], [1],
83			[Define to 1 if NFSv4 ACL support is available])
84	fi
85fi
86
87AC_CHECK_MEMBERS([struct stat.st_atim, struct stat.st_atimespec], [], [], [[
88#include <sys/types.h>
89#include <sys/stat.h>
90]])
91
92AC_CHECK_MEMBERS([struct stat.st_birthtim, struct stat.st_birthtime, struct stat.st_birthtimespec], [], [], [[
93#include <sys/types.h>
94#include <sys/stat.h>
95]])
96
97AC_CHECK_MEMBERS([struct stat.st_ctim, struct stat.st_ctimespec], [], [], [[
98#include <sys/types.h>
99#include <sys/stat.h>
100]])
101
102AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimespec], [], [], [[
103#include <sys/types.h>
104#include <sys/stat.h>
105]])
106
107AC_OUTPUT
108