5 dnl Configuration script for TrIPE
7 dnl (c) 2001 Straylight/Edgeware
10 dnl ----- Licensing notice --------------------------------------------------
12 dnl This file is part of Trivial IP Encryption (TrIPE).
14 dnl TrIPE is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU General Public License as published by
16 dnl the Free Software Foundation; either version 2 of the License, or
17 dnl (at your option) any later version.
19 dnl TrIPE is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 dnl GNU General Public License for more details.
24 dnl You should have received a copy of the GNU General Public License
25 dnl along with TrIPE; if not, write to the Free Software Foundation,
26 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 AC_INIT(server/tripe.c)
29 AM_INIT_AUTOMAKE(tripe, 1.0.0pre7)
30 AM_CONFIG_HEADER(common/config.h)
36 DIRS="" AC_SUBST([DIRS])
39 mdw_PROG_PYTHON([2.3],
41 pyscripts='${PYTHONSCRIPTS}'
43 pymans='${PYTHONMANS}'])
44 AC_SUBST([pyscripts]) AC_SUBST([pymans])
46 if test $python = yes; then
47 mdw_CHECK_PYTHON([2.3])
48 AC_CACHE_CHECK([for pygtk], [mdw_cv_pygtk], [
56 if test $mdw_cv_pygtk = yes; then
57 pygtkscripts='${PYGTKSCRIPTS}'
59 pygtkmans='${PYGTKMANS}'
62 AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans])
64 AC_CHECK_HEADERS([stdarg.h])
65 mdw_GCC_FLAGS([-Wall])
68 AC_ARG_WITH([linux-includes],
69 [ --with-linux-includes=DIR
70 search for Linux kernel includes in DIR],
71 [CFLAGS="$CFLAGS -I$withval"],
74 AC_ARG_WITH([configdir],
75 [ --with-configdir=DIR look for keys and other configuration in DIR
76 [default=/var/lib/tripe]],
78 [configdir=/var/lib/tripe])
80 AC_ARG_WITH([socketdir],
81 [ --with-socketdir=DIR put admin socket in DIR [default=.]],
85 AC_ARG_WITH([pidfile],
86 [ --with-pidfile=FILE make tripectl write its pid to FILE
87 [default=./tripectl.pid]],
89 [pidfile=tripectl.pid])
91 AC_ARG_WITH([initconfig],
92 [ --with-initconfig=FILE read definitions from FILE in init script
93 [default=/etc/tripe.conf]],
94 [initconfig=$withval],
95 [initconfig=/etc/tripe.conf])
97 AC_ARG_WITH([logfile],
98 [ --with-logfile=DIR make tripectl write its log to FILE
99 [default=./tripe.log]],
104 WIRESHARK_PLUGIN_DIR="unknown"
105 AC_ARG_WITH([wireshark],
106 [ --with-wireshark build and install Wireshark plugin],
108 no) wireshark=false requirewireshark=false;;
109 yes) wireshark=true; requirewireshark=true;;
110 *) wireshark=true requirewireshark=true WIRESHARK_PLUGIN_DIR=$withval;;
112 [wireshark=true requirewireshark=false])
115 AC_ARG_WITH([tunnel],
116 [ --with-tunnel=KIND kinds of tunnel device to use
117 (linux, unet, bsd, slip)],
120 if test "$tun" = auto; then
121 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
127 2.[4-9].* | 2.[1-9][0-9]*.* | [3-9].* | [1-9][0-9]*.*)
140 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
148 linux) AC_DEFINE([TUN_LINUX], [1],
149 [Install the Linux TUN/TAP driver.]) ;;
150 bsd) AC_DEFINE([TUN_BSD], [1],
151 [Install the BSD tunnel driver.]) ;;
152 unet) AC_DEFINE([TUN_UNET], [1],
153 [Install the obsolete Linux Usernet driver.]) ;;
155 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
157 tunnels="$tunnels&tun_$i, "
160 AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
161 [List of tunnel drivers to install.])
164 mdw_CATACOMB(2.1.0, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"])
166 if test "$wireshark" = true -a "$WIRESHARK_PLUGIN_DIR" = unknown; then
167 AC_CACHE_CHECK([where to put Wireshark plugins],
168 [mdw_cv_wireshark_plugin_dir], [
170 mdw_cv_wireshark_plugin_dir="failed"
172 for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
173 if test -x "$i/bin/tshark"; then
178 if test "$wsprefix" != none; then
179 wsbin=$wsprefix/bin/tshark
180 wsver=`$wsbin -v | sed 's/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q'`
181 dir=$wsprefix/lib/wireshark/plugins/$wsver
182 if test -d "$dir"; then
183 mdw_cv_wireshark_plugin_dir=$dir
188 case $mdw_cv_wireshark_plugin_dir in
189 failed) wireshark=false;;
190 *) WIRESHARK_PLUGIN_DIR=$mdw_cv_wireshark_plugin_dir;;
194 if test "$wireshark" = true; then
195 AM_PATH_GLIB([1.2.0], [], wireshark=false, [gmodule])
197 if test "$wireshark" = true; then
200 wsprefix=`echo $WIRESHARK_PLUGIN_DIR | sed 's:/lib/.*$::'`
201 AC_CACHE_CHECK([how to find the Wireshark headers],
202 [mdw_cv_wireshark_includes], [
203 mdw_cv_wireshark_includes=failed
206 "-I${wsprefix}/include/wireshark" \
207 "-I${wsprefix}/include" \
208 "-I${prefix}/include/wireshark" \
209 "-I${prefix}/include" \
210 "-I/usr/include/wireshark" \
211 "-I/usr/local/include/wireshark" \
212 "-I/usr/local/include"; do
213 CFLAGS="$GLIB_CFLAGS $i"
215 #include <netinet/in.h>
217 #include <wireshark/config.h>
218 #include <wireshark/epan/packet.h>
220 dissector_handle_t dh;
221 dh = create_dissector_handle(0, 0);
222 ], [bad=false; break])
224 if test $bad = false; then
225 mdw_cv_wireshark_includes=$i
229 case $mdw_cv_wireshark_includes in
230 failed) wireshark=false;;
234 if test "$wireshark" = true; then
235 WIRESHARK_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_wireshark_includes"
236 AC_SUBST(WIRESHARK_CFLAGS)
237 AC_SUBST(WIRESHARK_PLUGIN_DIR)
238 DIRS="$DIRS wireshark"
241 if test "$wireshark" = false -a "$requirewireshark" = true; then
242 AC_MSG_ERROR([failed to configure Wireshark plugin])
245 AH_TEMPLATE([CONFIGDIR],
246 [Tripe should look here for keys and other configuration.])
247 AH_TEMPLATE([SOCKETDIR],
248 [Tripe should make its administration socket here.])
250 mdw_DEFINE_PATH([CONFIGDIR], [$configdir])
251 mdw_DEFINE_PATH([SOCKETDIR], [$socketdir])
252 AC_SUBST(socketdir) AC_SUBST(configdir) AC_SUBST(logfile) AC_SUBST(pidfile)
257 common/Makefile client/Makefile server/Makefile \
258 proxy/Makefile pkstream/Makefile \
260 doc/tripe.8 doc/tripectl.1 doc/tripemon.1 \
262 init/Makefile init/tripe-init \
263 keys/Makefile keys/tripe-keys \
264 mon/Makefile mon/tripemon)
266 dnl ----- That's all, folks -------------------------------------------------