configure.ac revision 161630
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT([OpenBSM], [1.0a9], [trustedbsd-audit@TrustesdBSD.org],[openbsm])
6AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#28 $])
7AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c])
8AC_CONFIG_AUX_DIR(config)
9AC_CONFIG_HEADER([config/config.h])
10AM_MAINTAINER_MODE
11
12# Checks for programs.
13AC_PROG_CC
14AC_PROG_INSTALL
15AC_PROG_LIBTOOL
16
17AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
18
19AC_SEARCH_LIBS(dlsym, dl)
20AC_SEARCH_LIBS(clock_gettime, rt)
21
22# Checks for header files.
23AC_HEADER_STDC
24AC_HEADER_SYS_WAIT
25AC_CHECK_HEADERS([endian.h mach/mach.h machine/endian.h sys/endian.h])
26
27# Checks for typedefs, structures, and compiler characteristics.
28AC_C_CONST
29AC_TYPE_UID_T
30AC_TYPE_PID_T
31AC_TYPE_SIZE_T
32AC_CHECK_MEMBERS([struct stat.st_rdev])
33
34AC_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
41AC_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
48AC_HEADER_TIME
49AC_STRUCT_TM
50
51# Checks for library functions.
52AC_FUNC_CHOWN
53AC_FUNC_FORK
54AC_FUNC_MALLOC
55AC_FUNC_MKTIME
56AC_TYPE_SIGNAL
57AC_FUNC_STAT
58AC_FUNC_STRFTIME
59AC_CHECK_FUNCS([bzero clock_gettime ftruncate gettimeofday inet_ntoa memset strchr strerror 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.
64AC_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], [
75AC_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.
81AC_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], [
90AC_DEFINE(HAVE_AUDIT_SYSCALLS,, Define if audit system calls present)
91have_audit_syscalls=true
92], [
93have_audit_syscalls=false
94])
95AM_CONDITIONAL(HAVE_AUDIT_SYSCALLS, $have_audit_syscalls)
96
97AC_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
113AC_OUTPUT
114