configure.ac revision 186647
190792Sgshapiro# -*- Autoconf -*- 290792Sgshapiro# Process this file with autoconf to produce a configure script. 390792Sgshapiro 490792SgshapiroAC_PREREQ(2.59) 590792SgshapiroAC_INIT([OpenBSM], [1.1alpha4], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) 690792SgshapiroAC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#48 $]) 790792SgshapiroAC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) 890792SgshapiroAC_CONFIG_AUX_DIR(config) 990792SgshapiroAC_CONFIG_HEADER([config/config.h]) 1090792SgshapiroAM_MAINTAINER_MODE 11266692Sgshapiro 1290792Sgshapiro# --with-native-includes forces the use of the system bsm headers. 1390792SgshapiroAC_ARG_WITH([native-includes], 1490792Sgshapiro[AS_HELP_STRING([--with-native-includes], 1590792Sgshapiro[Use the system native include files instead of those included with openbsm.])], 1690792Sgshapiro[ 1790792SgshapiroAC_DEFINE(USE_NATIVE_INCLUDES,, Define to use native include files) 1890792Sgshapirouse_native_includes=true 1990792Sgshapiro], 2090792Sgshapiro[use_native_includes=false]) 2190792SgshapiroAM_CONDITIONAL(USE_NATIVE_INCLUDES, $use_native_includes) 2290792Sgshapiro 2390792SgshapiroAC_PATH_PROGS(MIG, mig) 2490792Sgshapiro 2590792Sgshapiro# Checks for programs. 2690792SgshapiroAC_PROG_CC 2790792SgshapiroAC_PROG_INSTALL 2890792SgshapiroAC_PROG_LIBTOOL 2990792Sgshapiro 3090792SgshapiroAM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) 31168515Sgshapiro 3290792SgshapiroAC_SEARCH_LIBS(dlsym, dl) 3390792SgshapiroAC_SEARCH_LIBS(clock_gettime, rt) 3490792Sgshapiro 3590792Sgshapiro# Checks for header files. 3690792SgshapiroAC_HEADER_STDC 3790792SgshapiroAC_HEADER_SYS_WAIT 3890792SgshapiroAC_CHECK_HEADERS([endian.h mach/mach.h machine/endian.h sys/endian.h stdint.h]) 3990792Sgshapiro 4090792Sgshapiro# Checks for typedefs, structures, and compiler characteristics. 4190792SgshapiroAC_C_CONST 4290792SgshapiroAC_TYPE_UID_T 4390792SgshapiroAC_TYPE_PID_T 4490792SgshapiroAC_TYPE_SIZE_T 4590792SgshapiroAC_CHECK_MEMBERS([struct stat.st_rdev]) 4690792Sgshapiro 4790792SgshapiroAC_CHECK_MEMBER([struct ipc_perm.__key], 4890792Sgshapiro[AC_DEFINE(HAVE_IPC_PERM___KEY,, Define if ipc_perm.__key instead of key)], 4990792Sgshapiro[],[ 5090792Sgshapiro#include <sys/types.h> 5190792Sgshapiro#include <sys/ipc.h> 5290792Sgshapiro]) 5390792Sgshapiro 5490792SgshapiroAC_CHECK_MEMBER([struct ipc_perm._key], 5590792Sgshapiro[AC_DEFINE(HAVE_IPC_PERM__KEY,, Define if ipc_perm._key instead of key)], 5690792Sgshapiro[],[ 5790792Sgshapiro#include <sys/types.h> 5890792Sgshapiro#include <sys/ipc.h> 5990792Sgshapiro]) 6090792Sgshapiro 6190792SgshapiroAC_CHECK_MEMBER([struct ipc_perm.__seq], 6290792Sgshapiro[AC_DEFINE(HAVE_IPC_PERM___SEQ,, Define if ipc_perm.__seq instead of seq)], 6390792Sgshapiro[],[ 6490792Sgshapiro#include <sys/types.h> 6590792Sgshapiro#include <sys/ipc.h> 6690792Sgshapiro]) 6790792Sgshapiro 6890792SgshapiroAC_CHECK_MEMBER([struct ipc_perm._seq], 6990792Sgshapiro[AC_DEFINE(HAVE_IPC_PERM__SEQ,, Define if ipc_perm._seq instead of seq)], 7090792Sgshapiro[],[ 7190792Sgshapiro#include <sys/types.h> 7290792Sgshapiro#include <sys/ipc.h> 7390792Sgshapiro]) 7490792Sgshapiro 7590792SgshapiroAC_HEADER_TIME 7690792SgshapiroAC_STRUCT_TM 7790792Sgshapiro 7890792Sgshapiro# Checks for library functions. 7990792SgshapiroAC_FUNC_CHOWN 8090792SgshapiroAC_FUNC_FORK 8190792SgshapiroAC_FUNC_MALLOC 8290792SgshapiroAC_FUNC_MKTIME 8390792SgshapiroAC_TYPE_SIGNAL 8490792SgshapiroAC_FUNC_STAT 8590792SgshapiroAC_FUNC_STRFTIME 8690792SgshapiroAC_CHECK_FUNCS([bzero clock_gettime ftruncate gettimeofday inet_ntoa memset strchr strerror strlcat strlcpy strrchr strstr strtol strtoul pthread_mutex_lock]) 8790792Sgshapiro 8890792Sgshapiro# sys/queue.h exists on most systems, but its capabilities vary a great deal. 8990792Sgshapiro# test for LIST_FIRST and TAILQ_FOREACH_SAFE, which appears to not exist in 9090792Sgshapiro# all of them, and are necessary for OpenBSM. 9190792SgshapiroAC_TRY_LINK([ 9290792Sgshapiro #include <sys/queue.h> 9390792Sgshapiro], [ 9490792Sgshapiro 9590792Sgshapiro #ifndef LIST_FIRST 9690792Sgshapiro #error LIST_FIRST missing 9790792Sgshapiro #endif 9890792Sgshapiro #ifndef TAILQ_FOREACH_SAFE 9990792Sgshapiro #error TAILQ_FOREACH_SAFE 10090792Sgshapiro #endif 10190792Sgshapiro], [ 10290792SgshapiroAC_DEFINE(HAVE_FULL_QUEUE_H,, Define if queue.h includes LIST_FIRST) 10390792Sgshapiro]) 10490792Sgshapiro 10590792Sgshapiro# Systems may not define key audit system calls, in which case libbsm cannot 10690792Sgshapiro# depend on them or it will generate link-time or run-time errors. Test for 10790792Sgshapiro# just one. 10890792SgshapiroAC_TRY_LINK([ 10990792Sgshapiro #include <stddef.h> 11090792Sgshapiro 11190792Sgshapiro extern int auditon(int, void *, int); 11290792Sgshapiro], [ 11390792Sgshapiro int err; 11490792Sgshapiro 11590792Sgshapiro err = auditon(0, NULL, 0); 11690792Sgshapiro], [ 11790792SgshapiroAC_DEFINE(HAVE_AUDIT_SYSCALLS,, Define if audit system calls present) 11890792Sgshapirohave_audit_syscalls=true 11990792Sgshapiro], [ 12090792Sgshapirohave_audit_syscalls=false 12190792Sgshapiro]) 12290792SgshapiroAM_CONDITIONAL(HAVE_AUDIT_SYSCALLS, $have_audit_syscalls) 12390792Sgshapiro 12490792Sgshapiro# 12590792Sgshapiro# There are a wide variety of endian macros and functions in the wild; we try 12690792Sgshapiro# to use the native support if it defines be32enc(), but otherwise have to 12790792Sgshapiro# use our own. 12890792Sgshapiro# 12990792SgshapiroAC_TRY_LINK([ 13090792Sgshapiro #include <sys/endian.h> 13190792Sgshapiro #include <stdlib.h> 13290792Sgshapiro], [ 13390792Sgshapiro be32enc(NULL, 1); 13490792Sgshapiro], [ 13590792SgshapiroAC_DEFINE(HAVE_BE32ENC,, Define if be32enc is present) 13690792Sgshapiro]) 13790792Sgshapiro 13890792Sgshapiro# Check to see if Mach IPC is used for trigger messages. If so, use Mach IPC 13990792Sgshapiro# instead of the default for sending trigger messages to the audit components. 14090792SgshapiroAC_CHECK_FILE([/usr/include/mach/audit_triggers.defs], [ 14190792SgshapiroAC_DEFINE(USE_MACH_IPC,, Define if uses Mach IPC for Triggers messages) 14290792Sgshapirouse_mach_ipc=true 14390792Sgshapiro], [ 14490792Sgshapirouse_mach_ipc=false 14590792Sgshapiro]) 14690792SgshapiroAM_CONDITIONAL(USE_MACH_IPC, $use_mach_ipc) 14790792Sgshapiro 14890792SgshapiroAC_CONFIG_FILES([Makefile 14990792Sgshapiro bin/Makefile 15090792Sgshapiro bin/audit/Makefile 15190792Sgshapiro bin/auditd/Makefile 15290792Sgshapiro bin/auditfilterd/Makefile 15390792Sgshapiro bin/auditreduce/Makefile 15490792Sgshapiro bin/praudit/Makefile 15590792Sgshapiro bsm/Makefile 15690792Sgshapiro libauditd/Makefile 15790792Sgshapiro libbsm/Makefile 15890792Sgshapiro modules/Makefile 15990792Sgshapiro modules/auditfilter_noop/Makefile 16090792Sgshapiro man/Makefile 16190792Sgshapiro sys/Makefile 16290792Sgshapiro sys/bsm/Makefile 16390792Sgshapiro test/Makefile 16490792Sgshapiro test/bsm/Makefile 16590792Sgshapiro tools/Makefile]) 16690792Sgshapiro 16790792SgshapiroAC_OUTPUT 16890792Sgshapiro