2000-10-15 17:26:31 +00:00
|
|
|
dnl Check to find out whether the running kernel has support for TUN/TAP
|
|
|
|
|
|
|
|
AC_DEFUN(tinc_TUNTAP,
|
|
|
|
[
|
2001-06-21 18:28:52 +00:00
|
|
|
AC_ARG_WITH(kernel,
|
|
|
|
[ --with-kernel=dir give the directory with kernel sources]
|
|
|
|
[ (default: /usr/src/linux)],
|
|
|
|
kerneldir="$withval",
|
|
|
|
kerneldir="/usr/src/linux"
|
|
|
|
)
|
|
|
|
|
2000-10-15 17:26:31 +00:00
|
|
|
AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h,
|
2001-06-21 18:28:52 +00:00
|
|
|
[
|
|
|
|
AC_TRY_COMPILE([#include "$kerneldir/include/linux/if_tun.h"],
|
|
|
|
[int a = IFF_TAP;],
|
|
|
|
if_tun_h="\"$kerneldir/include/linux/if_tun.h\"",
|
|
|
|
[AC_TRY_COMPILE([#include <linux/if_tun.h>],
|
|
|
|
[int a = IFF_TAP;],
|
2001-07-15 14:21:12 +00:00
|
|
|
if_tun_h="default",
|
2001-06-21 18:28:52 +00:00
|
|
|
if_tun_h="no"
|
|
|
|
)]
|
|
|
|
)
|
|
|
|
|
|
|
|
if test $if_tun_h = no; then
|
2000-11-14 23:18:19 +00:00
|
|
|
tinc_cv_linux_if_tun_h=none
|
2000-10-15 17:26:31 +00:00
|
|
|
else
|
2001-06-26 22:00:57 +00:00
|
|
|
tinc_cv_linux_if_tun_h="$if_tun_h"
|
2000-10-15 17:26:31 +00:00
|
|
|
fi
|
|
|
|
])
|
2001-02-18 02:13:26 +00:00
|
|
|
|
|
|
|
if test $tinc_cv_linux_if_tun_h != none; then
|
|
|
|
AC_DEFINE(HAVE_TUNTAP)
|
2001-07-15 14:21:12 +00:00
|
|
|
if test $tinc_cv_linux_if_tun_h != default; then
|
|
|
|
AC_DEFINE_UNQUOTED(LINUX_IF_TUN_H, $tinc_cv_linux_if_tun_h)
|
|
|
|
fi
|
2001-02-18 02:13:26 +00:00
|
|
|
fi
|
2001-07-15 14:21:12 +00:00
|
|
|
AC_SUBST(LINUX_IF_TUN_H)
|
2001-02-18 02:13:26 +00:00
|
|
|
AC_SUBST(HAVE_TUNTAP)
|
2000-10-15 17:26:31 +00:00
|
|
|
])
|