X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=acinclude.m4;h=abbc57e61c83e0bce84b77a7fcd3345edd30d7df;hb=7feb4503e0cacb8db445ed51593046d92d046473;hp=e074c7d47ebb0cb006ae9aa1cefe917a8cf11a9d;hpb=c72e245a0e2c979f4c14279b56183e2200905c6c;p=openvswitch diff --git a/acinclude.m4 b/acinclude.m4 index e074c7d4..abbc57e6 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,6 +1,6 @@ # -*- autoconf -*- -# Copyright (c) 2008, 2009 Nicira Networks. +# Copyright (c) 2008, 2009, 2010 Nicira Networks. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,7 +42,14 @@ AC_DEFUN([OVS_CHECK_LINUX26], [ AC_MSG_CHECKING([for Linux 2.6 source directory]) KSRC26=$KBUILD26 if test ! -e $KSRC26/include/linux/kernel.h; then - KSRC26=`(cd $KBUILD26 && pwd -P) | sed 's,-[[^-]]*$,-common,'` + case `echo "$KBUILD26" | sed 's,/*$,,'` in # ( + */build) + KSRC26=`echo "$KBUILD26" | sed 's,/build/*$,/source,'` + ;; # ( + *) + KSRC26=`(cd $KBUILD26 && pwd -P) | sed 's,-[[^-]]*$,-common,'` + ;; + esac if test ! -e $KSRC26/include/linux/kernel.h; then AC_MSG_ERROR([cannot find source directory]) fi @@ -63,8 +70,9 @@ AC_DEFUN([OVS_CHECK_LINUX26], [ AC_ERROR([Linux kernel in build tree $KBUILD26 (source tree $KSRC26) is not version 2.6]) fi fi - if ! test -e "$KBUILD26"/include/linux/version.h || \ - ! test -e "$KBUILD26"/include/linux/autoconf.h; then + if test ! -e "$KBUILD26"/include/linux/version.h || \ + (test ! -e "$KBUILD26"/include/linux/autoconf.h && \ + test ! -e "$KBUILD26"/include/generated/autoconf.h); then AC_MSG_ERROR([Linux kernel source in $KBUILD26 is not configured]) fi OVS_CHECK_LINUX26_COMPAT @@ -111,6 +119,16 @@ AC_DEFUN([OVS_CHECK_VETH], [ fi ]) +AC_DEFUN([OVS_CHECK_GRE], [ + AC_MSG_CHECKING([whether to build gre module]) + if test "$sublevel" -ge 18; then + AC_MSG_RESULT([yes]) + AC_SUBST([BUILD_GRE], 1) + else + AC_MSG_RESULT([no]) + fi +]) + AC_DEFUN([OVS_CHECK_LOG2_H], [ AC_MSG_CHECKING([for $KSRC26/include/linux/log2.h]) if test -e $KSRC26/include/linux/log2.h; then @@ -129,6 +147,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ rm -f datapath/linux-2.6/kcompat.h.new mkdir -p datapath/linux-2.6 : > datapath/linux-2.6/kcompat.h.new + OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [bool], + [OVS_DEFINE([HAVE_BOOL_TYPE])]) OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_transport_header], [OVS_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])]) OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [raw], @@ -144,6 +164,10 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ [OVS_DEFINE([HAVE_CSUM_UNFOLD])]) OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_cow], [OVS_DEFINE([HAVE_SKB_COW])]) + OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [nla_get_be16], + [OVS_DEFINE([HAVE_NLA_GET_BE16])]) + OVS_GREP_IFELSE([$KSRC26/include/linux/in.h], [ipv4_is_multicast], + [OVS_DEFINE([HAVE_IPV4_IS_MULTICAST])]) # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the # member but retain the kerneldoc comment that describes it (which @@ -153,6 +177,7 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ [OVS_DEFINE([HAVE_PROTO_DATA_VALID])]) OVS_CHECK_LOG2_H OVS_CHECK_VETH + OVS_CHECK_GRE if cmp -s datapath/linux-2.6/kcompat.h.new \ datapath/linux-2.6/kcompat.h >/dev/null 2>&1; then rm datapath/linux-2.6/kcompat.h.new @@ -191,6 +216,7 @@ AC_DEFUN([OVS_CHECK_STRTOK_R], char *token1, *token2; token1 = strtok_r(string, ":", &save_ptr); token2 = strtok_r(NULL, ":", &save_ptr); + freopen ("/dev/null", "w", stdout); printf ("%s %s\n", token1, token2); return 0; ]])],