From dced64c5c3625f6d2f0674e9fed14455aabc635e Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 1 Nov 2004 17:04:28 +0000 Subject: [PATCH] Check for sys/uio.h, net/if_tun.h and net/if_tap.h --- Makefile.am | 2 +- configure.in | 17 +++++++++++------ have.h | 12 ++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0667a877..306a0ed0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ SUBDIRS = m4 lib src doc po ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = config.rpath mkinstalldirs system.h COPYING.README depcomp +EXTRA_DIST = config.rpath mkinstalldirs have.h system.h COPYING.README depcomp ChangeLog: svn log > ChangeLog diff --git a/configure.in b/configure.in index 4bddb0b8..55d0f00c 100644 --- a/configure.in +++ b/configure.in @@ -46,11 +46,11 @@ case $host_os in ;; *freebsd*) AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD]) - [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ] + [ rm -f src/device.c; ln -sf bsd/device.c src/device.c ] ;; *darwin*) AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)]) - [ rm -f src/device.c; ln -sf darwin/device.c src/device.c ] + [ rm -f src/device.c; ln -sf bsd/device.c src/device.c ] ;; *solaris*) AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS]) @@ -58,11 +58,16 @@ case $host_os in ;; *openbsd*) AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD]) - [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ] + [ rm -f src/device.c; ln -sf bsd/device.c src/device.c ] ;; *netbsd*) AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) - [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ] + [ rm -f src/device.c; ln -sf bsd/device.c src/device.c ] + ;; + *bsd*) + AC_MSG_WARN("Unknown BSD variant, tinc might not compile or work!") + AC_DEFINE(HAVE_BSD, 1, [Unknown BSD variant]) + [ rm -f src/device.c; ln -sf bsd/device.c src/device.c ] ;; *cygwin*) AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) @@ -93,7 +98,7 @@ dnl Checks for header files. dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies. AC_HEADER_STDC -AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/param.h sys/time.h sys/socket.h sys/wait.h sys/mman.h netdb.h arpa/inet.h]) +AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h]) AC_CHECK_HEADERS([net/if.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h], [], [], [#include "have.h"] ) @@ -122,7 +127,7 @@ dnl Checks for library functions. AC_FUNC_MEMCMP AC_FUNC_ALLOCA AC_TYPE_SIGNAL -AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv vsyslog], +AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv vsyslog writev], [], [], [#include "have.h"] ) jm_FUNC_MALLOC diff --git a/have.h b/have.h index e5b0af83..0befb3a5 100644 --- a/have.h +++ b/have.h @@ -77,6 +77,10 @@ #include #endif +#ifdef HAVE_SYS_UIO_H +#include +#endif + /* SunOS really wants sys/socket.h BEFORE net/if.h, and FreeBSD wants these lines below the rest. */ @@ -92,6 +96,14 @@ #include #endif +#ifdef HAVE_NET_IF_TUN_H +#include +#endif + +#ifdef HAVE_NET_IF_TAP_H +#include +#endif + #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif -- 2.20.1