chiark / gitweb /
Remove crufty old CVS $Id$ markers.
[tripe] / configure.in
... / ...
CommitLineData
1dnl -*-autoconf-*-
2dnl
3dnl Configuration script for TrIPE
4dnl
5dnl (c) 2001 Straylight/Edgeware
6dnl
7
8dnl ----- Licensing notice --------------------------------------------------
9dnl
10dnl This file is part of Trivial IP Encryption (TrIPE).
11dnl
12dnl TrIPE is free software; you can redistribute it and/or modify
13dnl it under the terms of the GNU General Public License as published by
14dnl the Free Software Foundation; either version 2 of the License, or
15dnl (at your option) any later version.
16dnl
17dnl TrIPE is distributed in the hope that it will be useful,
18dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20dnl GNU General Public License for more details.
21dnl
22dnl You should have received a copy of the GNU General Public License
23dnl along with TrIPE; if not, write to the Free Software Foundation,
24dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26AC_INIT(server/tripe.c)
27AM_INIT_AUTOMAKE(tripe, 1.0.0pre7)
28AM_CONFIG_HEADER(common/config.h)
29AC_CANONICAL_HOST
30
31AC_PROG_MAKE_SET
32AC_PROG_CC
33AM_PROG_LIBTOOL
34DIRS="" AC_SUBST([DIRS])
35
36AX_WITH_PYTHON([2.3], [missing])
37if test "$PYTHON" = "missing"; then
38 python=no
39else
40 python=yes
41 pyscripts='${PYTHONSCRIPTS}'
42 DIRS="$DIRS keys"
43 pymans='${PYTHONMANS}'
44fi
45AC_SUBST([pyscripts]) AC_SUBST([pymans])
46
47if test $python = yes; then
48 AC_CACHE_CHECK([for pygtk], [mdw_cv_pygtk], [
49 mdw_cv_pygtk=no
50 python -c >&5 2>&5 '
51import pygtk
52pygtk.require("2.0")
53import gtk
54' && mdw_cv_pygtk=yes
55 ])
56 if test $mdw_cv_pygtk = yes; then
57 pygtkscripts='${PYGTKSCRIPTS}'
58 DIRS="$DIRS mon"
59 pygtkmans='${PYGTKMANS}'
60 fi
61fi
62AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans])
63
64
65tun=auto
66AC_ARG_WITH([tunnel],
67[ --with-tunnel=KIND kinds of tunnel device to use
68 (linux, unet, bsd, slip)],
69[tun=$withval])
70
71if test "$tun" = auto; then
72 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
73 mdw_cv_tunnel=""
74 case $host_os in
75 linux*)
76 case `uname -r` in
77 [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*])
78 mdw_cv_tunnel=linux
79 ;;
80 *)
81 mdw_cv_tunnel=unet
82 ;;
83 esac
84 ;;
85 *bsd*)
86 mdw_cv_tunnel=bsd
87 ;;
88 esac
89 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
90 ])
91 tun=$mdw_cv_tunnel
92fi
93
94tunnels=""
95for i in $tun; do
96 case $i in
97 linux) AC_DEFINE([TUN_LINUX], [1],
98 [Install the Linux TUN/TAP driver.]) ;;
99 bsd) AC_DEFINE([TUN_BSD], [1],
100 [Install the BSD tunnel driver.]) ;;
101 unet) AC_DEFINE([TUN_UNET], [1],
102 [Install the obsolete Linux Usernet driver.]) ;;
103 slip) ;;
104 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
105 esac
106 tunnels="$tunnels&tun_$i, "
107done
108AC_SUBST(tun)
109AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
110 [List of tunnel drivers to install.])
111
112
113
114
115
116AC_CHECK_HEADERS([stdarg.h])
117AX_CFLAGS_WARN_ALL
118
119AC_ARG_WITH([tracing],
120[ --without-tracing compile out tracing support (not recommended)],
121[test "$withval" = no && AC_DEFINE([NTRACE], [1], [Disable all tracing.])],
122[:])
123
124AC_ARG_WITH([linux-includes],
125[ --with-linux-includes=DIR
126 search for Linux kernel includes in DIR],
127[CFLAGS="$CFLAGS -I$withval"],
128[:])
129
130AC_ARG_WITH([configdir],
131[ --with-configdir=DIR look for keys and other configuration in DIR
132 [default=/var/lib/tripe]],
133[configdir=$withval],
134[configdir=/var/lib/tripe])
135
136AC_ARG_WITH([socketdir],
137[ --with-socketdir=DIR put admin socket in DIR [default=.]],
138[socketdir=$withval],
139[socketdir=.])
140
141AC_ARG_WITH([pidfile],
142[ --with-pidfile=FILE make tripectl write its pid to FILE
143 [default=./tripectl.pid]],
144[pidfile=$withval],
145[pidfile=tripectl.pid])
146
147AC_ARG_WITH([initconfig],
148[ --with-initconfig=FILE read definitions from FILE in init script
149 [default=/etc/tripe.conf]],
150[initconfig=$withval],
151[initconfig=/etc/tripe.conf])
152
153AC_ARG_WITH([logfile],
154[ --with-logfile=DIR make tripectl write its log to FILE
155 [default=./tripe.log]],
156[logfile=$withval],
157[logfile=tripe.log])
158
159WIRESHARK_CFLAGS=""
160WIRESHARK_PLUGIN_DIR="unknown"
161AC_ARG_WITH([wireshark],
162[ --with-wireshark build and install Wireshark plugin],
163[case "$withval" in
164 no) wireshark=false requirewireshark=false;;
165 yes) wireshark=true; requirewireshark=true;;
166 *) wireshark=true requirewireshark=true WIRESHARK_PLUGIN_DIR=$withval;;
167esac],
168[wireshark=true requirewireshark=false])
169
170PKG_CHECK_MODULES(mLib, mLib >= 2.0.4)
171PKG_CHECK_MODULES(catacomb, catacomb >= 2.1.1)
172CFLAGS="$CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
173LIBS="$LIBS $mLib_LIBS"
174
175if test "$wireshark" = true -a "$WIRESHARK_PLUGIN_DIR" = unknown; then
176 AC_CACHE_CHECK([where to put Wireshark plugins],
177 [mdw_cv_wireshark_plugin_dir], [
178 mdw_cv_wireshark_plugin_dir="failed"
179 wsprefix=none
180 for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
181 if test -x "$i/bin/tshark"; then
182 wsprefix=$i
183 break
184 fi
185 done
186 if test "$wsprefix" != none; then
187 wsbin=$wsprefix/bin/tshark
188 wsver=`$wsbin -v | sed ['s/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q']`
189 dir=$wsprefix/lib/wireshark/plugins
190 test -d "$dir/$wsver" && dir="$dir/$wsver"
191 if test -d "$dir"; then
192 mdw_cv_wireshark_plugin_dir=$dir
193 fi
194 fi
195 ])
196 case $mdw_cv_wireshark_plugin_dir in
197 failed) wireshark=false;;
198 *) WIRESHARK_PLUGIN_DIR=$mdw_cv_wireshark_plugin_dir;;
199 esac
200fi
201
202if test "$wireshark" = true; then
203 AM_PATH_GLIB([1.2.0], [], wireshark=false, [gmodule])
204fi
205if test "$wireshark" = true; then
206 bad=true
207 mdw_CFLAGS=$CFLAGS
208 wsprefix=`echo $WIRESHARK_PLUGIN_DIR | sed 's:/lib/.*$::'`
209 AC_CACHE_CHECK([how to find the Wireshark headers],
210 [mdw_cv_wireshark_includes], [
211 mdw_cv_wireshark_includes=failed
212 for i in \
213 "" \
214 "-I${wsprefix}/include/wireshark" \
215 "-I${wsprefix}/include" \
216 "-I${prefix}/include/wireshark" \
217 "-I${prefix}/include" \
218 "-I/usr/include/wireshark" \
219 "-I/usr/local/include/wireshark" \
220 "-I/usr/local/include"; do
221 CFLAGS="$GLIB_CFLAGS $i"
222 AC_TRY_COMPILE([
223#include <netinet/in.h>
224#include <glib.h>
225#include <wireshark/config.h>
226#include <wireshark/epan/packet.h>
227], [
228 dissector_handle_t dh;
229 dh = create_dissector_handle(0, 0);
230 ], [bad=false; break])
231 done
232 if test $bad = false; then
233 mdw_cv_wireshark_includes=$i
234 fi
235 CFLAGS=$mdw_CFLAGS
236 ])
237 case $mdw_cv_wireshark_includes in
238 failed) wireshark=false;;
239 esac
240fi
241
242if test "$wireshark" = true; then
243 WIRESHARK_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_wireshark_includes"
244 AC_SUBST(WIRESHARK_CFLAGS)
245 AC_SUBST(WIRESHARK_PLUGIN_DIR)
246 DIRS="$DIRS wireshark"
247fi
248
249if test "$wireshark" = false -a "$requirewireshark" = true; then
250 AC_MSG_ERROR([failed to configure Wireshark plugin])
251fi
252
253AH_TEMPLATE([CONFIGDIR],
254 [Tripe should look here for keys and other configuration.])
255AH_TEMPLATE([SOCKETDIR],
256 [Tripe should make its administration socket here.])
257mdw_DEFINE_PATHS([
258 mdw_DEFINE_PATH([CONFIGDIR], [$configdir])
259 mdw_DEFINE_PATH([SOCKETDIR], [$socketdir])
260 AC_SUBST(socketdir) AC_SUBST(configdir) AC_SUBST(logfile) AC_SUBST(pidfile)
261 AC_SUBST(initconfig)
262])
263AC_OUTPUT( \
264 Makefile \
265 common/Makefile client/Makefile server/Makefile \
266 proxy/Makefile pkstream/Makefile \
267 doc/Makefile \
268 doc/tripe.8 doc/tripectl.1 doc/tripemon.1 \
269 wireshark/Makefile \
270 init/Makefile init/tripe-init \
271 keys/Makefile keys/tripe-keys \
272 mon/Makefile mon/tripemon)
273
274dnl ----- That's all, folks -------------------------------------------------