229 |
|
AC_HEADER_STDC |
230 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
231 |
|
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
232 |
+ |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h) |
233 |
|
|
234 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
235 |
|
AC_C_BIGENDIAN |
413 |
|
fi |
414 |
|
]) |
415 |
|
|
416 |
+ |
dnl Check that the host supports TUN/TAP devices |
417 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
418 |
+ |
ac_cv_tun_tap_support, [ |
419 |
+ |
AC_TRY_COMPILE([ |
420 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
421 |
+ |
#include <linux/if.h> |
422 |
+ |
#include <linux/if_tun.h> |
423 |
+ |
#endif |
424 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
425 |
+ |
#include <net/if.h> |
426 |
+ |
#include <net/if_tun.h> |
427 |
+ |
#endif |
428 |
+ |
], [ |
429 |
+ |
struct ifreq ifr; |
430 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
431 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
432 |
+ |
], |
433 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
434 |
+ |
) |
435 |
+ |
]) |
436 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
437 |
+ |
[Define if your system supports TUN/TAP devices.]) |
438 |
+ |
|
439 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
440 |
|
have_mach_vm=no |
441 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |