1 dnl Check to find out whether the running kernel has support for TUN/TAP
5 dnl Check for directory with kernel source... (from ALSA)
6 AC_CACHE_CHECK([for directory with kernel source], tinc_cv_kerneldir,
8 [ --with-kernel=dir give the directory with kernel sources]
9 [ (default: /usr/src/linux)],
10 kerneldir="$withval", kerneldir="/usr/src/linux")
11 AC_DEFINE_UNQUOTED(CONFIG_TINC_KERNELDIR, "$kerneldir")
12 CONFIG_TINC_KERNELDIR="$kerneldir"
13 AC_SUBST(CONFIG_TINC_KERNELDIR)
14 AC_MSG_RESULT($kerneldir)
16 AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h,
17 [ AC_TRY_COMPILE([#include <linux/if_tun.h>],
19 if_tun_h="linux/if_tun.h",
21 if test $if_tun_h = no; then
22 AC_TRY_COMPILE([#include "$kerneldir/include/linux/if_tun.h"],
24 if_tun_h="$kerneldir/include/linux/if_tun.h",
27 if test $if_tun_h = no; then
30 AC_DEFINE(HAVE_TUNTAP)
31 AC_DEFINE_UNQUOTED(LINUX_IF_TUN_H, "$if_tun_h")
32 AC_SUBST(LINUX_IF_TUN_H)
33 AC_MSG_RESULT($if_tun_h)