]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/openbsm/configure.ac
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / openbsm / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
5 AC_INIT([OpenBSM], [1.0], [trustedbsd-audit@TrustesdBSD.org],[openbsm])
6 AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#36 $])
7 AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c])
8 AC_CONFIG_AUX_DIR(config)
9 AC_CONFIG_HEADER([config/config.h])
10 AM_MAINTAINER_MODE
11
12 # Checks for programs.
13 AC_PROG_CC
14 AC_PROG_INSTALL
15 AC_PROG_LIBTOOL
16
17 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
18
19 AC_SEARCH_LIBS(dlsym, dl)
20 AC_SEARCH_LIBS(clock_gettime, rt)
21
22 # Checks for header files.
23 AC_HEADER_STDC
24 AC_HEADER_SYS_WAIT
25 AC_CHECK_HEADERS([endian.h mach/mach.h machine/endian.h sys/endian.h])
26
27 # Checks for typedefs, structures, and compiler characteristics.
28 AC_C_CONST
29 AC_TYPE_UID_T
30 AC_TYPE_PID_T
31 AC_TYPE_SIZE_T
32 AC_CHECK_MEMBERS([struct stat.st_rdev])
33
34 AC_CHECK_MEMBER([struct ipc_perm.__key],
35 [AC_DEFINE(HAVE_IPC_PERM___KEY,, Define if ipc_perm.__key instead of key)],
36 [],[
37 #include <sys/types.h>
38 #include <sys/ipc.h>
39 ])
40
41 AC_CHECK_MEMBER([struct ipc_perm.__seq],
42 [AC_DEFINE(HAVE_IPC_PERM___SEQ,, Define if ipc_perm.__seq instead of seq)],
43 [],[
44 #include <sys/types.h>
45 #include <sys/ipc.h>
46 ])
47
48 AC_HEADER_TIME
49 AC_STRUCT_TM
50
51 # Checks for library functions.
52 AC_FUNC_CHOWN
53 AC_FUNC_FORK
54 AC_FUNC_MALLOC
55 AC_FUNC_MKTIME
56 AC_TYPE_SIGNAL
57 AC_FUNC_STAT
58 AC_FUNC_STRFTIME
59 AC_CHECK_FUNCS([bzero clock_gettime ftruncate gettimeofday inet_ntoa memset strchr strerror strlcat strrchr strstr strtol strtoul])
60
61 # sys/queue.h exists on most systems, but its capabilities vary a great deal.
62 # test for LIST_FIRST and TAILQ_FOREACH_SAFE, which appears to not exist in
63 # all of them, and are necessary for OpenBSM.
64 AC_TRY_LINK([
65         #include <sys/queue.h>
66 ], [
67
68         #ifndef LIST_FIRST
69         #error LIST_FIRST missing
70         #endif
71         #ifndef TAILQ_FOREACH_SAFE
72         #error TAILQ_FOREACH_SAFE
73         #endif
74 ], [
75 AC_DEFINE(HAVE_FULL_QUEUE_H,, Define if queue.h includes LIST_FIRST)
76 ])
77
78 # Systems may not define key audit system calls, in which case libbsm cannot
79 # depend on them or it will generate link-time or run-time errors.  Test for
80 # just one.
81 AC_TRY_LINK([
82         #include <stdlib.h>
83
84         extern int auditon(int, void *, int);
85 ], [
86         int err;
87
88         err = auditon(0, NULL, 0);
89 ], [
90 AC_DEFINE(HAVE_AUDIT_SYSCALLS,, Define if audit system calls present)
91 have_audit_syscalls=true
92 ], [
93 have_audit_syscalls=false
94 ])
95 AM_CONDITIONAL(HAVE_AUDIT_SYSCALLS, $have_audit_syscalls)
96
97 AC_CONFIG_FILES([Makefile
98                  bin/Makefile
99                  bin/audit/Makefile
100                  bin/auditd/Makefile
101                  bin/auditfilterd/Makefile
102                  bin/auditreduce/Makefile
103                  bin/praudit/Makefile
104                  bsm/Makefile
105                  libbsm/Makefile
106                  modules/Makefile
107                  modules/auditfilter_noop/Makefile
108                  man/Makefile
109                  test/Makefile
110                  test/bsm/Makefile
111                  tools/Makefile])
112
113 AC_OUTPUT