forked from ofalk/libdnet
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfigure.ac
More file actions
297 lines (277 loc) · 7.64 KB
/
Copy pathconfigure.ac
File metadata and controls
297 lines (277 loc) · 7.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([libdnet], [1.13])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_SRCDIR([include/dnet.h])
AC_SUBST(ac_aux_dir)
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIRS([m4])
dnl XXX - stop the insanity!@#$
AM_MAINTAINER_MODE
dnl Check for system type.
dnl XXX - we do this to qualify our later feature checks, since some
dnl systems claim to support multiple features, but are quite b0rked.
AC_CANONICAL_HOST
# Checks for programs.
AC_LIBTOOL_DLOPEN
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AM_PROG_LIBTOOL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Checks for Python.
dnl XXX - use AM_PATH_PYTHON after automake upgrade
AC_MSG_CHECKING(for Python)
AC_ARG_WITH(python,
[ --with-python=DIR build Python module (using python in DIR)],
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
PYTHON="python"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT($withval)
for subdir in . bin; do
if test -x $withval/$subdir/python; then
owd=`pwd`
if cd $withval/$subdir; then withval=`pwd`; cd $owd; fi
PYTHON="$withval/python"
break
fi
done
if test "x$PYTHON" = "x"; then
AC_ERROR(python not found in $withval)
fi
;;
esac
])
AC_SUBST(PYTHON)
AC_SUBST(TCLINC)
AC_SUBST(TCLLIB)
AM_CONDITIONAL(PYTHON, [test "x$PYTHON" != "x"])
AM_CONDITIONAL(TCL, [test "x$TCLINC" != "x"])
dnl Checks for libraries.
AC_LBL_LIBRARY_NET
dnl Checks for Check.
AC_MSG_CHECKING(for Check)
AC_ARG_WITH(check,
[ --with-check=DIR use Check (http://check.sf.net) in DIR],
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT($withval)
if test -f $withval/include/check.h -a -f $withval/lib/libcheck.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
CHECKINC="-I$withval/include"
CHECKLIB="-L$withval/lib -lcheck"
elif test -f $withval/src/check.h -a -f $withval/src/libcheck.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
CHECKINC="-I$withval/src"
CHECKLIB="-L$withval/src -lcheck"
else
AC_ERROR(check.h or libcheck.a not found in $withval)
fi
;;
esac ],
[ if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.a; then
CHECKINC="-I${prefix}/include"
CHECKLIB="-L${prefix}/lib -lcheck"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
AC_SUBST(CHECKINC)
AC_SUBST(CHECKLIB)
AM_CONDITIONAL(HAVE_CHECK, test "x$CHECKLIB" != "x")
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h \
fcntl.h \
inttypes.h \
netdb.h \
net/bpf.h \
net/if.h \
net/if_dl.h \
net/if_tun.h \
net/radix.h \
netinet/in.h \
nlist.h \
stdlib.h \
string.h \
sys/ioctl.h \
sys/param.h \
sys/socket.h \
sys/sockio.h \
sys/sysctl.h \
sys/stdint.h \
sys/time.h])
AC_CHECK_HEADERS([net/pfvar.h], [], [],
[[
#include <net/if.h>
#include <sys/socket.h>
]])
AC_CHECK_HEADERS([net/route.h], [], [],
[[
#include <sys/socket.h>
#include <sys/types.h>
]])
AC_CHECK_HEADERS([netinet/in_var.h], [], [],
[[
#include <net/if.h>
#include <netinet/in.h>
#include <sys/types.h>
]])
dnl AC_CHECK_HEADERS([netinet/ip_fw.h], [], [],
dnl [[
dnl #include <net/if.h>
dnl #include <netinet/in.h>
dnl #include <sys/types.h>
dnl ]])
AC_CHECK_HEADERS([netinet/ip_compat.h], [], [],
[[
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
]])
dnl AC_CHECK_HEADERS([netinet/ip_fil.h], [], [],
dnl [[
dnl #include <net/if.h>
dnl ]])
AC_CHECK_HEADERS([net/if_arp.h], [], [],
[[
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
]])
AC_CHECK_HEADERS([net/if_var.h], [], [],
[[
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
]])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_DNET_SOCKADDR_IN6
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
if test "$ac_cv_header_sys_socket_h" = yes ; then
AC_DNET_SOCKADDR_SA_LEN
fi
if test "$ac_cv_header_net_route_h" = yes ; then
AC_DNET_ROUTE_RT_MSGHDR
fi
if test "$GCC" = yes ; then
CFLAGS="$CFLAGS -Wall"
fi
# Checks for library functions.
AC_FUNC_MEMCMP
AC_CHECK_FUNCS([gethostbyname gettimeofday memmove memset pow socket strchr strdup strerror strncasecmp strpbrk strstr strtol strtoul])
AC_REPLACE_FUNCS(err strlcat strlcpy strsep)
dnl Checks for other system-specific jonks.
AC_DNET_BSD_BPF
AC_DNET_RAWIP_HOST_OFFLEN
dnl Check for arp interface.
if test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then
AC_LIBOBJ([arp])
else
echo "|----------------------------------------|"
echo "|No suitable ARP interface found. Most |"
echo "|probably you are not running the FreeBSD|"
echo "|OS. Please consider using this version |"
echo "|of libdnet with the FreeBSD system |"
echo "|----------------------------------------|"
(exit 1); exit 1;
fi
dnl Check for Ethernet interface.
if test "$ac_cv_dnet_bsd_bpf" = yes ; then
AC_LIBOBJ([eth])
else
echo "|------------------------------------------|"
echo "|No suitable Ethernet interface found. Most|"
echo "|probably you are not running the FreeBSD |"
echo "|OS. Please consider using this version |"
echo "|of libdnet with the FreeBSD system |"
echo "|------------------------------------------|"
(exit 1); exit 1;
fi
dnl Check for firewall interface.
if test "$ac_cv_header_net_pfvar_h" = yes ; then
AC_LIBOBJ([fw-pf])
elif test "$ac_cv_header_netinet_ip_fw_h" = yes ; then
AC_LIBOBJ([fw-ipfw])
elif test "$ac_cv_header_netinet_ip_fil_h" = yes ; then
AC_LIBOBJ([fw-ipf])
else
echo "|------------------------------------------|"
echo "|No suitable firewall interface found. Most|"
echo "|probably you are not running the FreeBSD |"
echo "|OS. Please consider using this version |"
echo "|of libdnet with the FreeBSD system |"
echo "|------------------------------------------|"
(exit 1); exit 1;
fi
dnl Check for network interface interface.
AC_LIBOBJ([intf])
dnl Check for raw IP interface.
AC_LIBOBJ([ip])
dnl Check for routing interface.
if test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then
AC_LIBOBJ([route])
else
echo "|-----------------------------------------|"
echo "|No suitable routing interface found. Most|"
echo "|probably you are not running the FreeBSD |"
echo "|OS. Please consider using this version |"
echo "|of libdnet with the FreeBSD system |"
echo "|-----------------------------------------|"
(exit 1); exit 1;
fi
dnl Check for tun interface.
if test "$ac_cv_header_net_if_tun_h" = yes ; then
AC_LIBOBJ([tun])
elif test -c "/dev/tun0" ; then
AC_LIBOBJ([tun])
else
echo "|----------------------------------------|"
echo "|No suitable tun interface found. Most |"
echo "|probably you are not running the FreeBSD|"
echo "|OS. Please consider using this version |"
echo "|of libdnet with the FreeBSD system |"
echo "|----------------------------------------|"
(exit 1); exit 1;
fi
AC_CONFIG_FILES([Makefile
dnet-config
include/Makefile
include/dnet/Makefile
man/Makefile
python/Makefile
python/setup.py
src/Makefile
test/Makefile
test/check/Makefile
test/dnet/Makefile])
AC_OUTPUT