aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac (renamed from configure.in)66
1 files changed, 35 insertions, 31 deletions
diff --git a/configure.in b/configure.ac
index 575365c..a055c11 100644
--- a/configure.in
+++ b/configure.ac
@@ -1,48 +1,49 @@
1dnl This file is part of IPACCT 1# This file is part of IPACCT
2dnl Copyright (c) Sergey Poznyakoff 2# Copyright (c) Sergey Poznyakoff
3dnl 3#
4dnl This program is free software; you can redistribute it and/or modify 4# This program is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by 5# it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 2 of the License, or 6# the Free Software Foundation; either version 2 of the License, or
7dnl (at your option) any later version. 7# (at your option) any later version.
8dnl 8#
9dnl This program is distributed in the hope that it will be useful, 9# This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12dnl GNU General Public License for more details. 12# GNU General Public License for more details.
13dnl 13#
14dnl You should have received a copy of the GNU General Public License 14# You should have received a copy of the GNU General Public License
15dnl along with this program; if not, write to the Free Software 15# along with this program; if not, write to the Free Software
16dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17dnl 17#
18AC_INIT(src/ipacct.h) 18AC_PREREQ(2.53)
19AC_INIT(ipacct, 0.2, bug-ipacct@cvs.farlep.net)
20AC_CONFIG_SRCDIR(src/ipacct.h)
19AC_CANONICAL_SYSTEM 21AC_CANONICAL_SYSTEM
20AM_INIT_AUTOMAKE(ipacct, 0.1) 22AM_INIT_AUTOMAKE(no-exeext)
21AM_CONFIG_HEADER(config.h) 23AM_CONFIG_HEADER(config.h)
22 24
23dnl Checks for programs. 25dnl Checks for programs.
24AC_PROG_CC 26AC_PROG_CC
25AC_PROG_YACC 27AC_PROG_YACC
26AM_PROG_LEX 28AM_PROG_LEX
27AC_PROG_INSTALL 29AC_PROG_INSTALL
28AC_PROG_LN_S 30AC_PROG_LN_S
29AC_PROG_RANLIB 31AC_PROG_RANLIB
30AC_ARG_PROGRAM
31 32
32dnl Checks for header files. 33dnl Checks for header files.
33AC_HEADER_STDC 34AC_HEADER_STDC
34AC_HEADER_DIRENT 35AC_HEADER_DIRENT
35AC_HEADER_SYS_WAIT 36AC_HEADER_SYS_WAIT
36AC_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) 37AC_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)
37AC_SUBST(INCLUDES) 38AC_SUBST(INCLUDES)
38AC_CHECK_HEADERS(netinet/if_ether.h netinet/ip_var.h, 39AC_CHECK_HEADERS(netinet/if_ether.h netinet/ip_var.h,
39 [], 40 [],
40 [INCLUDES=-I'$(top_srcdir)/libpcap/linux-include'; break]) 41 [INCLUDES=-I'$(top_srcdir)/libpcap/linux-include'; break])
41 42
42dnl Checks for typedefs, structures, and compiler characteristics. 43dnl Checks for typedefs, structures, and compiler characteristics.
43AC_C_CONST 44AC_C_CONST
44AC_C_INLINE 45AC_C_INLINE
45AC_TYPE_OFF_T 46AC_TYPE_OFF_T
46AC_TYPE_PID_T 47AC_TYPE_PID_T
47AC_TYPE_SIZE_T 48AC_TYPE_SIZE_T
48AC_STRUCT_ST_RDEV 49AC_STRUCT_ST_RDEV
@@ -55,24 +56,26 @@ AC_CHECK_LIB(nsl, main)
55 56
56dnl Checks for library functions. 57dnl Checks for library functions.
57AC_PROG_GCC_TRADITIONAL 58AC_PROG_GCC_TRADITIONAL
58AC_HEADER_MAJOR 59AC_HEADER_MAJOR
59AC_FUNC_SETPGRP 60AC_FUNC_SETPGRP
60AC_TYPE_SIGNAL 61AC_TYPE_SIGNAL
61AC_FUNC_STRFTIME 62AC_FUNC_STRFTIME
62AC_FUNC_VFORK 63AC_FUNC_VFORK
63AC_FUNC_VPRINTF 64AC_FUNC_VPRINTF
64AC_FUNC_WAIT3 65AC_FUNC_WAIT3
65AC_CHECK_FUNCS(ftime gethostname gettimeofday getusershell getwd select socket strdup strerror strtol ether_hostton strerror) 66AC_CHECK_FUNCS(ftime gethostname gettimeofday getusershell getwd select socket strdup strerror strtol ether_hostton strerror)
66 67
68rad_REPLACE_GNU_GETOPT
69
67dnl libpcap stuff 70dnl libpcap stuff
68dnl All the stuff below has been shamelessly stolen from libpcap-0.4 71dnl All the stuff below has been shamelessly stolen from libpcap-0.4
69dnl configure.in 72dnl configure.in
70dnl 73dnl
71dnl Not all versions of test support -c (character special) but it's a 74dnl Not all versions of test support -c (character special) but it's a
72dnl better way of testing since the device might be protected. So we 75dnl better way of testing since the device might be protected. So we
73dnl check in our normal order using -r and then check the for the /dev 76dnl check in our normal order using -r and then check the for the /dev
74dnl guys again using -c. 77dnl guys again using -c.
75dnl 78dnl
76AC_SUBST(V_PCAP) 79AC_SUBST(V_PCAP)
77AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE]) 80AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE])
78AC_MSG_CHECKING(packet capture type) 81AC_MSG_CHECKING(packet capture type)
@@ -103,32 +106,33 @@ elif test -c /dev/nit ; then # check again in case not readable
103else 106else
104 V_PCAP=null 107 V_PCAP=null
105fi 108fi
106AC_MSG_RESULT($V_PCAP) 109AC_MSG_RESULT($V_PCAP)
107 110
108case "$V_PCAP" in 111case "$V_PCAP" in
109 112
110dlpi) 113dlpi)
111 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h) 114 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
112 AC_MSG_CHECKING(for /dev/dlpi device) 115 AC_MSG_CHECKING(for /dev/dlpi device)
113 if test -c /dev/dlpi ; then 116 if test -c /dev/dlpi ; then
114 AC_MSG_RESULT(yes) 117 AC_MSG_RESULT(yes)
115 AC_DEFINE(HAVE_DEV_DLPI) 118 AC_DEFINE(HAVE_DEV_DLPI,1,[Define this if you have /dev/dlpi])
116 else 119 else
117 AC_MSG_RESULT(no) 120 AC_MSG_RESULT(no)
118 dir="/dev/dlpi" 121 dir="/dev/dlpi"
119 AC_MSG_CHECKING(for $dir directory) 122 AC_MSG_CHECKING(for $dir directory)
120 if test -d $dir ; then 123 if test -d $dir ; then
121 AC_MSG_RESULT(yes) 124 AC_MSG_RESULT(yes)
122 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir") 125 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir",
126 [Path to pcap device])
123 else 127 else
124 AC_MSG_RESULT(no) 128 AC_MSG_RESULT(no)
125 fi 129 fi
126 fi 130 fi
127 ;; 131 ;;
128 132
129linux) 133linux)
130 AC_CHECK_HEADERS(net/if_arp.h) 134 AC_CHECK_HEADERS(net/if_arp.h)
131 AC_MSG_CHECKING(Linux kernel version) 135 AC_MSG_CHECKING(Linux kernel version)
132 AC_CACHE_VAL(ac_cv_linux_vers, 136 AC_CACHE_VAL(ac_cv_linux_vers,
133 ac_cv_linux_vers=`uname -r 2>&1 | \ 137 ac_cv_linux_vers=`uname -r 2>&1 | \
134 sed -n -e '$s/.* //' -e '$s/\..*//p'`) 138 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
@@ -139,66 +143,66 @@ linux)
139 ;; 143 ;;
140 144
141null) 145null)
142 AC_MSG_WARN(cannot determine packet capture interface) 146 AC_MSG_WARN(cannot determine packet capture interface)
143 AC_MSG_WARN((see the INSTALL doc for more info)) 147 AC_MSG_WARN((see the INSTALL doc for more info))
144 ;; 148 ;;
145 149
146esac 150esac
147 151
148case "$target_os" in 152case "$target_os" in
149 153
150aix*) 154aix*)
151 dnl Workaround to enable certain features 155 AC_DEFINE(_SUN,1,[workarounds to enable certain features])
152 AC_DEFINE(_SUN)
153 ;; 156 ;;
154 157
155hpux9*) 158hpux9*)
156 AC_DEFINE(HAVE_HPUX9) 159 AC_DEFINE(HAVE_HPUX9,1,[Define this if we are on a HP-UX 9 system])
157 ;; 160 ;;
158 161
159hpux10.0*) 162hpux10.0*)
160 ;; 163 ;;
161 164
162hpux10.1*) 165hpux10.1*)
163 ;; 166 ;;
164 167
165hpux*) 168hpux*)
166 dnl HPUX 10.20 and above is similar to HPUX 9... 169 dnl HPUX 10.20 and above is similar to HPUX 9...
167 AC_DEFINE(HAVE_HPUX10_20) 170 AC_DEFINE(HAVE_HPUX10_20,1,[Define this if we are on a HP-UX 10.20 system])
168 ;; 171 ;;
169 172
170sinix*) 173sinix*)
171 AC_MSG_CHECKING(if SINIX compiler defines sinix) 174 AC_MSG_CHECKING(if SINIX compiler defines sinix)
172 AC_CACHE_VAL(ac_cv_cc_sinix_defined, 175 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
173 AC_TRY_COMPILE( 176 AC_TRY_COMPILE(
174 [], 177 [],
175 [int i = sinix;], 178 [int i = sinix;],
176 ac_cv_cc_sinix_defined=yes, 179 ac_cv_cc_sinix_defined=yes,
177 ac_cv_cc_sinix_defined=no)) 180 ac_cv_cc_sinix_defined=no))
178 AC_MSG_RESULT($ac_cv_cc_sinix_defined) 181 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
179 if test $ac_cv_cc_sinix_defined = no ; then 182 if test $ac_cv_cc_sinix_defined = no ; then
180 AC_DEFINE(sinix) 183 AC_DEFINE(sinix,1,[Define this if we are on a sinix system])
181 fi 184 fi
182 ;; 185 ;;
183 186
184solaris*) 187solaris*)
185 AC_DEFINE(HAVE_SOLARIS) 188 AC_DEFINE(HAVE_SOLARIS,1,[Define this if we are on a Solaris])
186 ;; 189 ;;
187 190
188linux*) 191linux*)
189 V_INCLS="$V_INCLS -Ilinux-include" 192 V_INCLS="$V_INCLS -Ilinux-include"
190 ;; 193 ;;
191esac 194esac
192 195
193AC_MSG_CHECKING(for log facility) 196AC_MSG_CHECKING(for log facility)
194log_facility="LOG_DAEMON" 197log_facility="LOG_DAEMON"
195AC_ARG_WITH(log-facility, 198AC_ARG_WITH(log-facility,