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