dnl dnl TUN - Universal TUN/TAP device driver. dnl Copyright (C) 1999-2000 Maxim Krasnyansky dnl dnl This program 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 dnl This program 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 dnl $Id: configure.in,v 1.4 2000/05/04 19:24:53 maxk Exp $ dnl dnl Process this file with autoconf to produce a configure script. dnl AC_INIT() AC_SUBST(KDIR) AC_SUBST(KVER) AC_SUBST(ARCH) AC_SUBST(VNODE) AC_PROG_AWK AC_PROG_INSTALL AC_ARG_WITH(kernel, --with-kernel=DIR Kernel source location, KDIR="$withval", KDIR=/usr/src/sys ) AC_ARG_WITH(devno, --with-devno=NUM Number of supported devices, AC_DEFINE(NTAP, $withval), AC_DEFINE(NTAP, 4) ) AC_ARG_ENABLE(bpf, --disable-bpf Disable BPF, AC_DEFINE(NBPFILTER, 0), AC_DEFINE(NBPFILTER, 1) ) AC_ARG_ENABLE(bridge, --enable-bridge Enable bridge, AC_DEFINE(BRIDGE, 1) ) AC_DEFINE(INET, 1) # Check kernel sources AC_TEST_FILES(Makefile kern/kern_conf.c, $KDIR, , AC_MSG_ERROR( FreeBSD kernel source not found in $KDIR ) ) ARCH=`uname -m` KVER=`uname -r | cut -d '-' -f 1` case $KVER in 3.*) AC_DEFINE(KERNEL) TDIR=3.X VNODE="sh @/kern/vnode_if.sh @/kern/vnode_if.src" ;; 4.*) AC_DEFINE(_KERNEL) TDIR=4.X VNODE="perl @/kern/vnode_if.pl -h @/kern/vnode_if.src" ;; 5.*) AC_DEFINE(_KERNEL) TDIR=4.X VNODE="perl @/kern/vnode_if.pl -h @/kern/vnode_if.src" ;; esac AC_TEST_FILES(if_tap.c if_tap.h, $TDIR, , AC_MSG_ERROR( Unsupported kernel version. ) ) AC_LINK_FILES($TDIR/if_tap.c $TDIR/if_tap.h, if_tap.c if_tap.h) AC_MSG_RESULT(Linking kernel source to @) ln -s $KDIR @ ln -s $KDIR/$ARCH/include machine AC_DEFINE_UNQUOTED(TUN_VER, "$TUN_VER") AC_OUTPUT(Makefile)