X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/207f030a4f7085c1d2935e551ac9320cc44b24f7..HEAD:/configure.ac diff --git a/configure.ac b/configure.ac index 6f11c663..47c26585 100644 --- a/configure.ac +++ b/configure.ac @@ -9,19 +9,18 @@ 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 -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. +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, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. +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, write to the Free Software Foundation, -dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl along with TrIPE. If not, see . dnl-------------------------------------------------------------------------- dnl Initialization. @@ -38,7 +37,7 @@ AM_PROG_CC_C_O AX_CFLAGS_WARN_ALL AX_TYPE_SOCKLEN_T AC_CANONICAL_HOST -AM_PROG_LIBTOOL +AC_PROG_RANLIB AC_CHECK_PROGS([AUTOM4TE], [autom4te]) @@ -64,8 +63,31 @@ case "$host_os" in ;; esac -PKG_CHECK_MODULES([mLib], [mLib >= 2.2.1]) -PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.4]) +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" @@ -195,101 +217,53 @@ AM_CONDITIONAL([HAVE_PYCATACOMB], [test ${HAVE_PYMOD_CATACOMB-no} = yes]) dnl-------------------------------------------------------------------------- dnl Wireshark. -dnl -dnl This is all distressingly ugly and complicated. Why they can't just -dnl provide a pkg-config dropping containing all the useful information about -dnl the installation I don't know. - -WIRESHARK_CFLAGS="" -: ${wireshark_plugindir=unknown} dnl Get the user to help. +wireshark_plugindir=unknown AC_ARG_WITH([wireshark], AS_HELP_STRING( - [--with-wireshark[=DIR]], + [--with-wireshark], [build and install Wireshark plugin]), [case "$withval" in - no) haveshark=no needshark=no ;; - yes) haveshark=yes needshark=yes ;; - *) haveshark=yes needshark=yes + no) wantshark=no mustshark=no ;; + yes) wantshark=yes mustshark=yes ;; + *) wantshark=yes mustshark=yes wireshark_plugindir=$withval ;; esac], - [haveshark=yes needshark=no]) + [wantshark=yes mustshark=no]) -dnl Try to find the Wireshark installation directory the hard way. This is -dnl remarkably annoying. This is, unfortunately, very likely to guess wrong, -dnl but there doesn't seem to be a better way. -case "$haveshark,$wireshark_plugindir" in +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=$( - for i in \ - $libexecdir $libdir $exec_prefix/lib $prefix/lib \ - /usr/local/lib /usr/lib - do - for j in \ - wireshark/plugins/* wireshark/*/plugins \ - */wireshark/plugins/* */wireshark/*/plugins - do - for k in $i/$j/*.so; do - if test -f "$k"; then - echo $(AS_DIRNAME(["$k"])) - exit - fi - done - done - done - echo "failed" - ) - ]) - case $mdw_cv_wireshark_plugin_dir in - failed) haveshark=no ;; - *) wireshark_plugindir=$mdw_cv_wireshark_plugin_dir ;; - esac -esac - -dnl If we're still interested, find Glib. -case "$haveshark" in - yes) AM_PATH_GLIB_2_0([2.4.0], [], [haveshark=false], [gmodule]) ;; -esac - -dnl Find the include directory. This would be much easier if they just -dnl provided a pkg-config file. -case "$haveshark" in - yes) - bad=yes - mdw_CFLAGS=$CFLAGS - wsprefix=`echo $wireshark_plugindir | sed 's:/lib/.*$::'` - AC_CACHE_CHECK([how to find the Wireshark headers], - [mdw_cv_wireshark_includes], [ - mdw_cv_wireshark_includes=failed - for i in \ - "" \ - "-I${wsprefix}/include/wireshark" \ - "-I${wsprefix}/include" \ - "-I${prefix}/include/wireshark" \ - "-I${prefix}/include" \ - "-I/usr/include/wireshark" \ - "-I/usr/local/include/wireshark" \ - "-I/usr/local/include"; do - CFLAGS="$GLIB_CFLAGS $i" - AC_TRY_COMPILE([ -#include -#include -#include -#include ], - [dissector_handle_t dh; dh = create_dissector_handle(0, 0);], - [bad=no; break]) - done - case "$bad" in - no) mdw_cv_wireshark_includes=$i ;; - esac - CFLAGS=$mdw_CFLAGS - ]) - case "$mdw_cv_wireshark_includes" in - failed) haveshark=no ;; + $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 @@ -297,8 +271,6 @@ case "$haveshark,$needshark" in AC_MSG_ERROR([failed to configure Wireshark plugin]) ;; yes,*) - WIRESHARK_CFLAGS="$GLIB_CFLAGS $mdw_cv_wireshark_includes" - AC_SUBST(WIRESHARK_CFLAGS) AC_SUBST(wireshark_plugindir) ;; esac