3 dnl Configuration script for TrIPE
5 dnl (c) 2001 Straylight/Edgeware
8 dnl ----- Licensing notice --------------------------------------------------
10 dnl This file is part of Trivial IP Encryption (TrIPE).
12 dnl TrIPE is free software; you can redistribute it and/or modify
13 dnl it under the terms of the GNU General Public License as published by
14 dnl the Free Software Foundation; either version 2 of the License, or
15 dnl (at your option) any later version.
17 dnl TrIPE is distributed in the hope that it will be useful,
18 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 dnl GNU General Public License for more details.
22 dnl You should have received a copy of the GNU General Public License
23 dnl along with TrIPE; if not, write to the Free Software Foundation,
24 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 AC_INIT(server/tripe.c)
27 AM_INIT_AUTOMAKE(tripe, 1.0.0pre7)
28 AM_CONFIG_HEADER(common/config.h)
34 DIRS="" AC_SUBST([DIRS])
36 AX_WITH_PYTHON([2.3], [missing])
37 if test "$PYTHON" = "missing"; then
41 pyscripts='${PYTHONSCRIPTS}'
43 pymans='${PYTHONMANS}'
45 AC_SUBST([pyscripts]) AC_SUBST([pymans])
47 if test $python = yes; then
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])
67 [ --with-tunnel=KIND kinds of tunnel device to use
68 (linux, unet, bsd, slip)],
71 if test "$tun" = auto; then
72 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
77 [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*])
89 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
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.]) ;;
104 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
106 tunnels="$tunnels&tun_$i, "
109 AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
110 [List of tunnel drivers to install.])
116 AC_CHECK_HEADERS([stdarg.h])
119 AC_ARG_WITH([tracing],
120 [ --without-tracing compile out tracing support (not recommended)],
121 [test "$withval" = no && AC_DEFINE([NTRACE], [1], [Disable all tracing.])],
124 AC_ARG_WITH([linux-includes],
125 [ --with-linux-includes=DIR
126 search for Linux kernel includes in DIR],
127 [CFLAGS="$CFLAGS -I$withval"],
130 AC_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])
136 AC_ARG_WITH([socketdir],
137 [ --with-socketdir=DIR put admin socket in DIR [default=.]],
138 [socketdir=$withval],
141 AC_ARG_WITH([pidfile],
142 [ --with-pidfile=FILE make tripectl write its pid to FILE
143 [default=./tripectl.pid]],
145 [pidfile=tripectl.pid])
147 AC_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])
153 AC_ARG_WITH([logfile],
154 [ --with-logfile=DIR make tripectl write its log to FILE
155 [default=./tripe.log]],
160 WIRESHARK_PLUGIN_DIR="unknown"
161 AC_ARG_WITH([wireshark],
162 [ --with-wireshark build and install Wireshark plugin],
164 no) wireshark=false requirewireshark=false;;
165 yes) wireshark=true; requirewireshark=true;;
166 *) wireshark=true requirewireshark=true WIRESHARK_PLUGIN_DIR=$withval;;
168 [wireshark=true requirewireshark=false])
170 PKG_CHECK_MODULES(mLib, mLib >= 2.0.4)
171 PKG_CHECK_MODULES(catacomb, catacomb >= 2.1.1)
172 CFLAGS="$CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
173 LIBS="$LIBS $mLib_LIBS"
175 if 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"
180 for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
181 if test -x "$i/bin/tshark"; then
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
196 case $mdw_cv_wireshark_plugin_dir in
197 failed) wireshark=false;;
198 *) WIRESHARK_PLUGIN_DIR=$mdw_cv_wireshark_plugin_dir;;
202 if test "$wireshark" = true; then
203 AM_PATH_GLIB([1.2.0], [], wireshark=false, [gmodule])
205 if test "$wireshark" = true; then
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
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"
223 #include <netinet/in.h>
225 #include <wireshark/config.h>
226 #include <wireshark/epan/packet.h>
228 dissector_handle_t dh;
229 dh = create_dissector_handle(0, 0);
230 ], [bad=false; break])
232 if test $bad = false; then
233 mdw_cv_wireshark_includes=$i
237 case $mdw_cv_wireshark_includes in
238 failed) wireshark=false;;
242 if 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"
249 if test "$wireshark" = false -a "$requirewireshark" = true; then
250 AC_MSG_ERROR([failed to configure Wireshark plugin])
253 AH_TEMPLATE([CONFIGDIR],
254 [Tripe should look here for keys and other configuration.])
255 AH_TEMPLATE([SOCKETDIR],
256 [Tripe should make its administration socket here.])
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)
265 common/Makefile client/Makefile server/Makefile \
266 proxy/Makefile pkstream/Makefile \
268 doc/tripe.8 doc/tripectl.1 doc/tripemon.1 \
270 init/Makefile init/tripe-init \
271 keys/Makefile keys/tripe-keys \
272 mon/Makefile mon/tripemon)
274 dnl ----- That's all, folks -------------------------------------------------