chiark / gitweb /
Version bump; new email address.
[tripe] / configure.in
index 65c9edc2baa7ae98533dbb03c5c314a452ac5fbb..c6d702e72207b0f40ee9bac8882afaeb6b93b260 100644 (file)
@@ -1,6 +1,6 @@
 dnl -*-autoconf-*-
 dnl
-dnl $Id: configure.in,v 1.15 2004/04/08 01:36:17 mdw Exp $
+dnl $Id$
 dnl
 dnl Configuration script for TrIPE
 dnl
@@ -26,13 +26,14 @@ dnl along with TrIPE; if not, write to the Free Software Foundation,
 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 AC_INIT(tripe.c)
-AM_INIT_AUTOMAKE(tripe, 1.0.0pre6)
+AM_INIT_AUTOMAKE(tripe, 1.0.0pre7)
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_HOST
 
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AM_PROG_LIBTOOL
+AC_CHECK_HEADERS([stdarg.h])
 mdw_GCC_FLAGS([-Wall])
 mdw_OPT_TRACE
 
@@ -83,33 +84,48 @@ AC_ARG_WITH([ethereal],
 esac],
 [ethereal=true requireethereal=false])
 
-case $host_os in
-  linux*)
-    case `uname -r` in
+tun=guess
+AC_ARG_WITH([tunnel],
+[  --with-tunnel=KIND      kind of tunnel device to use
+                            (linux, unet, bsd, slip)],
+[tun=$withval])
+
+if test "$tun" = guess; then
+  AC_CACHE_CHECK([tunnel device to use], [mdw_cv_tunnel], [
+    case $host_os in
+      linux*)
+       case `uname -r` in
 changequote(,)dnl
-      2.[4-9].* | 2.[1-9][0-9]*.* | [3-9].* | [1-9][0-9]*.*)
+         2.[4-9].* | 2.[1-9][0-9]*.* | [3-9].* | [1-9][0-9]*.*)
 changequote([,])dnl
-       tun=linux
-       AC_DEFINE([TUN_TYPE], [TUN_LINUX])
+           mdw_cv_tunnel=linux
+           ;;
+         *)
+           mdw_cv_tunnel=unet
+           ;;
+       esac
+       ;;
+      *bsd*)
+       mdw_cv_tunnel=bsd
        ;;
       *)
-       tun=unet
-       AC_DEFINE([TUN_TYPE], [TUN_UNET])
+        mdw_cv_tunnel=slip
        ;;
     esac
-    ;;
-  *bsd*)
-    tun=bsd
-    AC_DEFINE([TUN_TYPE], [TUN_BSD])
-    ;;
-  *)
-    AC_MSG_ERROR([Unsupported OS: no tunnel interface available])
-    ;;
+  ])
+  tun=$mdw_cv_tunnel
+fi
+
+case $tun in
+  linux | unet | bsd | slip) ;;
+  *) AC_MSG_ERROR([Unknown tunnel type]) ;;
 esac
+AC_DEFINE_UNQUOTED([TUN_TYPE], [TUN_`echo $tun | tr a-z A-Z`],
+  [Set to the tunnel driver for your OS.  See TUN_* in tripe.h.])
 AC_SUBST(tun)
 
 mdw_MLIB(2.0.0)
-mdw_CATACOMB(2.0.1, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"])
+mdw_CATACOMB(2.1.0, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"])
 
 if test "$ethereal" = true -a "$ETHEREAL_PLUGIN_DIR" = unknown; then
   AC_CACHE_CHECK([where to put Ethereal plugins], 
@@ -118,14 +134,14 @@ if test "$ethereal" = true -a "$ETHEREAL_PLUGIN_DIR" = unknown; then
     mdw_cv_ethereal_plugin_dir="failed"
     ethprefix=none
     for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
-      if test -x "$i/bin/ethereal"; then
+      if test -x "$i/bin/tethereal"; then
         ethprefix=$i
         break
       fi
     done
     if test "$ethprefix" != none; then
-      ethbin=$ethprefix/bin/ethereal
-      ethver=`$ethbin -v | sed 's/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/'`
+      ethbin=$ethprefix/bin/tethereal
+      ethver=`$ethbin -v | sed 's/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q'`
       dir=$ethprefix/lib/ethereal/plugins/$ethver
       if test -d "$dir"; then
         mdw_cv_ethereal_plugin_dir=$dir
@@ -162,10 +178,11 @@ if test "$ethereal" = true; then
       AC_TRY_COMPILE([
 #include <netinet/in.h>
 #include <glib.h>
-#include <epan/packet.h>
+#include <ethereal/config.h>
+#include <ethereal/epan/packet.h>
 ], [
        dissector_handle_t dh;
-       dh = creat_dissector_handle(0, 0);
+       dh = create_dissector_handle(0, 0);
       ], [bad=false; break])
     done
     if test $bad = false; then
@@ -180,26 +197,6 @@ if test "$ethereal" = true; then
 fi
 
 if test "$ethereal" = true; then
-  AC_CACHE_CHECK([whether the Ethereal headers are broken],
-    [mdw_cv_ethereal_buggered], [
-    CFLAGS="$GLIB_CFLAGS $i"
-    AC_TRY_COMPILE([
-#include <netinet/in.h>
-#include <glib.h>
-#include <epan/packet.h>
-#include <plugins/plugin_api.h>
-], [
-      G_MODULE_EXPORT void plugin_init(plugin_address_table_t *pat)
-      {
-        plugin_address_table_init(pat);
-      }
-    ], [mdw_cv_ethereal_buggered=no], [mdw_cv_ethereal_buggered=yes])
-    CFLAGS=$mdw_CFLAGS
-  ])
-  if test $mdw_cv_ethereal_buggered = yes; then
-    AC_DEFINE(ETHEREAL_BUGGERED)
-  fi
-
   ETHEREAL_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_ethereal_includes"
   AC_SUBST(ETHEREAL_CFLAGS)
   AC_SUBST(ETHEREAL_PLUGIN_DIR)
@@ -210,6 +207,10 @@ if test "$ethereal" = false -a "$requireethereal" = true; then
   AC_MSG_ERROR([failed to configure Ethereal plugin])
 fi
 
+AH_TEMPLATE([CONFIGDIR],
+            [Tripe should look here for keys and other configuration.])
+AH_TEMPLATE([SOCKETDIR],
+            [Tripe should make its administration socket here.])
 mdw_DEFINE_PATHS([
   mdw_DEFINE_PATH([CONFIGDIR], [$configdir])
   mdw_DEFINE_PATH([SOCKETDIR], [$socketdir])