X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=acinclude.m4;h=e074c7d47ebb0cb006ae9aa1cefe917a8cf11a9d;hb=49c36903d6d65bed96cba31f05534510a21a68d7;hp=e37a316dffa97a99d069ed2bd0687f591deca7d9;hpb=d161c099279e9ab564636c72423268e6da69f795;p=openvswitch diff --git a/acinclude.m4 b/acinclude.m4 index e37a316d..e074c7d4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -235,4 +235,14 @@ dnl Example: OVS_ENABLE_OPTION([-Wdeclaration-after-statement]) AC_DEFUN([OVS_ENABLE_OPTION], [OVS_CHECK_CC_OPTION([$1], [WARNING_FLAGS="$WARNING_FLAGS $1"]) AC_SUBST([WARNING_FLAGS])]) + +dnl OVS_CONDITIONAL_CC_OPTION([OPTION], [CONDITIONAL]) +dnl Check whether the given C compiler OPTION is accepted. +dnl If so, enable the given Automake CONDITIONAL. + +dnl Example: OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED]) +AC_DEFUN([OVS_CONDITIONAL_CC_OPTION], + [OVS_CHECK_CC_OPTION( + [$1], [ovs_have_cc_option=yes], [ovs_have_cc_option=no]) + AM_CONDITIONAL([$2], [test $ovs_have_cc_option = yes])]) dnl ----------------------------------------------------------------------