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 it under
13 dnl the terms of the GNU General Public License as published by the Free
14 dnl Software Foundation; either version 3 of the License, or (at your
15 dnl option) any later version.
17 dnl TrIPE is distributed in the hope that it will be useful, but WITHOUT
18 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 dnl You should have received a copy of the GNU General Public License
23 dnl along with TrIPE. If not, see <https://www.gnu.org/licenses/>.
25 dnl--------------------------------------------------------------------------
29 AC_INIT([tripe], AUTO_VERSION, [mdw@distorted.org.uk])
30 AC_CONFIG_SRCDIR([server/tripe.h])
31 AC_CONFIG_AUX_DIR([config])
32 AM_INIT_AUTOMAKE([foreign])
42 AC_CHECK_PROGS([AUTOM4TE], [autom4te])
44 mdw_ORIG_CFLAGS=$CFLAGS
45 mdw_ORIG_CPPFLAGS=$CPPFLAGS
49 dnl--------------------------------------------------------------------------
50 dnl C programming environment.
52 AC_CHECK_HEADERS([stdarg.h])
54 AC_SEARCH_LIBS([socket], [socket])
58 AC_ARG_WITH([linux-includes],
60 [--with-linux-includes=DIR],
61 [Linux kernel includes]),
62 [AM_CPPFLAGS="AM_CPPFLAGS -I$withval"], [:])
67 AS_HELP_STRING([--with-adns],
68 [use ADNS library for background name resolution]),
73 *) AC_CHECK_LIB([adns], [adns_submit], [have_adns=yes], [have_adns=no]) ;;
76 case $want_adns,$have_adns in
78 AC_MSG_ERROR([ADNS library not found but explicitly requested])
82 AC_DEFINE([HAVE_LIBADNS], [1],
83 [Define if the GNU adns library is available.])
87 PKG_CHECK_MODULES([mLib], [mLib >= 2.2.1])
88 PKG_CHECK_MODULES([catacomb], [catacomb >= 2.2.2-38])
90 AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
92 dnl--------------------------------------------------------------------------
93 dnl Directories to install things into.
95 dnl TRIPE_DEFINE_PATH(VAR, ARG, HELP, DEFAULT, [DEFINE, DEFINEHELP])
96 AC_DEFUN([TRIPE_DEFINE_PATH], [
97 AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=$2], [$3]),
98 [$1=$withval], [$1=$4])
100 m4_if([$5], [], [], [
101 mdw_DEFINE_PATHS([mdw_DEFINE_PATH([$5], [$][$1], [$6])])
107 [configdir], [DIR], [keys and other configuration [[LOCALSTATE/tripe]]],
108 ['${localstatedir}/tripe'],
109 [CONFIGDIR], [Look for keys and other configuration here.])
112 [socketdir], [DIR], [admin socket [[.]]], [.],
113 [SOCKETDIR], [Create or look for administration socket here.])
116 [pidfile], [FILE], [process-id [[./tripectl.pid]]], [tripectl.pid])
119 [initconfig], [FILE],
120 [configuration for init script [[SYSCONFDIR/tripe.conf]]],
121 ['${sysconfdir}/tripe.conf'])
124 [logfile], [FILE], [logging output [[./tripe.log]]], [tripe.log])
126 dnl--------------------------------------------------------------------------
127 dnl Privilege-separation helper.
130 AC_DEFINE_UNQUOTED([PRIVSEP_HELPER],
131 ["mdw_PATH([$libexecdir])/mdw_PROG([tripe-privhelper])"],
132 [Pathname of privilege-separation helper.])
135 dnl--------------------------------------------------------------------------
138 AC_ARG_WITH([tracing],
141 [compile out tracing support (not recommended)]),
142 [test "$withval" = no &&
143 AC_DEFINE([NTRACE], [1], [Disable all tracing.])],
146 dnl--------------------------------------------------------------------------
149 dnl Provide the user with a choice.
150 AC_ARG_WITH([tunnel],
152 [--with-tunnel=KIND],
153 [kinds of tunnel device to use (linux, unet, bsd, slip)]),
154 [tun=$withval], [tun=auto])
156 dnl If he doesn't choose, pick something sensible.
157 if test "$tun" = auto; then
158 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
163 [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*])
175 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
183 linux) AC_DEFINE([TUN_LINUX], [1],
184 [Install the Linux TUN/TAP driver.]) ;;
185 bsd) AC_DEFINE([TUN_BSD], [1],
186 [Install the BSD tunnel driver.]) ;;
187 unet) AC_DEFINE([TUN_UNET], [1],
188 [Install the obsolete Linux Usernet driver.]) ;;
190 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
192 tunnels="$tunnels&tun_$i, "
194 AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
195 [List of tunnel drivers to install.])
197 dnl--------------------------------------------------------------------------
200 dnl Find out whether Python exists at all.
201 AM_PATH_PYTHON([2.4], [python=yes], [python=no])
202 AM_CONDITIONAL([HAVE_PYTHON], [test $python = yes])
204 dnl Find out whether we can use the various external modules.
205 if test $python = yes; then
206 AC_PYTHON_MODULE([pygtk])
207 AC_PYTHON_MODULE([cdb])
208 AC_PYTHON_MODULE([mLib])
209 AC_PYTHON_MODULE([catacomb])
211 AM_CONDITIONAL([HAVE_PYGTK], [test ${HAVE_PYMOD_PYGTK-no} = yes])
212 AM_CONDITIONAL([HAVE_PYCDB], [test ${HAVE_PYMOD_CDB-no} = yes])
213 AM_CONDITIONAL([HAVE_PYMLIB], [test ${HAVE_PYMOD_MLIB-no} = yes])
214 AM_CONDITIONAL([HAVE_PYCATACOMB], [test ${HAVE_PYMOD_CATACOMB-no} = yes])
216 dnl--------------------------------------------------------------------------
219 dnl Get the user to help.
220 wireshark_plugindir=unknown
221 AC_ARG_WITH([wireshark],
224 [build and install Wireshark plugin]),
226 no) wantshark=no mustshark=no ;;
227 yes) wantshark=yes mustshark=yes ;;
228 *) wantshark=yes mustshark=yes
229 wireshark_plugindir=$withval ;;
231 [wantshark=yes mustshark=no])
233 case "$wantshark,$wireshark_plugindir" in
235 AC_CACHE_CHECK([where to put Wireshark plugins],
236 [mdw_cv_wireshark_plugin_dir], [
237 mdw_cv_wireshark_plugin_dir=$(
238 $PKG_CONFIG --variable=plugindir "wireshark >= 1.12.1")
239 dnl It seems that the Debian package has a habit of bungling the
240 dnl plugin path (#779788, #857729, ...).
241 case "$mdw_cv_wireshark_plugin_dir" in
243 mdw_cv_wireshark_plugin_dir=${mdw_cv_wireshark_plugin_dir#/usr/}
246 case "$mdw_cv_wireshark_plugin_dir" in
248 if test ! -d "$mdw_cv_wireshark_plugin_dir"; then
249 AC_MSG_WARN([alleged Wireshark plugin directory $mdw_cv_wireshark_plugin_dir doesn't exist])
252 wireshark_plugindir=$mdw_cv_wireshark_plugin_dir
257 AC_MSG_WARN([failed to read Wireshark plugin directory])
267 case "$haveshark,$needshark" in
269 AC_MSG_ERROR([failed to configure Wireshark plugin])
272 AC_SUBST(wireshark_plugindir)
276 AM_CONDITIONAL([HAVE_WIRESHARK], [test "$haveshark" = yes])
278 dnl--------------------------------------------------------------------------
281 CFLAGS=$mdw_ORIG_CFLAGS
282 CPPFLAGS=$mdw_ORIG_CPPFLAGS
284 AC_CONFIG_HEADER([config/config.h])
285 AC_CONFIG_TESTDIR([t])
305 [t/Makefile t/atlocal])
308 dnl----- That's all, folks --------------------------------------------------