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])
38 AX_WITH_PYTHON([2.3], [missing])
39 if test "$PYTHON" = "missing"; then
43 pyscripts='${PYTHONSCRIPTS}'
45 pymans='${PYTHONMANS}'
47 AC_SUBST([pyscripts]) AC_SUBST([pymans])
49 if test $python = yes; then
50 AC_CACHE_CHECK([for pygtk], [mdw_cv_pygtk], [
58 if test $mdw_cv_pygtk = yes; then
59 pygtkscripts='${PYGTKSCRIPTS}'
61 pygtkmans='${PYGTKMANS}'
64 AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans])
69 [ --with-tunnel=KIND kinds of tunnel device to use
70 (linux, unet, bsd, slip)],
73 if test "$tun" = auto; then
74 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
79 [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*])
91 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
99 linux) AC_DEFINE([TUN_LINUX], [1],
100 [Install the Linux TUN/TAP driver.]) ;;
101 bsd) AC_DEFINE([TUN_BSD], [1],
102 [Install the BSD tunnel driver.]) ;;
103 unet) AC_DEFINE([TUN_UNET], [1],
104 [Install the obsolete Linux Usernet driver.]) ;;
106 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
108 tunnels="$tunnels&tun_$i, "
111 AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
112 [List of tunnel drivers to install.])
118 AC_CHECK_HEADERS([stdarg.h])
121 AC_ARG_WITH([tracing],
122 [ --without-tracing compile out tracing support (not recommended)],
123 [test "$withval" = no && AC_DEFINE([NTRACE], [1], [Disable all tracing.])],
126 AC_ARG_WITH([linux-includes],
127 [ --with-linux-includes=DIR
128 search for Linux kernel includes in DIR],
129 [CFLAGS="$CFLAGS -I$withval"],
132 AC_ARG_WITH([configdir],
133 [ --with-configdir=DIR look for keys and other configuration in DIR
134 [default=/var/lib/tripe]],
135 [configdir=$withval],
136 [configdir=/var/lib/tripe])
138 AC_ARG_WITH([socketdir],
139 [ --with-socketdir=DIR put admin socket in DIR [default=.]],
140 [socketdir=$withval],
143 AC_ARG_WITH([pidfile],
144 [ --with-pidfile=FILE make tripectl write its pid to FILE
145 [default=./tripectl.pid]],
147 [pidfile=tripectl.pid])
149 AC_ARG_WITH([initconfig],
150 [ --with-initconfig=FILE read definitions from FILE in init script
151 [default=/etc/tripe.conf]],
152 [initconfig=$withval],
153 [initconfig=/etc/tripe.conf])
155 AC_ARG_WITH([logfile],
156 [ --with-logfile=DIR make tripectl write its log to FILE
157 [default=./tripe.log]],
162 WIRESHARK_PLUGIN_DIR="unknown"
163 AC_ARG_WITH([wireshark],
164 [ --with-wireshark build and install Wireshark plugin],
166 no) wireshark=false requirewireshark=false;;
167 yes) wireshark=true; requirewireshark=true;;
168 *) wireshark=true requirewireshark=true WIRESHARK_PLUGIN_DIR=$withval;;
170 [wireshark=true requirewireshark=false])
172 PKG_CHECK_MODULES(mLib, mLib >= 2.0.4)
173 PKG_CHECK_MODULES(catacomb, catacomb >= 2.1.1)
174 CFLAGS="$CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
175 LIBS="$LIBS $mLib_LIBS"
177 if test "$wireshark" = true -a "$WIRESHARK_PLUGIN_DIR" = unknown; then
178 AC_CACHE_CHECK([where to put Wireshark plugins],
179 [mdw_cv_wireshark_plugin_dir], [
180 mdw_cv_wireshark_plugin_dir="failed"
182 for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
183 if test -x "$i/bin/tshark"; then
188 if test "$wsprefix" != none; then
189 wsbin=$wsprefix/bin/tshark
190 wsver=`$wsbin -v | sed ['s/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q']`
191 dir=$wsprefix/lib/wireshark/plugins
192 test -d "$dir/$wsver" && dir="$dir/$wsver"
193 if test -d "$dir"; then
194 mdw_cv_wireshark_plugin_dir=$dir
198 case $mdw_cv_wireshark_plugin_dir in
199 failed) wireshark=false;;
200 *) WIRESHARK_PLUGIN_DIR=$mdw_cv_wireshark_plugin_dir;;
204 if test "$wireshark" = true; then
205 AM_PATH_GLIB([1.2.0], [], wireshark=false, [gmodule])
207 if test "$wireshark" = true; then
210 wsprefix=`echo $WIRESHARK_PLUGIN_DIR | sed 's:/lib/.*$::'`
211 AC_CACHE_CHECK([how to find the Wireshark headers],
212 [mdw_cv_wireshark_includes], [
213 mdw_cv_wireshark_includes=failed
216 "-I${wsprefix}/include/wireshark" \
217 "-I${wsprefix}/include" \
218 "-I${prefix}/include/wireshark" \
219 "-I${prefix}/include" \
220 "-I/usr/include/wireshark" \
221 "-I/usr/local/include/wireshark" \
222 "-I/usr/local/include"; do
223 CFLAGS="$GLIB_CFLAGS $i"
225 #include <netinet/in.h>
227 #include <wireshark/config.h>
228 #include <wireshark/epan/packet.h>
230 dissector_handle_t dh;
231 dh = create_dissector_handle(0, 0);
232 ], [bad=false; break])
234 if test $bad = false; then
235 mdw_cv_wireshark_includes=$i
239 case $mdw_cv_wireshark_includes in
240 failed) wireshark=false;;
244 if test "$wireshark" = true; then
245 WIRESHARK_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_wireshark_includes"
246 AC_SUBST(WIRESHARK_CFLAGS)
247 AC_SUBST(WIRESHARK_PLUGIN_DIR)
248 DIRS="$DIRS wireshark"
251 if test "$wireshark" = false -a "$requirewireshark" = true; then
252 AC_MSG_ERROR([failed to configure Wireshark plugin])
255 AH_TEMPLATE([CONFIGDIR],
256 [Tripe should look here for keys and other configuration.])
257 AH_TEMPLATE([SOCKETDIR],
258 [Tripe should make its administration socket here.])
260 mdw_DEFINE_PATH([CONFIGDIR], [$configdir])
261 mdw_DEFINE_PATH([SOCKETDIR], [$socketdir])
262 AC_SUBST(socketdir) AC_SUBST(configdir) AC_SUBST(logfile) AC_SUBST(pidfile)
267 common/Makefile client/Makefile server/Makefile \
268 proxy/Makefile pkstream/Makefile \
270 doc/tripe.8 doc/tripectl.1 doc/tripemon.1 \
272 init/Makefile init/tripe-init \
273 keys/Makefile keys/tripe-keys \
274 mon/Makefile mon/tripemon)
276 dnl ----- That's all, folks -------------------------------------------------