chiark / gitweb /
Remove crufty old CVS $Id$ markers.
[tripe] / configure.in
CommitLineData
165db1a8 1dnl -*-autoconf-*-
410c8acf 2dnl
410c8acf 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.
e04c2d50 16dnl
410c8acf 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.
e04c2d50 21dnl
410c8acf 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
78698994 26AC_INIT(server/tripe.c)
d36eda2a 27AM_INIT_AUTOMAKE(tripe, 1.0.0pre7)
78698994 28AM_CONFIG_HEADER(common/config.h)
410c8acf 29AC_CANONICAL_HOST
30
165db1a8 31AC_PROG_MAKE_SET
410c8acf 32AC_PROG_CC
165db1a8 33AM_PROG_LIBTOOL
78698994
MW
34DIRS="" AC_SUBST([DIRS])
35
82c75bd9
MW
36AX_WITH_PYTHON([2.3], [missing])
37if test "$PYTHON" = "missing"; then
38 python=no
39else
40 python=yes
78698994
MW
41 pyscripts='${PYTHONSCRIPTS}'
42 DIRS="$DIRS keys"
82c75bd9
MW
43 pymans='${PYTHONMANS}'
44fi
060ca767 45AC_SUBST([pyscripts]) AC_SUBST([pymans])
46
47if test $python = yes; then
060ca767 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")
e04c2d50 53import gtk
060ca767 54' && mdw_cv_pygtk=yes
55 ])
56 if test $mdw_cv_pygtk = yes; then
57 pygtkscripts='${PYGTKSCRIPTS}'
78698994 58 DIRS="$DIRS mon"
060ca767 59 pygtkmans='${PYGTKMANS}'
60 fi
61fi
62AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans])
63
82c75bd9
MW
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
3cdc3f3a 116AC_CHECK_HEADERS([stdarg.h])
82c75bd9
MW
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[:])
410c8acf 123
37075862 124AC_ARG_WITH([linux-includes],
125[ --with-linux-includes=DIR
e04c2d50 126 search for Linux kernel includes in DIR],
37075862 127[CFLAGS="$CFLAGS -I$withval"],
128[:])
129
ef4a1ab7 130AC_ARG_WITH([configdir],
e04c2d50
MW
131[ --with-configdir=DIR look for keys and other configuration in DIR
132 [default=/var/lib/tripe]],
ef4a1ab7 133[configdir=$withval],
134[configdir=/var/lib/tripe])
135
136AC_ARG_WITH([socketdir],
e04c2d50 137[ --with-socketdir=DIR put admin socket in DIR [default=.]],
ef4a1ab7 138[socketdir=$withval],
139[socketdir=.])
140
141AC_ARG_WITH([pidfile],
e04c2d50
MW
142[ --with-pidfile=FILE make tripectl write its pid to FILE
143 [default=./tripectl.pid]],
ef4a1ab7 144[pidfile=$withval],
145[pidfile=tripectl.pid])
146
147AC_ARG_WITH([initconfig],
148[ --with-initconfig=FILE read definitions from FILE in init script
e04c2d50 149 [default=/etc/tripe.conf]],
ef4a1ab7 150[initconfig=$withval],
151[initconfig=/etc/tripe.conf])
152
153AC_ARG_WITH([logfile],
e04c2d50
MW
154[ --with-logfile=DIR make tripectl write its log to FILE
155 [default=./tripe.log]],
ef4a1ab7 156[logfile=$withval],
157[logfile=tripe.log])
158
28461f0e
MW
159WIRESHARK_CFLAGS=""
160WIRESHARK_PLUGIN_DIR="unknown"
161AC_ARG_WITH([wireshark],
e04c2d50 162[ --with-wireshark build and install Wireshark plugin],
165db1a8 163[case "$withval" in
28461f0e
MW
164 no) wireshark=false requirewireshark=false;;
165 yes) wireshark=true; requirewireshark=true;;
166 *) wireshark=true requirewireshark=true WIRESHARK_PLUGIN_DIR=$withval;;
165db1a8 167esac],
28461f0e 168[wireshark=true requirewireshark=false])
165db1a8 169
82c75bd9
MW
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"
165db1a8 174
28461f0e 175if test "$wireshark" = true -a "$WIRESHARK_PLUGIN_DIR" = unknown; then
e04c2d50 176 AC_CACHE_CHECK([where to put Wireshark plugins],
28461f0e 177 [mdw_cv_wireshark_plugin_dir], [
28461f0e
MW
178 mdw_cv_wireshark_plugin_dir="failed"
179 wsprefix=none
ef4a1ab7 180 for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
28461f0e
MW
181 if test -x "$i/bin/tshark"; then
182 wsprefix=$i
ef4a1ab7 183 break
184 fi
185 done
28461f0e
MW
186 if test "$wsprefix" != none; then
187 wsbin=$wsprefix/bin/tshark
82c75bd9
MW
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"
ef4a1ab7 191 if test -d "$dir"; then
e04c2d50 192 mdw_cv_wireshark_plugin_dir=$dir
ef4a1ab7 193 fi
194 fi
ef4a1ab7 195 ])
28461f0e
MW
196 case $mdw_cv_wireshark_plugin_dir in
197 failed) wireshark=false;;
198 *) WIRESHARK_PLUGIN_DIR=$mdw_cv_wireshark_plugin_dir;;
ef4a1ab7 199 esac
200fi
201
28461f0e
MW
202if test "$wireshark" = true; then
203 AM_PATH_GLIB([1.2.0], [], wireshark=false, [gmodule])
ef4a1ab7 204fi
28461f0e 205if test "$wireshark" = true; then
165db1a8 206 bad=true
207 mdw_CFLAGS=$CFLAGS
28461f0e 208 wsprefix=`echo $WIRESHARK_PLUGIN_DIR | sed 's:/lib/.*$::'`
e04c2d50 209 AC_CACHE_CHECK([how to find the Wireshark headers],
28461f0e
MW
210 [mdw_cv_wireshark_includes], [
211 mdw_cv_wireshark_includes=failed
ef4a1ab7 212 for i in \
213 "" \
28461f0e
MW
214 "-I${wsprefix}/include/wireshark" \
215 "-I${wsprefix}/include" \
216 "-I${prefix}/include/wireshark" \
ef4a1ab7 217 "-I${prefix}/include" \
28461f0e
MW
218 "-I/usr/include/wireshark" \
219 "-I/usr/local/include/wireshark" \
ef4a1ab7 220 "-I/usr/local/include"; do
165db1a8 221 CFLAGS="$GLIB_CFLAGS $i"
222 AC_TRY_COMPILE([
223#include <netinet/in.h>
224#include <glib.h>
28461f0e
MW
225#include <wireshark/config.h>
226#include <wireshark/epan/packet.h>
165db1a8 227], [
228 dissector_handle_t dh;
3cdc3f3a 229 dh = create_dissector_handle(0, 0);
165db1a8 230 ], [bad=false; break])
231 done
ef4a1ab7 232 if test $bad = false; then
28461f0e 233 mdw_cv_wireshark_includes=$i
165db1a8 234 fi
165db1a8 235 CFLAGS=$mdw_CFLAGS
236 ])
28461f0e
MW
237 case $mdw_cv_wireshark_includes in
238 failed) wireshark=false;;
e04c2d50 239 esac
ef4a1ab7 240fi
241
28461f0e
MW
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"
165db1a8 247fi
410c8acf 248
28461f0e
MW
249if test "$wireshark" = false -a "$requirewireshark" = true; then
250 AC_MSG_ERROR([failed to configure Wireshark plugin])
ef4a1ab7 251fi
252
3cdc3f3a 253AH_TEMPLATE([CONFIGDIR],
e04c2d50 254 [Tripe should look here for keys and other configuration.])
3cdc3f3a 255AH_TEMPLATE([SOCKETDIR],
e04c2d50 256 [Tripe should make its administration socket here.])
ef4a1ab7 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])
060ca767 263AC_OUTPUT( \
78698994
MW
264 Makefile \
265 common/Makefile client/Makefile server/Makefile \
266 proxy/Makefile pkstream/Makefile \
179d8129
MW
267 doc/Makefile \
268 doc/tripe.8 doc/tripectl.1 doc/tripemon.1 \
78698994
MW
269 wireshark/Makefile \
270 init/Makefile init/tripe-init \
271 keys/Makefile keys/tripe-keys \
272 mon/Makefile mon/tripemon)
410c8acf 273
274dnl ----- That's all, folks -------------------------------------------------