]> git.meshlink.io Git - meshlink/blob - m4/tuntap.m4
- Updated subnet list handling. Subnets are added to two lists now, the
[meshlink] / m4 / tuntap.m4
1 dnl Check to find out whether the running kernel has support for TUN/TAP
2
3 AC_DEFUN(tinc_TUNTAP,
4 [
5 dnl Check for directory with kernel source... (from ALSA)
6 AC_CACHE_CHECK([for directory with kernel source], tinc_cv_kerneldir,
7 [ AC_ARG_WITH(kernel,
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)
15 ])
16 AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h,
17 [ AC_TRY_COMPILE([#include <linux/if_tun.h>],
18   [int a = IFF_TAP],
19   if_tun_h="linux/if_tun.h",
20   if_tun_h="no")
21   if test $if_tun_h = no; then
22     AC_TRY_COMPILE([#include "$kerneldir/include/linux/if_tun.h"],
23     [int a = IFF_TAP],
24     if_tun_h="$kerneldir/include/linux/if_tun.h",
25     if_tun_h="no")
26   fi
27   if test $if_tun_h = no; then
28     AC_MSG_RESULT(none)
29   else
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)
34   fi
35   AC_SUBST(HAVE_TUNTAP)
36 ])
37 ])