1# -*- Autoconf -*- 2# Process this file with autoconf to produce a configure script. 3 4AC_PREREQ(2.59) 5AC_INIT([OpenBSM], [1.0a5], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) 6AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#16 $]) 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 19# Checks for libraries. 20# FIXME: Replace `main' with a function in `-lbsm': 21AC_CHECK_LIB([bsm], [main]) 22 23# Checks for header files. 24AC_HEADER_STDC 25AC_HEADER_SYS_WAIT 26AC_CHECK_HEADERS([endian.h mach/mach.h machine/endian.h sys/endian.h]) 27 28# Checks for typedefs, structures, and compiler characteristics. 29AC_C_CONST 30AC_TYPE_UID_T 31AC_TYPE_PID_T 32AC_TYPE_SIZE_T 33AC_CHECK_MEMBERS([struct stat.st_rdev]) 34 35AC_CHECK_MEMBER([struct ipc_perm.__key], 36[AC_DEFINE(HAVE_IPC_PERM___KEY,, Define if ipc_perm.__key instead of key)], 37[],[ 38#include <sys/types.h> 39#include <sys/ipc.h> 40]) 41 42AC_CHECK_MEMBER([struct ipc_perm.__seq], 43[AC_DEFINE(HAVE_IPC_PERM___SEQ,, Define if ipc_perm.__seq instead of seq)], 44[],[ 45#include <sys/types.h> 46#include <sys/ipc.h> 47]) 48 49AC_HEADER_TIME 50AC_STRUCT_TM 51 52# Checks for library functions. 53AC_FUNC_CHOWN 54AC_FUNC_FORK 55AC_FUNC_MALLOC 56AC_FUNC_MKTIME 57AC_TYPE_SIGNAL 58AC_FUNC_STAT 59AC_FUNC_STRFTIME 60AC_CHECK_FUNCS([bzero ftruncate gettimeofday inet_ntoa memset strchr strerror strrchr strstr strtol strtoul]) 61 62# sys/queue.h exists on most systems, but its capabilities vary a great deal. 63# test for LIST_FIRST, which appears to not exist in all of them, and is 64# necessary for OpenBSM. 65AC_TRY_LINK([ 66 #include <sys/queue.h> 67], [ 68 struct foo { 69 LIST_ENTRY(foo) foo_entries; 70 }; 71 LIST_HEAD(, foo) foo_list; 72 struct foo *foo; 73 74 foo = LIST_FIRST(&foo_list); 75], [ 76AC_DEFINE(HAVE_FULL_QUEUE_H,, Define if queue.h includes LIST_FIRST) 77]) 78 79# Systems may not define key audit system calls, in which case libbsm cannot 80# depend on them or it will generate link-time or run-time errors. Test for 81# just one. 82AC_TRY_LINK([ 83 #include <stdlib.h> 84 85 extern int auditon(int, void *, int); 86], [ 87 int err; 88 89 err = auditon(0, NULL, 0); 90], [ 91AC_DEFINE(HAVE_AUDIT_SYSCALLS,, Define if audit system calls present) 92have_audit_syscalls=true 93], [ 94have_audit_syscalls=false 95]) 96AM_CONDITIONAL(HAVE_AUDIT_SYSCALLS, $have_audit_syscalls) 97 98AC_CONFIG_FILES([Makefile 99 bin/Makefile 100 bin/audit/Makefile 101 bin/auditd/Makefile 102 bin/auditreduce/Makefile 103 bin/praudit/Makefile 104 bsm/Makefile 105 libbsm/Makefile 106 man/Makefile 107 tools/Makefile]) 108 109AC_OUTPUT 110