X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=acinclude.m4;h=3cf793d425b61487e4a4e801c8e5d5b87e995ffb;hb=29d7226e8b17ce1891aaba8f3009715b24fa664f;hp=0cd14272d72057a797b3d4f3b68528283f32456c;hpb=d31f1109f10e5ffb9bf266306b913ebf23781666;p=openvswitch diff --git a/acinclude.m4 b/acinclude.m4 index 0cd14272..3cf793d4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -14,6 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +dnl OVS_ENABLE_WERROR +AC_DEFUN([OVS_ENABLE_WERROR], + [AC_ARG_ENABLE( + [Werror], + [AC_HELP_STRING([--enable-Werror], [Add -Werror to CFLAGS])], + [], [enable_Werror=no]) + AC_CONFIG_COMMANDS_PRE( + [if test "X$enable_Werror" = Xyes; then + CFLAGS="$CFLAGS -Werror" + fi])]) + dnl OVS_CHECK_LINUX26 dnl dnl Configure linux kernel source tree @@ -167,7 +178,12 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro]) OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_stats]) + OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_by_index_rcu]) + OVS_GREP_IFELSE([$KSRC26/include/linux/rcupdate.h], [rcu_read_lock_held], [], + [OVS_GREP_IFELSE([$KSRC26/include/linux/rtnetlink.h], + [rcu_read_lock_held])]) + # 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 @@ -204,6 +220,11 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [nla_get_be16]) OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [nla_find_nested]) + OVS_GREP_IFELSE([$KSRC26/include/linux/if_link.h], [rtnl_link_stats64]) + + OVS_GREP_IFELSE([$KSRC26/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD], + [OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])]) + OVS_CHECK_LOG2_H if cmp -s datapath/linux-2.6/kcompat.h.new \ @@ -300,3 +321,64 @@ AC_DEFUN([OVS_CONDITIONAL_CC_OPTION], [$1], [ovs_have_cc_option=yes], [ovs_have_cc_option=no]) AM_CONDITIONAL([$2], [test $ovs_have_cc_option = yes])]) dnl ---------------------------------------------------------------------- + +dnl Check for too-old XenServer. +AC_DEFUN([OVS_CHECK_XENSERVER_VERSION], + [AC_CACHE_CHECK([XenServer release], [ovs_cv_xsversion], + [if test -e /etc/redhat-release; then + ovs_cv_xsversion=`sed -n 's/^XenServer DDK release \([[^-]]*\)-.*/\1/p' /etc/redhat-release` + fi + if test -z "$ovs_cv_xsversion"; then + ovs_cv_xsversion=none + fi]) + case $ovs_cv_xsversion in + none) + ;; + + [[1-9]][[0-9]]* | dnl XenServer 10 or later + [[6-9]]* | dnl XenServer 6 or later + 5.[[7-9]]* | dnl XenServer 5.7 or later + 5.6.[[1-9]][[0-9]][[0-9]][[0-9]]* | dnl XenServer 5.6.1000 or later + 5.6.[[2-9]][[0-9]][[0-9]]* | dnl XenServer 5.6.200 or later + 5.6.1[[0-9]][[0-9]]) dnl Xenserver 5.6.100 or later + ;; + + *) + AC_MSG_ERROR([This appears to be XenServer $ovs_cv_xsversion, but only XenServer 5.6.100 or later is supported. (If you are really using a supported version of XenServer, you may override this error message by specifying 'ovs_cv_xsversion=5.6.100' on the "configure" command line.)]) + ;; + esac]) + +dnl OVS_MAKE_HAS_IF([if-true], [if-false]) +dnl +dnl Checks whether make has the GNU make $(if condition,then,else) extension. +dnl Runs 'if-true' if so, 'if-false' otherwise. +AC_DEFUN([OVS_MAKE_HAS_IF], + [AC_CACHE_CHECK( + [whether ${MAKE-make} has GNU make \$(if) extension], + [ovs_cv_gnu_make_if], + [cat <<'EOF' > conftest.mk +conftest.out: + echo $(if x,y,z) > conftest.out +.PHONY: all +EOF + rm -f conftest.out + AS_ECHO(["$as_me:$LINENO: invoking ${MAKE-make} -f conftest.mk all:"]) >&AS_MESSAGE_LOG_FD 2>&1 + ${MAKE-make} -f conftest.mk conftest.out >&AS_MESSAGE_LOG_FD 2>&1 + AS_ECHO(["$as_me:$LINENO: conftest.out contains:"]) >&AS_MESSAGE_LOG_FD 2>&1 + cat conftest.out >&AS_MESSAGE_LOG_FD 2>&1 + result=`cat conftest.out` + rm -f conftest.mk conftest.out + if test "X$result" = "Xy"; then + ovs_cv_gnu_make_if=yes + else + ovs_cv_gnu_make_if=no + fi]) + AS_IF([test $ovs_cv_gnu_make_if = yes], [$1], [$2])]) + +dnl OVS_ENABLE_SPARSE +AC_DEFUN([OVS_ENABLE_SPARSE], + [OVS_MAKE_HAS_IF( + [AC_CONFIG_COMMANDS_PRE( + [: ${SPARSE=sparse} + AC_SUBST([SPARSE]) + CC='$(if $(C),REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse" cgcc,'"$CC"')'])])])