From 42ff2bdca83b95b474fb9448fc8346aaf18cdfbb Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Wed, 12 Feb 2014 20:05:49 +0000 Subject: [PATCH] build: add terastation build hacks This configure option disables known nroken support on the terastation pro. Signed-off-by: Spencer Oliver --- configure.ac | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a93c735..effbeb5 100644 --- a/configure.ac +++ b/configure.ac @@ -68,7 +68,15 @@ AC_C_BIGENDIAN # Checks for library functions. AC_FUNC_FORK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_CHECK_FUNCS([gethostname getifaddrs gettimeofday inet_ntoa memmove memset mkdir realpath select sendfile setlocale socket strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtol strtoul]) +AC_CHECK_FUNCS([gethostname getifaddrs gettimeofday inet_ntoa memmove memset mkdir realpath select setlocale socket strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtol strtoul]) + +AC_MSG_CHECKING([whether to enable terastation hacks]) +AC_ARG_ENABLE([terastation-hacks], + AS_HELP_STRING([--enable-terastation-hacks], [Enable terastation hacks]), + [enable_terastation_hacks=$enableval], [enable_terastation_hacks=no]) +AC_MSG_RESULT([$enable_terastation_hacks]) + +if test $enable_terastation_hacks = no; then # # Check for struct ip_mreqn @@ -98,6 +106,8 @@ AC_TRY_COMPILE([#include ], [ ]) ]) +fi + ################################################################################################################ # Special include directories case $host in @@ -302,6 +312,10 @@ AC_COMPILE_IFELSE( AC_MSG_RESULT([yes]) ]) +if test $enable_terastation_hacks = no; then + +AC_CHECK_FUNCS([sendfile]) + AC_MSG_CHECKING([for linux sendfile support]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -382,6 +396,8 @@ AC_COMPILE_IFELSE( [ AC_MSG_RESULT([no]) ]) +fi + CFLAGS="$CFLAGS_SAVE" LDFLAGS_SAVE="$LDFLAGS"