ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/m4/tuntap.m4
Revision: 1.1
Committed: Sat Mar 1 15:53:02 2003 UTC (21 years, 2 months ago) by pcg
Branch: MAIN
CVS Tags: rel-1_9, rel-1_8, rel-2_01, poll-based-iom, VPE_0_9, VPE_1_2, rel-2_2, rel-2_0, VPE_1_4, VPE_1_6, rel-1_7, VPE-1_6_1, rel-2_21, rel-2_22, VPE_1_0
Log Message:
*** empty log message ***

File Contents

# Content
1 dnl Check to find out whether the running kernel has support for TUN/TAP
2
3 AC_DEFUN(tinc_TUNTAP,
4 [
5 AC_ARG_WITH(kernel,
6 [ --with-kernel=dir give the directory with kernel sources]
7 [ (default: /usr/src/linux)],
8 kerneldir="$withval",
9 kerneldir="/usr/src/linux"
10 )
11
12 AC_CACHE_CHECK([for linux/if_tun.h], tinc_cv_linux_if_tun_h,
13 [
14 AC_TRY_COMPILE([#include "$kerneldir/include/linux/if_tun.h"],
15 [int a = IFF_TAP;],
16 if_tun_h="\"$kerneldir/include/linux/if_tun.h\"",
17 [AC_TRY_COMPILE([#include <linux/if_tun.h>],
18 [int a = IFF_TAP;],
19 if_tun_h="default",
20 if_tun_h="no"
21 )]
22 )
23
24 if test $if_tun_h = no; then
25 tinc_cv_linux_if_tun_h=none
26 else
27 tinc_cv_linux_if_tun_h="$if_tun_h"
28 fi
29 ])
30
31 if test $tinc_cv_linux_if_tun_h != none; then
32 AC_DEFINE(HAVE_TUNTAP, 1, [Universal tun/tap driver present])
33 if test $tinc_cv_linux_if_tun_h != default; then
34 AC_DEFINE_UNQUOTED(LINUX_IF_TUN_H, $tinc_cv_linux_if_tun_h, [Location of if_tun.h])
35 fi
36 fi
37 AC_SUBST(LINUX_IF_TUN_H)
38 AC_SUBST(HAVE_TUNTAP)
39 ])