dnl -*-autoconf-*- dnl dnl Configuration script for TrIPE dnl dnl (c) 2001 Straylight/Edgeware dnl dnl----- Licensing notice --------------------------------------------------- dnl dnl This file is part of Trivial IP Encryption (TrIPE). dnl dnl TrIPE is free software: you can redistribute it and/or modify it under dnl the terms of the GNU General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl TrIPE is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with TrIPE. If not, see . dnl-------------------------------------------------------------------------- dnl Initialization. mdw_AUTO_VERSION AC_INIT([tripe], AUTO_VERSION, [mdw@distorted.org.uk]) AC_CONFIG_SRCDIR([server/tripe.h]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([foreign]) mdw_SILENT_RULES AC_PROG_CC AM_PROG_CC_C_O AX_CFLAGS_WARN_ALL AX_TYPE_SOCKLEN_T AC_CANONICAL_HOST AC_PROG_RANLIB AC_CHECK_PROGS([AUTOM4TE], [autom4te]) mdw_ORIG_CFLAGS=$CFLAGS mdw_ORIG_CPPFLAGS=$CPPFLAGS AC_SUBST(AM_CFLAGS) AC_SUBST(AM_CPPFLAGS) dnl-------------------------------------------------------------------------- dnl C programming environment. AC_CHECK_HEADERS([stdarg.h]) AC_SEARCH_LIBS([socket], [socket]) case "$host_os" in linux) AC_ARG_WITH([linux-includes], AS_HELP_STRING( [--with-linux-includes=DIR], [Linux kernel includes]), [AM_CPPFLAGS="AM_CPPFLAGS -I$withval"], [:]) ;; esac AC_CHECK_FUNCS([getifaddrs]) AC_ARG_WITH([adns], AS_HELP_STRING([--with-adns], [use ADNS library for background name resolution]), [want_adns=$withval], [want_adns=auto]) case $want_adns in no) ;; *) AC_CHECK_LIB([adns], [adns_submit], [have_adns=yes], [have_adns=no]) ;; esac AC_SUBST([ADNS_LIBS]) case $want_adns,$have_adns in yes,no) AC_MSG_ERROR([ADNS library not found but explicitly requested]) ;; yes,yes | auto,yes) ADNS_LIBS="-ladns" AC_DEFINE([HAVE_LIBADNS], [1], [Define if the GNU adns library is available.]) ;; esac PKG_CHECK_MODULES([mLib], [mLib >= 2.4.1]) PKG_CHECK_MODULES([catacomb], [catacomb >= 2.5.0]) AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS $catacomb_CFLAGS" dnl-------------------------------------------------------------------------- dnl Directories to install things into. dnl TRIPE_DEFINE_PATH(VAR, ARG, HELP, DEFAULT, [DEFINE, DEFINEHELP]) AC_DEFUN([TRIPE_DEFINE_PATH], [ AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=$2], [$3]), [$1=$withval], [$1=$4]) AC_SUBST([$1]) m4_if([$5], [], [], [ mdw_DEFINE_PATHS([mdw_DEFINE_PATH([$5], [$][$1], [$6])]) ]) ]) dnl Actual options. TRIPE_DEFINE_PATH( [configdir], [DIR], [keys and other configuration [[LOCALSTATE/tripe]]], ['${localstatedir}/tripe'], [CONFIGDIR], [Look for keys and other configuration here.]) TRIPE_DEFINE_PATH( [socketdir], [DIR], [admin socket [[.]]], [.], [SOCKETDIR], [Create or look for administration socket here.]) TRIPE_DEFINE_PATH( [pidfile], [FILE], [process-id [[./tripectl.pid]]], [tripectl.pid]) TRIPE_DEFINE_PATH( [initconfig], [FILE], [configuration for init script [[SYSCONFDIR/tripe.conf]]], ['${sysconfdir}/tripe.conf']) TRIPE_DEFINE_PATH( [logfile], [FILE], [logging output [[./tripe.log]]], [tripe.log]) dnl-------------------------------------------------------------------------- dnl Privilege-separation helper. mdw_DEFINE_PATHS([ AC_DEFINE_UNQUOTED([PRIVSEP_HELPER], ["mdw_PATH([$libexecdir])/mdw_PROG([tripe-privhelper])"], [Pathname of privilege-separation helper.]) ]) dnl-------------------------------------------------------------------------- dnl Other options. AC_ARG_WITH([tracing], AS_HELP_STRING( [--without-tracing], [compile out tracing support (not recommended)]), [test "$withval" = no && AC_DEFINE([NTRACE], [1], [Disable all tracing.])], [:]) dnl-------------------------------------------------------------------------- dnl Tunnel devices. dnl Provide the user with a choice. AC_ARG_WITH([tunnel], AS_HELP_STRING( [--with-tunnel=KIND], [kinds of tunnel device to use (linux, unet, bsd, slip)]), [tun=$withval], [tun=auto]) dnl If he doesn't choose, pick something sensible. if test "$tun" = auto; then AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [ mdw_cv_tunnel="" case $host_os in linux*) case `uname -r` in [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*]) mdw_cv_tunnel=linux ;; *) mdw_cv_tunnel=unet ;; esac ;; *bsd*) mdw_cv_tunnel=bsd ;; esac mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip ]) tun=$mdw_cv_tunnel fi tunnels="" for i in $tun; do case $i in linux) AC_DEFINE([TUN_LINUX], [1], [Install the Linux TUN/TAP driver.]) ;; bsd) AC_DEFINE([TUN_BSD], [1], [Install the BSD tunnel driver.]) ;; unet) AC_DEFINE([TUN_UNET], [1], [Install the obsolete Linux Usernet driver.]) ;; slip) ;; *) AC_MSG_ERROR([Unknown tunnel type]) ;; esac tunnels="$tunnels&tun_$i, " done AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0], [List of tunnel drivers to install.]) dnl-------------------------------------------------------------------------- dnl Python. dnl Find out whether Python exists at all. AM_PATH_PYTHON([2.4], [python=yes], [python=no]) AM_CONDITIONAL([HAVE_PYTHON], [test $python = yes]) dnl Find out whether we can use the various external modules. if test $python = yes; then AC_PYTHON_MODULE([pygtk]) AC_PYTHON_MODULE([cdb]) AC_PYTHON_MODULE([mLib]) AC_PYTHON_MODULE([catacomb]) fi AM_CONDITIONAL([HAVE_PYGTK], [test ${HAVE_PYMOD_PYGTK-no} = yes]) AM_CONDITIONAL([HAVE_PYCDB], [test ${HAVE_PYMOD_CDB-no} = yes]) AM_CONDITIONAL([HAVE_PYMLIB], [test ${HAVE_PYMOD_MLIB-no} = yes]) AM_CONDITIONAL([HAVE_PYCATACOMB], [test ${HAVE_PYMOD_CATACOMB-no} = yes]) dnl-------------------------------------------------------------------------- dnl Wireshark. dnl Get the user to help. wireshark_plugindir=unknown AC_ARG_WITH([wireshark], AS_HELP_STRING( [--with-wireshark], [build and install Wireshark plugin]), [case "$withval" in no) wantshark=no mustshark=no ;; yes) wantshark=yes mustshark=yes ;; *) wantshark=yes mustshark=yes wireshark_plugindir=$withval ;; esac], [wantshark=yes mustshark=no]) case "$wantshark,$wireshark_plugindir" in yes,unknown) AC_CACHE_CHECK([where to put Wireshark plugins], [mdw_cv_wireshark_plugin_dir], [ mdw_cv_wireshark_plugin_dir=$( $PKG_CONFIG --variable=plugindir "wireshark >= 1.12.1") dnl It seems that the Debian package has a habit of bungling the dnl plugin path (#779788, #857729, ...). case "$mdw_cv_wireshark_plugin_dir" in /usr//usr/*) mdw_cv_wireshark_plugin_dir=${mdw_cv_wireshark_plugin_dir#/usr/} ;; esac]) case "$mdw_cv_wireshark_plugin_dir" in /*) if test ! -d "$mdw_cv_wireshark_plugin_dir"; then AC_MSG_WARN([alleged Wireshark plugin directory $mdw_cv_wireshark_plugin_dir doesn't exist]) haveshark=no else wireshark_plugindir=$mdw_cv_wireshark_plugin_dir haveshark=yes fi ;; *) AC_MSG_WARN([failed to read Wireshark plugin directory]) haveshark=no ;; esac ;; no,*) haveshark=no ;; esac case "$haveshark,$needshark" in no,yes) AC_MSG_ERROR([failed to configure Wireshark plugin]) ;; yes,*) AC_SUBST(wireshark_plugindir) ;; esac AM_CONDITIONAL([HAVE_WIRESHARK], [test "$haveshark" = yes]) dnl-------------------------------------------------------------------------- dnl Produce output. CFLAGS=$mdw_ORIG_CFLAGS CPPFLAGS=$mdw_ORIG_CPPFLAGS AC_CONFIG_HEADER([config/config.h]) AC_CONFIG_TESTDIR([t]) AC_CONFIG_FILES( [Makefile] [common/Makefile] [uslip/Makefile] [pathmtu/Makefile] [client/Makefile] [priv/Makefile] [server/Makefile] [proxy/Makefile] [pkstream/Makefile] [wireshark/Makefile] [init/Makefile] [py/Makefile] [peerdb/Makefile] [keys/Makefile] [svc/Makefile] [mon/Makefile] [contrib/Makefile] [t/Makefile t/atlocal]) AC_OUTPUT dnl----- That's all, folks --------------------------------------------------