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"], [:])
66 AC_CHECK_FUNCS([getifaddrs])
69 AS_HELP_STRING([--with-adns],
70 [use ADNS library for background name resolution]),
75 *) AC_CHECK_LIB([adns], [adns_submit], [have_adns=yes], [have_adns=no]) ;;
78 case $want_adns,$have_adns in
80 AC_MSG_ERROR([ADNS library not found but explicitly requested])
84 AC_DEFINE([HAVE_LIBADNS], [1],
85 [Define if the GNU adns library is available.])
89 PKG_CHECK_MODULES([mLib], [mLib >= 2.2.1])
90 PKG_CHECK_MODULES([catacomb], [catacomb >= 2.5.0])
92 AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
94 dnl--------------------------------------------------------------------------
95 dnl Directories to install things into.
97 dnl TRIPE_DEFINE_PATH(VAR, ARG, HELP, DEFAULT, [DEFINE, DEFINEHELP])
98 AC_DEFUN([TRIPE_DEFINE_PATH], [
99 AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=$2], [$3]),
100 [$1=$withval], [$1=$4])
102 m4_if([$5], [], [], [
103 mdw_DEFINE_PATHS([mdw_DEFINE_PATH([$5], [$][$1], [$6])])
109 [configdir], [DIR], [keys and other configuration [[LOCALSTATE/tripe]]],
110 ['${localstatedir}/tripe'],
111 [CONFIGDIR], [Look for keys and other configuration here.])
114 [socketdir], [DIR], [admin socket [[.]]], [.],
115 [SOCKETDIR], [Create or look for administration socket here.])
118 [pidfile], [FILE], [process-id [[./tripectl.pid]]], [tripectl.pid])
121 [initconfig], [FILE],
122 [configuration for init script [[SYSCONFDIR/tripe.conf]]],
123 ['${sysconfdir}/tripe.conf'])
126 [logfile], [FILE], [logging output [[./tripe.log]]], [tripe.log])
128 dnl--------------------------------------------------------------------------
129 dnl Privilege-separation helper.
132 AC_DEFINE_UNQUOTED([PRIVSEP_HELPER],
133 ["mdw_PATH([$libexecdir])/mdw_PROG([tripe-privhelper])"],
134 [Pathname of privilege-separation helper.])
137 dnl--------------------------------------------------------------------------
140 AC_ARG_WITH([tracing],
143 [compile out tracing support (not recommended)]),
144 [test "$withval" = no &&
145 AC_DEFINE([NTRACE], [1], [Disable all tracing.])],
148 dnl--------------------------------------------------------------------------
151 dnl Provide the user with a choice.
152 AC_ARG_WITH([tunnel],
154 [--with-tunnel=KIND],
155 [kinds of tunnel device to use (linux, unet, bsd, slip)]),
156 [tun=$withval], [tun=auto])
158 dnl If he doesn't choose, pick something sensible.
159 if test "$tun" = auto; then
160 AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [
165 [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*])
177 mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip
185 linux) AC_DEFINE([TUN_LINUX], [1],
186 [Install the Linux TUN/TAP driver.]) ;;
187 bsd) AC_DEFINE([TUN_BSD], [1],
188 [Install the BSD tunnel driver.]) ;;
189 unet) AC_DEFINE([TUN_UNET], [1],
190 [Install the obsolete Linux Usernet driver.]) ;;
192 *) AC_MSG_ERROR([Unknown tunnel type]) ;;
194 tunnels="$tunnels&tun_$i, "
196 AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0],
197 [List of tunnel drivers to install.])
199 dnl--------------------------------------------------------------------------
202 dnl Find out whether Python exists at all.
203 AM_PATH_PYTHON([2.4], [python=yes], [python=no])
204 AM_CONDITIONAL([HAVE_PYTHON], [test $python = yes])
206 dnl Find out whether we can use the various external modules.
207 if test $python = yes; then
208 AC_PYTHON_MODULE([pygtk])
209 AC_PYTHON_MODULE([cdb])
210 AC_PYTHON_MODULE([mLib])
211 AC_PYTHON_MODULE([catacomb])
213 AM_CONDITIONAL([HAVE_PYGTK], [test ${HAVE_PYMOD_PYGTK-no} = yes])
214 AM_CONDITIONAL([HAVE_PYCDB], [test ${HAVE_PYMOD_CDB-no} = yes])
215 AM_CONDITIONAL([HAVE_PYMLIB], [test ${HAVE_PYMOD_MLIB-no} = yes])
216 AM_CONDITIONAL([HAVE_PYCATACOMB], [test ${HAVE_PYMOD_CATACOMB-no} = yes])
218 dnl--------------------------------------------------------------------------
221 dnl Get the user to help.
222 wireshark_plugindir=unknown
223 AC_ARG_WITH([wireshark],
226 [build and install Wireshark plugin]),
228 no) wantshark=no mustshark=no ;;
229 yes) wantshark=yes mustshark=yes ;;
230 *) wantshark=yes mustshark=yes
231 wireshark_plugindir=$withval ;;
233 [wantshark=yes mustshark=no])
235 case "$wantshark,$wireshark_plugindir" in
237 AC_CACHE_CHECK([where to put Wireshark plugins],
238 [mdw_cv_wireshark_plugin_dir], [
239 mdw_cv_wireshark_plugin_dir=$(
240 $PKG_CONFIG --variable=plugindir "wireshark >= 1.12.1")
241 dnl It seems that the Debian package has a habit of bungling the
242 dnl plugin path (#779788, #857729, ...).
243 case "$mdw_cv_wireshark_plugin_dir" in
245 mdw_cv_wireshark_plugin_dir=${mdw_cv_wireshark_plugin_dir#/usr/}
248 case "$mdw_cv_wireshark_plugin_dir" in
250 if test ! -d "$mdw_cv_wireshark_plugin_dir"; then
251 AC_MSG_WARN([alleged Wireshark plugin directory $mdw_cv_wireshark_plugin_dir doesn't exist])
254 wireshark_plugindir=$mdw_cv_wireshark_plugin_dir
259 AC_MSG_WARN([failed to read Wireshark plugin directory])
269 case "$haveshark,$needshark" in
271 AC_MSG_ERROR([failed to configure Wireshark plugin])
274 AC_SUBST(wireshark_plugindir)
278 AM_CONDITIONAL([HAVE_WIRESHARK], [test "$haveshark" = yes])
280 dnl--------------------------------------------------------------------------
283 CFLAGS=$mdw_ORIG_CFLAGS
284 CPPFLAGS=$mdw_ORIG_CPPFLAGS
286 AC_CONFIG_HEADER([config/config.h])
287 AC_CONFIG_TESTDIR([t])
307 [t/Makefile t/atlocal])
310 dnl----- That's all, folks --------------------------------------------------