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.
29 AM_INIT_AUTOMAKE(tripe, 1.0.0pre7)
30 AM_CONFIG_HEADER(config.h)
37 mdw_PROG_PYTHON([2.3],
39 pyscripts='${PYTHONSCRIPTS}'
40 pymans='${PYTHONMANS}'])
41 AC_SUBST([pyscripts]) AC_SUBST([pymans])
43 if test $python = yes; then
44 mdw_CHECK_PYTHON([2.3])
45 AC_CACHE_CHECK([for pygtk], [mdw_cv_pygtk], [
53 if test $mdw_cv_pygtk = yes; then
54 pygtkscripts='${PYGTKSCRIPTS}'
55 pygtkmans='${PYGTKMANS}'
58 AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans])
60 AC_CHECK_HEADERS([stdarg.h])
61 mdw_GCC_FLAGS([-Wall])
64 AC_ARG_WITH([linux-includes],
65 [ --with-linux-includes=DIR
66 search for Linux kernel includes in DIR],
67 [CFLAGS="$CFLAGS -I$withval"],
70 AC_ARG_WITH([configdir],
71 [ --with-configdir=DIR look for keys and other configuration in DIR
72 [default=/var/lib/tripe]],
74 [configdir=/var/lib/tripe])
76 AC_ARG_WITH([socketdir],
77 [ --with-socketdir=DIR put admin socket in DIR [default=.]],
81 AC_ARG_WITH([pidfile],
82 [ --with-pidfile=FILE make tripectl write its pid to FILE
83 [default=./tripectl.pid]],
85 [pidfile=tripectl.pid])
87 AC_ARG_WITH([initconfig],
88 [ --with-initconfig=FILE read definitions from FILE in init script
89 [default=/etc/tripe.conf]],
90 [initconfig=$withval],
91 [initconfig=/etc/tripe.conf])
93 AC_ARG_WITH([logfile],
94 [ --with-logfile=DIR make tripectl write its log to FILE
95 [default=./tripe.log]],
101 ETHEREAL_PLUGIN_DIR="unknown"
102 AC_ARG_WITH([ethereal],
103 [ --with-ethereal build and install Ethereal plugin],
105 no) ethereal=false requireethereal=false;;
106 yes) ethereal=true; requireethereal=true;;
107 *) ethereal=true requireethereal=true ETHEREAL_PLUGIN_DIR=$withval;;
109 [ethereal=true requireethereal=false])
112 AC_ARG_WITH([tunnel],
113 [ --with-tunnel=KIND kinds of tunnel device to use
114 (linux, unet, bsd, slip)],
117 if test "$tun" = auto; then
118 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
124 2.[4-9].* | 2.[1-9][0-9]*.* | [3-9].* | [1-9][0-9]*.*)
137 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
145 linux) AC_DEFINE([TUN_LINUX], [1],
146 [Install the Linux TUN/TAP driver.]) ;;
147 bsd) AC_DEFINE([TUN_BSD], [1],
148 [Install the BSD tunnel driver.]) ;;
149 unet) AC_DEFINE([TUN_UNET], [1],
150 [Install the obsolete Linux Usernet driver.]) ;;
152 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
154 tunnels="$tunnels&tun_$i, "
157 AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
158 [List of tunnel drivers to install.])
161 mdw_CATACOMB(2.1.0, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"])
163 if test "$ethereal" = true -a "$ETHEREAL_PLUGIN_DIR" = unknown; then
164 AC_CACHE_CHECK([where to put Ethereal plugins],
165 [mdw_cv_ethereal_plugin_dir], [
167 mdw_cv_ethereal_plugin_dir="failed"
169 for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
170 if test -x "$i/bin/tethereal"; then
175 if test "$ethprefix" != none; then
176 ethbin=$ethprefix/bin/tethereal
177 ethver=`$ethbin -v | sed 's/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q'`
178 dir=$ethprefix/lib/ethereal/plugins/$ethver
179 if test -d "$dir"; then
180 mdw_cv_ethereal_plugin_dir=$dir
185 case $mdw_cv_ethereal_plugin_dir in
186 failed) ethereal=false;;
187 *) ETHEREAL_PLUGIN_DIR=$mdw_cv_ethereal_plugin_dir;;
191 if test "$ethereal" = true; then
192 AM_PATH_GLIB([1.2.0], [], ethereal=false, [gmodule])
194 if test "$ethereal" = true; then
197 ethprefix=`echo $ETHEREAL_PLUGIN_DIR | sed 's:/lib/.*$::'`
198 AC_CACHE_CHECK([how to find the Ethereal headers],
199 [mdw_cv_ethereal_includes], [
200 mdw_cv_ethereal_includes=failed
203 "-I${ethprefix}/include/ethereal" \
204 "-I${ethprefix}/include" \
205 "-I${prefix}/include/ethereal" \
206 "-I${prefix}/include" \
207 "-I/usr/include/ethereal" \
208 "-I/usr/local/include/ethereal" \
209 "-I/usr/local/include"; do
210 CFLAGS="$GLIB_CFLAGS $i"
212 #include <netinet/in.h>
214 #include <ethereal/config.h>
215 #include <ethereal/epan/packet.h>
217 dissector_handle_t dh;
218 dh = create_dissector_handle(0, 0);
219 ], [bad=false; break])
221 if test $bad = false; then
222 mdw_cv_ethereal_includes=$i
226 case $mdw_cv_ethereal_includes in
227 failed) ethereal=false;;
231 if test "$ethereal" = true; then
232 ETHEREAL_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_ethereal_includes"
233 AC_SUBST(ETHEREAL_CFLAGS)
234 AC_SUBST(ETHEREAL_PLUGIN_DIR)
235 DIRS="$DIRS ethereal"
238 if test "$ethereal" = false -a "$requireethereal" = true; then
239 AC_MSG_ERROR([failed to configure Ethereal plugin])
242 AH_TEMPLATE([CONFIGDIR],
243 [Tripe should look here for keys and other configuration.])
244 AH_TEMPLATE([SOCKETDIR],
245 [Tripe should make its administration socket here.])
247 mdw_DEFINE_PATH([CONFIGDIR], [$configdir])
248 mdw_DEFINE_PATH([SOCKETDIR], [$socketdir])
249 AC_SUBST(socketdir) AC_SUBST(configdir) AC_SUBST(logfile) AC_SUBST(pidfile)
254 Makefile doc/Makefile ethereal/Makefile \
255 tripe-init tripe-keys tripemon)
257 dnl ----- That's all, folks -------------------------------------------------