1
# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
3
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4
# Free Software Foundation, Inc.
5
# This file is free software; the Free Software Foundation
6
# gives unlimited permission to copy and/or distribute it,
7
# with or without modifications, as long as this notice is preserved.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16
dnl EC_MESSAGE(MESSAGE)
21
AC_MSG_RESULT(${SB}$1...${EB})
26
dnl EC_CHECK_OPTION(STRING, VAR)
29
AC_DEFUN(EC_CHECK_OPTION,[
30
echo "$1 ${SB}$2${EB}"
38
AC_DEFUN(EC_LINUX_KERNEL,[
40
AC_MSG_CHECKING(Linux kernel version)
41
major=`uname -r | cut -f1 -d"."`
42
minor=`uname -r | cut -f2 -d"."`
45
if test "$major$minor" -lt 20; then
46
AC_MSG_WARN(*******************************);
47
AC_MSG_WARN(* Kernel >= 2.0.x REQUIRED !! *);
48
AC_MSG_WARN(*******************************);
55
dnl EC_FREEBSD_VERSION()
58
AC_DEFUN(EC_FREEBSD_VERSION,[
60
AC_MSG_CHECKING(FreeBSD version)
61
major=`uname -r | cut -f1 -d"."`
62
minor=`uname -r | cut -f2 -d"." | cut -f1 -d"-"`
65
if test "$major$minor" -lt 40; then
66
AC_MSG_WARN(***************************************************);
67
AC_MSG_WARN(* Tested only on FreeBSD 4.x !! *);
68
AC_MSG_WARN(* Please send me comments, patches or bug-reports *);
69
AC_MSG_WARN(* on how ettercap works within your system... *);
70
AC_MSG_WARN(***************************************************);
77
dnl EC_DARWIN_KERNEL()
80
AC_DEFUN(EC_DARWIN_KERNEL,[
82
AC_MSG_CHECKING(Darwin version)
83
major=`uname -r | cut -f1 -d"."`
84
minor=`uname -r | cut -f2 -d"."`
87
if test "$major$minor" -lt 14; then
88
ac_cv_ec_undefined="suppress"
89
elif test "$major$minor" -gt 13; then
90
ac_cv_ec_undefined="error"
96
dnl EC_WINDOWS_KERNEL()
99
AC_DEFUN(EC_WINDOWS_KERNEL,[
101
AC_MSG_CHECKING(Windows kernel version)
102
tech=`uname | cut -f2 -d"_" | cut -f1 -d"-"`
103
major=`uname | cut -f2 -d"-" | cut -f1 -d"."`
104
minor=`uname | cut -f2 -d"-" | cut -f2 -d"."`
105
AC_MSG_RESULT($tech $major.$minor)
106
if test "$tech" != "NT"; then
107
ac_cv_ec_windows_version="-DWIN9X"
108
elif test "$major$minor" -lt 50; then
109
ac_cv_ec_windows_version="-DWINNT"
111
ac_cv_ec_windows_version="-DWIN2K_XP"
114
AC_MSG_CHECKING(Cygwin dll version)
115
uname=`uname -r | cut -f1 -d"("`
116
major=`uname -r | cut -f1 -d"(" | cut -f1 -d"."`
117
minor=`uname -r | cut -f1 -d"(" | cut -f2 -d"."`
118
AC_MSG_RESULT($uname)
119
if test "$major$minor" -lt 13; then
120
AC_MSG_WARN(****************************);
121
AC_MSG_WARN(* Cygwin 1.3.x REQUIRED !! *);
122
AC_MSG_WARN(****************************);
131
dnl returns HAVE_PF_PACKET
132
dnl ac_cv_ec_nopf=1 (if fails)
135
AC_DEFUN(EC_PF_PACKET,[
137
AC_MSG_CHECKING(if you can create PF_PACKET socket)
139
#include <arpa/inet.h>
140
#include <sys/socket.h>
141
#include <features.h> /* for the glibc version number */
142
#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
143
#include <netpacket/packet.h>
144
#include <net/ethernet.h> /* the L2 protocols */
146
#include <asm/types.h>
147
#include <linux/if_ether.h> /* The L2 protocols */
149
[ int sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); ],
151
AC_DEFINE(HAVE_PF_PACKET,1) ],
162
dnl returns HAVE_SCOK_PACKET
163
dnl ac_cv_ec_nosock=1 (if fails)
166
AC_DEFUN(EC_SOCK_PACKET,[
168
AC_MSG_CHECKING(if you can create SOCK_PACKET socket)
170
#include <arpa/inet.h>
171
#include <sys/socket.h>
172
#include <features.h> /* for the glibc version number */
173
#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
174
#include <net/ethernet.h> /* the L2 protocols */
176
#include <asm/types.h>
177
#include <linux/if_ether.h> /* The L2 protocols */
179
[ int sock = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL)); ],
181
AC_DEFINE(HAVE_SOCK_PACKET,1) ],
198
AC_DEFUN(EC_SOCKLEN_CHECK,
199
[AC_MSG_CHECKING(for socklen_t in sys/socket.h)
202
#include <sys/types.h>
203
#include <sys/socket.h>
208
from = sizeof(socklen_t);
214
AC_DEFINE(HAVE_SOCKLEN_T)
218
AC_MSG_RESULT(unkown when cross-compiling)
225
dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member
229
dnl AC_LBL_SOCKADDR_SA_LEN
233
dnl HAVE_SOCKADDR_SA_LEN (defined)
235
AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
236
[AC_MSG_CHECKING(if sockaddr struct has sa_len member)
237
AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
239
# include <sys/types.h>
240
# include <sys/socket.h>],
241
[u_int i = sizeof(((struct sockaddr *)0)->sa_len)],
242
ac_cv_lbl_sockaddr_has_sa_len=yes,
243
ac_cv_lbl_sockaddr_has_sa_len=no))
244
AC_MSG_RESULT($ac_cv_lbl_sockaddr_has_sa_len)
245
if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then
246
AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[if struct sockaddr has sa_len])
252
dnl Checks to see if unaligned memory accesses fail (from libpcap aclocal.m4)
256
dnl AC_LBL_UNALIGNED_ACCESS
260
dnl LBL_ALIGN (DEFINED)
262
AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
263
[AC_MSG_CHECKING(if unaligned accesses fail)
264
AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
265
[case "$target_cpu" in
267
# XXX: should also check that they don't do weird things (like on arm)
268
alpha*|arm*|hp*|mips|sparc)
269
ac_cv_lbl_unaligned_fail=yes
273
cat >conftest.c <<EOF
274
# include <sys/types.h>
275
# include <sys/wait.h>
277
unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
282
/* avoid "core dumped" message */
288
pid = waitpid(pid, &status, 0);
291
exit(!WIFEXITED(status));
294
i = *(unsigned int *)&a[[1]];
299
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
300
conftest.c $LIBS >/dev/null 2>&1
301
if test ! -x conftest ; then
302
dnl failed to compile for some reason
303
ac_cv_lbl_unaligned_fail=yes
305
./conftest >conftest.out
306
if test ! -s conftest.out ; then
307
ac_cv_lbl_unaligned_fail=yes
309
ac_cv_lbl_unaligned_fail=no
312
rm -f conftest* core core.conftest
315
AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
316
if test $ac_cv_lbl_unaligned_fail = yes ; then
317
AC_DEFINE(LBL_ALIGN,1,[if unaligned access fails])
322
AC_DEFUN(EC_CHECK_DATE,[
324
if test "$today" -eq "0930" -o "$today" -eq "1114" -o "$today" -eq "0125"; then
326
if test "$today" -eq "1114"; then
328
elif test "$today" -eq "0930"; then
330
elif test "$today" -eq "0125"; then
336
echo "********************************"
338
echo "* Today is the $who's birthday *"
340
echo "********************************"
342
echo " Only for today ettercap is a"
343
echo " cardware or emailware software."
345
echo " a mail will be appreciated... ;)"
354
dnl EC_PTHREAD_CHECK()
355
dnl ac_cv_ec_nopthread=1 (if fails)
358
AC_DEFUN(EC_PTHREAD_CHECK,[
360
AC_SEARCH_LIBS(pthread_create, pthread,,
362
AC_MSG_CHECKING(whether $CC accepts -pthread)
363
CFLAGS_store="$CFLAGS"
364
CFLAGS="$CFLAGS -pthread"
365
AC_TRY_COMPILE([#include <pthread.h>],[pthread_create(NULL, NULL, NULL, NULL);],
367
LIBS="$LIBS -pthread"],
369
CFLAGS="$CFLAGS_store"
370
AC_MSG_WARN(***************************);
371
AC_MSG_WARN(* PTHREAD ARE REQUIRED !! *);
372
AC_MSG_WARN(***************************);
379
if test "$OS" = "SOLARIS"; then
380
AC_SEARCH_LIBS(_getfp, pthread,,)
388
dnl returns HAVE_NS_GET
393
AC_MSG_CHECKING(for NS_GET32)
395
#include <arpa/nameser.h>
400
char *p = "\x01\x02\x03\x04";
407
AC_DEFINE(HAVE_NS_GET,1) ],
408
[ AC_MSG_RESULT(no); ]
413
dnl vim:ts=3:expandtab
416
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
417
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
418
dnl also defines GSTUFF_PKG_ERRORS on error
419
AC_DEFUN(PKG_CHECK_MODULES, [
422
if test -z "$PKG_CONFIG"; then
423
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
426
if test "$PKG_CONFIG" = "no" ; then
427
echo "*** The pkg-config script could not be found. Make sure it is"
428
echo "*** in your path, or set the PKG_CONFIG environment variable"
429
echo "*** to the full path to pkg-config."
430
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
432
PKG_CONFIG_MIN_VERSION=0.9.0
433
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
434
AC_MSG_CHECKING(for $2)
436
if $PKG_CONFIG --exists "$2" ; then
440
AC_MSG_CHECKING($1_CFLAGS)
441
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
442
AC_MSG_RESULT($$1_CFLAGS)
444
AC_MSG_CHECKING($1_LIBS)
445
$1_LIBS=`$PKG_CONFIG --libs "$2"`
446
AC_MSG_RESULT($$1_LIBS)
450
## If we have a custom action on failure, don't print errors, but
451
## do set a variable so people can do so.
452
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
453
ifelse([$4], ,echo $$1_PKG_ERRORS,)
459
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
460
echo "*** See http://www.freedesktop.org/software/pkgconfig"
464
if test $succeeded = yes; then
465
ifelse([$3], , :, [$3])
467
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])