autoconf: Compat checks no longer support multiple files.
[sliver-openvswitch.git] / acinclude.m4
index f1322fa..2608123 100644 (file)
@@ -108,21 +108,26 @@ dnl
 dnl Greps FILE for REGEX.  If it matches, runs IF-MATCH, otherwise IF-NO-MATCH.
 AC_DEFUN([OVS_GREP_IFELSE], [
   AC_MSG_CHECKING([whether $2 matches in $1])
-  grep '$2' $1 >/dev/null 2>&1
-  status=$?
-  case $status in
-    0) 
-      AC_MSG_RESULT([yes])
-      $3
-      ;;
-    1) 
-      AC_MSG_RESULT([no])
-      $4
-      ;;
-    *) 
-      AC_MSG_ERROR([grep exited with status $status]) 
-      ;;
-  esac
+  if test -f $1; then
+    grep '$2' $1 >/dev/null 2>&1
+    status=$?
+    case $status in
+      0) 
+        AC_MSG_RESULT([yes])
+        $3
+        ;;
+      1) 
+        AC_MSG_RESULT([no])
+        $4
+        ;;
+      *) 
+        AC_MSG_ERROR([grep exited with status $status])
+        ;;
+    esac
+  else
+    AC_MSG_RESULT([file not found])
+    $4
+  fi
 ])
 
 dnl OVS_DEFINE(NAME)
@@ -151,6 +156,9 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
   mkdir -p datapath/linux-2.6
   : > datapath/linux-2.6/kcompat.h.new
 
+  OVS_GREP_IFELSE([$KSRC26/arch/x86/include/asm/checksum_32.h], [src_err,],
+                  [OVS_DEFINE([HAVE_CSUM_COPY_DBG])])
+
   OVS_GREP_IFELSE([$KSRC26/include/linux/err.h], [ERR_CAST],
                   [OVS_DEFINE([HAVE_ERR_CAST])])
 
@@ -183,8 +191,10 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
   OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_warn_if_lro],
                   [OVS_DEFINE([HAVE_SKB_WARN_LRO])])
 
-  OVS_GREP_IFELSE([$KSRC26/include/linux/string.h $KSRC26/include/linux/slab.h],
-                  [kmemdup], [OVS_DEFINE([HAVE_KMEMDUP])])
+  OVS_GREP_IFELSE([$KSRC26/include/linux/string.h], [kmemdup],
+                  [OVS_DEFINE([HAVE_KMEMDUP])],
+                  [OVS_GREP_IFELSE([$KSRC26/include/linux/slab.h], [kmemdup],
+                                   [OVS_DEFINE([HAVE_KMEMDUP])])])
 
   OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [bool],
                   [OVS_DEFINE([HAVE_BOOL_TYPE])])