+AM_PROG_LIBTOOL
+python=no
+mdw_PROG_PYTHON([2.3],
+ [python=yes
+ pyscripts='${PYTHONSCRIPTS}'
+ pymans='${PYTHONMANS}'])
+AC_SUBST([pyscripts]) AC_SUBST([pymans])
+
+if test $python = yes; then
+ mdw_CHECK_PYTHON([2.3])
+ AC_CACHE_CHECK([for pygtk], [mdw_cv_pygtk], [
+ mdw_cv_pygtk=no
+ python -c >&5 2>&5 '
+import pygtk
+pygtk.require("2.0")
+import gtk
+' && mdw_cv_pygtk=yes
+ ])
+ if test $mdw_cv_pygtk = yes; then
+ pygtkscripts='${PYGTKSCRIPTS}'
+ pygtkmans='${PYGTKMANS}'
+ fi
+fi
+AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans])
+
+AC_CHECK_HEADERS([stdarg.h])
+mdw_GCC_FLAGS([-Wall])
+mdw_OPT_TRACE
+
+AC_ARG_WITH([linux-includes],
+[ --with-linux-includes=DIR
+ search for Linux kernel includes in DIR],
+[CFLAGS="$CFLAGS -I$withval"],
+[:])
+
+AC_ARG_WITH([configdir],
+[ --with-configdir=DIR look for keys and other configuration in DIR
+ [default=/var/lib/tripe]],
+[configdir=$withval],
+[configdir=/var/lib/tripe])
+
+AC_ARG_WITH([socketdir],
+[ --with-socketdir=DIR put admin socket in DIR [default=.]],
+[socketdir=$withval],
+[socketdir=.])
+
+AC_ARG_WITH([pidfile],
+[ --with-pidfile=FILE make tripectl write its pid to FILE
+ [default=./tripectl.pid]],
+[pidfile=$withval],
+[pidfile=tripectl.pid])
+
+AC_ARG_WITH([initconfig],
+[ --with-initconfig=FILE read definitions from FILE in init script
+ [default=/etc/tripe.conf]],
+[initconfig=$withval],
+[initconfig=/etc/tripe.conf])
+
+AC_ARG_WITH([logfile],
+[ --with-logfile=DIR make tripectl write its log to FILE
+ [default=./tripe.log]],
+[logfile=$withval],
+[logfile=tripe.log])
+
+DIRS=""
+ETHEREAL_CFLAGS=""
+ETHEREAL_PLUGIN_DIR="unknown"
+AC_ARG_WITH([ethereal],
+[ --with-ethereal build and install Ethereal plugin],
+[case "$withval" in
+ no) ethereal=false requireethereal=false;;
+ yes) ethereal=true; requireethereal=true;;
+ *) ethereal=true requireethereal=true ETHEREAL_PLUGIN_DIR=$withval;;
+esac],
+[ethereal=true requireethereal=false])
+
+tun=auto
+AC_ARG_WITH([tunnel],
+[ --with-tunnel=KIND kinds of tunnel device to use
+ (linux, unet, bsd, slip)],
+[tun=$withval])
+
+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
+changequote(,)dnl
+ 2.[4-9].* | 2.[1-9][0-9]*.* | [3-9].* | [1-9][0-9]*.*)
+changequote([,])dnl
+ 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