From: Alon Bar-Lev Date: Mon, 26 Mar 2012 21:26:36 +0000 (+0200) Subject: build: tap: search for tap header X-Git-Tag: v2.3_alpha2~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cacdfd4b7;p=thirdparty%2Fopenvpn.git build: tap: search for tap header Windows and solaris has something in common, in both the tap header is external. So make the Windows tap-windows.h search common to all platform. Display an error if we cannot find tap header. Signed-off-by: Alon Bar-Lev Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- diff --git a/configure.ac b/configure.ac index b0dcdb7d5..d217343bb 100644 --- a/configure.ac +++ b/configure.ac @@ -365,11 +365,9 @@ AC_CHECK_HEADERS([ \ AC_CHECK_HEADERS([ \ sys/time.h sys/un.h sys/ioctl.h sys/stat.h \ sys/mman.h sys/file.h \ - unistd.h signal.h libgen.h \ + unistd.h signal.h libgen.h stropts.h \ syslog.h pwd.h grp.h \ - net/if_tun.h net/tun/if_tun.h stropts.h \ - sys/sockio.h \ - sys/uio.h linux/if_tun.h linux/sockios.h \ + sys/sockio.h sys/uio.h linux/sockios.h \ linux/types.h sys/poll.h sys/epoll.h err.h \ ]) @@ -586,6 +584,20 @@ else fi LIBS="${old_LIBS}" +AC_ARG_VAR([TAP_CFLAGS], [C compiler flags for tap]) +old_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} ${TAP_CFLAGS}" +AC_CHECK_HEADERS( + [ \ + net/if_tun.h net/tun/if_tun.h \ + linux/if_tun.h \ + tap-windows.h \ + ], + [have_tap_header="yes"] +) +CFLAGS="${old_CFLAGS}" +test "${have_tap_header}" = "yes" || AC_MSG_ERROR([no tap header could be found]) + AC_CHECK_LIB( [selinux], [setcon], @@ -672,18 +684,6 @@ PKG_CHECK_MODULES( )] ) -AC_ARG_VAR([TAP_WINDOWS_CFLAGS], [C compiler flags for TAP-Windows]) -if test "${WIN32}" = "yes"; then - old_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} ${TAP_WINDOWS_CFLAGS}" - AC_CHECK_HEADERS( - [tap-windows.h], - , - [AC_MSG_ERROR([tap-windows.h is required but missing])] - ) - CFLAGS="${old_CFLAGS}" -fi - if test "${have_openssl_crypto}" = "yes"; then saved_CFLAGS="${CFLAGS}" saved_LIBS="${LIBS}" diff --git a/src/openvpn/Makefile.am b/src/openvpn/Makefile.am index 1410021df..01ff732e7 100644 --- a/src/openvpn/Makefile.am +++ b/src/openvpn/Makefile.am @@ -22,7 +22,7 @@ INCLUDES = \ -I$(top_srcdir)/src/compat AM_CFLAGS = \ - $(TAP_WINDOWS_CFLAGS) \ + $(TAP_CFLAGS) \ $(OPTIONAL_CRYPTO_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS)