X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=acinclude.m4;h=34634a2b792fc95db1e79a4aaf6228ccd44ef176;hb=42d5dd9595cce35a8825a20be7d71a3a8f6f5640;hp=f0610c90e2dd84e9e6b3fe5fafa284897254a622;hpb=d923a695edf35ac45854aa374136e991877c7d57;p=sliver-openvswitch.git diff --git a/acinclude.m4 b/acinclude.m4 index f0610c90e..34634a2b7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,6 +1,6 @@ # -*- autoconf -*- -# Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. +# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -224,6 +224,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_by_index_rcu]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [__skb_gso_segment]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [can_checksum_protocol]) OVS_GREP_IFELSE([$KSRC/include/linux/rcupdate.h], [rcu_read_lock_held], [], [OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], @@ -268,11 +270,19 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [NLA_NUL_STRING]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_get_be16]) + OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be16]) + OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be32]) + OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be64]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested]) OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD], [OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])]) + OVS_GREP_IFELSE([$KSRC/include/linux/percpu.h], [this_cpu_ptr]) + + OVS_GREP_IFELSE([$KSRC/include/linux/openvswitch.h], [openvswitch_handle_frame_hook], + [OVS_DEFINE([HAVE_RHEL_OVS_HOOK])]) + OVS_CHECK_LOG2_H if cmp -s datapath/linux/kcompat.h.new \ @@ -295,6 +305,8 @@ AC_DEFUN([OVS_CHECK_IF_PACKET], fi]) dnl Checks for net/if_dl.h. +dnl +dnl (We use this as a proxy for checking whether we're building on FreeBSD.) AC_DEFUN([OVS_CHECK_IF_DL], [AC_CHECK_HEADER([net/if_dl.h], [HAVE_IF_DL=yes], @@ -303,6 +315,9 @@ AC_DEFUN([OVS_CHECK_IF_DL], if test "$HAVE_IF_DL" = yes; then AC_DEFINE([HAVE_IF_DL], [1], [Define to 1 if net/if_dl.h is available.]) + + # On FreeBSD we use libpcap to access network devices. + AC_SEARCH_LIBS([pcap_open_live], [pcap]) fi]) dnl Checks for buggy strtok_r. @@ -473,13 +488,23 @@ AC_DEFUN([OVS_CHECK_SPARSE_TARGET], AC_SUBST([SPARSEFLAGS]) AC_SUBST([CGCCFLAGS])]) +dnl OVS_SPARSE_EXTRA_INCLUDES +dnl +dnl The cgcc script from "sparse" does not search gcc's default +dnl search path. Get the default search path from GCC and pass +dnl them to sparse. +AC_DEFUN([OVS_SPARSE_EXTRA_INCLUDES], + AC_SUBST([SPARSE_EXTRA_INCLUDES], + [`$CC -v -E - &1 >/dev/null | sed -n -e '/^#include.*search.*starts.*here:/,/^End.*of.*search.*list\./s/^ \(.*\)/-I \1/p' |grep -v /usr/lib | grep -x -v '\-I /usr/include' | tr \\\n ' ' `] )) + dnl OVS_ENABLE_SPARSE AC_DEFUN([OVS_ENABLE_SPARSE], [AC_REQUIRE([OVS_CHECK_SPARSE_TARGET]) AC_REQUIRE([OVS_CHECK_MAKE_IF]) + AC_REQUIRE([OVS_SPARSE_EXTRA_INCLUDES]) : ${SPARSE=sparse} AC_SUBST([SPARSE]) AC_CONFIG_COMMANDS_PRE( [if test $ovs_cv_gnu_make_if = yes; then - CC='$(if $(C),REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS)" cgcc $(CGCCFLAGS),'"$CC"')' + CC='$(if $(C),REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc $(CGCCFLAGS),'"$CC"')' fi])])