X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=acinclude.m4;h=63a036e3d16123082c2ce21ef53f967af26cba15;hb=5b95ab0edf18e44d6624c8aa98b658df2fbb48f2;hp=fa6f534deb3cfa4f1f276a7cc77ca0a67083c643;hpb=431488e6638d3fbb53d215fa10d2ff2d8f1c2824;p=openvswitch diff --git a/acinclude.m4 b/acinclude.m4 index fa6f534d..63a036e3 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 @@ -193,6 +204,7 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ [OVS_DEFINE([HAVE_ICMP6_HDR])]) OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_warn_if_lro], [OVS_DEFINE([HAVE_SKB_WARN_LRO])]) + OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [consume_skb]) OVS_GREP_IFELSE([$KSRC26/include/linux/string.h], [kmemdup], [], [OVS_GREP_IFELSE([$KSRC26/include/linux/slab.h], [kmemdup])]) @@ -336,3 +348,38 @@ AC_DEFUN([OVS_CHECK_XENSERVER_VERSION], 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"')'])])])