-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
175 lines (160 loc) · 4.44 KB
/
configure.ac
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
# configure.in
# Copyright 2010 Daniel Mende <[email protected]>
AC_PREREQ([2.69])
AC_INIT([loki], [0.3.0], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
# Initialize prefix.
if test "$prefix" = "NONE"; then
prefix="/usr/local"
fi
# Checks for programs.
AC_PROG_CC
AC_PROG_SED
AC_PROG_MAKE_SET
#AM_PATH_PYTHON([2.6])
PC_INIT([2.6], [2.9])
# Checks for libraries.
AC_CHECK_LIB(crypt, encrypt)
AC_CHECK_LIB(crypto, MD4)
AC_CHECK_LIB(ssl, [SHA1_Init, DES_ecb_encrypt])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h syslog.h unistd.h])
AC_CHECK_HEADERS([netpacket/packet.h crypt.h openssl/des.h endian.h sys/endian.h])
AC_CHECK_HEADERS([netinet/ether.h net/ethernet.h net/if.h])
AC_CHECK_HEADERS([openssl/md4.h])
AC_CHECK_HEADERS([sys/cdefs.h sys/time.h sys/socket.h linux/if.h linux/if_tun.h linux/wireless.h], [], [],
[[ #ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_LINUX_IF_H
#include <linux/if.h>
#endif
#ifdef HAVE_LINUX_WIRELESS_H
#include <linux/wireless.h>
#endif
]])
dnl Checks for libpcap
AC_MSG_CHECKING(for libpcap)
AC_ARG_WITH(libpcap,
[ --with-libpcap=DIR use libpcap build directory],
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT($withval)
if test -f $withval/pcap.h -a -f $withval/libpcap.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
PCAPINC="-I$withval -I$withval/bpf"
PCAPLIB="-L$withval -lpcap"
else
AC_ERROR(pcap.h or libpcap.a not found in $withval)
fi
;;
esac ],
[ if test -f ${prefix}/include/pcap.h; then
PCAPINC="-I${prefix}/include"
PCAPLIB="-L${prefix}/lib -lpcap"
elif test -f /usr/include/pcap/pcap.h; then
PCAPINC="-I/usr/include/pcap"
PCAPLIB="-lpcap"
elif test -f /usr/include/pcap.h; then
PCAPLIB="-lpcap"
else
AC_MSG_RESULT(no)
AC_ERROR(libpcap not found)
fi
AC_MSG_RESULT(yes) ]
)
AC_SUBST(PCAPINC)
AC_SUBST(PCAPLIB)
dnl Checks for (installed) libdnet
AC_ARG_WITH(libdnet,
[ --with-libdnet=DIR use libdnet in DIR],
[ case "$withval" in
yes|no)
AC_ERROR([Please specify directory containing dnet-config when using --with-libdnet])
;;
*)
AC_MSG_CHECKING(for libdnet)
AC_MSG_RESULT($withval)
if test -f $withval/src/libdnet.a; then
DNETINC="-I$withval/include"
DNETLIB="-L$withval/src -ldnet `$withval/dnet-config --libs`"
elif test -x $withval/bin/dnet-config; then
DNETINC="`$withval/bin/dnet-config --cflags`"
DNETLIB="`$withval/bin/dnet-config --libs`"
else
AC_MSG_RESULT(no)
AC_ERROR(dnet-config not found in $withval/bin)
fi
;;
esac
AC_MSG_RESULT(yes) ],
[ dnl This is the default case so lets just use AC_PATH_PROG! --CPK.
AC_PATH_PROG(dnetconfig, dnet-config, "no")
if test "$dnetconfig" = "no"; then
AC_ERROR(dnet-config not found)
else
DNETINC="`$dnetconfig --cflags`"
DNETLIB="`$dnetconfig --libs`"
fi]
)
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk],
[use gtk UI (default is no)])],
[USE_GTK=$withval
LOKI_GTK=loki_gtk.py],
[USE_GTK=no])
AC_ARG_WITH([urwid],
[AS_HELP_STRING([--with-urwid],
[use urwid UI (default is no)])],
[USE_URWID=$withval
LOKI_URWID=loki_urw.py],
[USE_URWID=no])
AC_SUBST(DNETINC)
AC_SUBST(DNETLIB)
AC_SUBST(USE_GTK)
AC_SUBST(LOKI_GTK)
AC_SUBST(USE_URWID)
AC_SUBST(LOKI_URWID)
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_FSEEKO
AC_FUNC_MALLOC
AC_CHECK_FUNCS([bzero getcwd gethostbyname gettimeofday inet_ntoa memset mkdir select socket strchr strerror strtoul])
# Error conditions
if test "$ac_cv_lib_pcap_pcap_open_live" = no ; then
AC_ERROR(libpcap not found!)
fi
if test "$ac_cv_lib_ssl_SHA1_Init" = no ; then
AC_ERROR(libssl not found!)
else
if test "$ac_cv_lib_crypt_encrypt" = no ; then
if test "$ac_cv_lib_ssl_DES_ecb_encrypt" = no ; then
AC_ERROR(no usable DES implementation found!)
fi
fi
fi
AC_CONFIG_FILES([Makefile
lib/Makefile
lib/asleap/Makefile
src/Makefile
modules/Makefile
setup.py])
AC_OUTPUT