# This file is part of IPACCT # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2008 Sergey Poznyakoff # # Ipacct is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # Ipacct is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ipacct. If not, see . */ AC_PREREQ(2.53) AC_INIT([ipacct], [1.0], [bug-ipacct@gnu.org.ua]) AC_CONFIG_SRCDIR(src/ipacct.h) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE([1.10 readme-alpha]) dnl Checks for programs. AC_PROG_CC AC_PROG_YACC AM_PROG_LEX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h malloc.h sys/ioccom.h sys/sockio.h getopt.h) AC_CHECK_HEADER(pcap.h,:, [AC_MSG_ERROR([Required header pcap.h not found])]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_ST_RDEV AC_HEADER_TIME AC_STRUCT_TM dnl Check for libraries AC_CHECK_LIB(socket, main) AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(pcap, pcap_compile, [LIBS="-lpcap $LIBS"], [AC_MSG_ERROR([Required library libpcap not found])]) dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_HEADER_MAJOR AC_FUNC_SETPGRP AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_VFORK AC_FUNC_VPRINTF AC_FUNC_WAIT3 AC_CHECK_FUNCS(ftime gethostname gettimeofday getusershell ether_hostton) AC_REPLACE_FUNCS(strchrnul strndup strnlen strerror) AC_CHECK_FUNCS(setegid setregid setresgid seteuid setreuid) rad_REPLACE_GNU_GETOPT AC_ARG_WITH(included-argp, [ --with-included-argp Use included argp library], [USE_INCLUDED_ARGP=$withval], [USE_INCLUDED_ARGP=no]) AC_CHECK_FUNCS(argp_parse, :, USE_INCLUDED_ARGP=yes) if test $USE_INCLUDED_ARGP = yes; then AC_LIBOBJ([argp-ba]) AC_LIBOBJ([argp-eexst]) AC_LIBOBJ([argp-fmtstream]) AC_LIBOBJ([argp-fs-xinl]) AC_LIBOBJ([argp-help]) AC_LIBOBJ([argp-parse]) AC_LIBOBJ([argp-pv]) AC_LIBOBJ([argp-pvh]) AC_LIBOBJ([argp-xinl]) AC_LIBOBJ([pin]) fi if test $USE_INCLUDED_ARGP != yes; then AC_CHECK_DECLS(program_invocation_name,,,[#include ]) AH_BOTTOM([ #if !HAVE_DECL_PROGRAM_INVOCATION_NAME extern char *program_invocation_short_name; extern char *program_invocation_name; #endif]) fi AC_MSG_CHECKING(for log facility) LOG_FACILITY="LOG_DAEMON" AC_ARG_VAR([LOG_FACILITY], [Default syslog facility]) if test -n "$LOG_FACILITY"; then logfacility=`echo $LOG_FACILITY | tr a-z A-Z` case $logfacility in USER|DAEMON|AUTH|AUTHPRIV|MAIL|CRON|LOCAL[[0-7]]) LOG_FACILITY=LOG_$logfacility;; LOG_USER|LOG_DAEMON|LOG_AUTH|LOG_AUTHPRIV|LOG_MAIL|LOG_CRON|LOG_LOCAL[[0-7]]) LOG_FACILITY=$logfacility;; *) AC_MSG_ERROR([Invalid value of LOG_FACILITY]);; esac fi AC_DEFINE_UNQUOTED(LOGFACILITY, $LOG_FACILITY, [The syslog facility to be used for diagnostics]) AC_MSG_RESULT($LOG_FACILITY) AC_OUTPUT(lib/Makefile src/Makefile m4/Makefile Makefile)