X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=m4%2Fopenvswitch.m4;h=3fe053b06d935046d635a1acb25e04129bdbcc15;hb=c2b070214097fa40dc78252882d96babe7fab4b4;hp=ce55311a39d24326c2d168fa5cacab7309c17a2e;hpb=1b233b95b5907a242ee453cbea3ad4bc4cd4fec2;p=sliver-openvswitch.git diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index ce55311a3..3fe053b06 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -14,6 +14,31 @@ # See the License for the specific language governing permissions and # limitations under the License. +dnl Checks for --enable-coverage and updates CFLAGS and LDFLAGS appropriately. +AC_DEFUN([OVS_CHECK_COVERAGE], + [AC_REQUIRE([AC_PROG_CC]) + AC_ARG_ENABLE( + [coverage], + [AC_HELP_STRING([--enable-coverage], + [Enable gcov coverage tool.])], + [case "${enableval}" in + (lcov) coverage=true lcov=true ;; + (yes) coverage=true lcov=false ;; + (no) coverage=false lcov=false ;; + (*) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;; + esac], + [coverage=false lcov=false]) + if $coverage; then + CFLAGS="$CFLAGS -O0 --coverage" + LDFLAGS="$LDFLAGS --coverage" + fi + if $lcov; then + if lcov --version >/dev/null 2>&1; then :; else + AC_MSG_ERROR([--enable-coverage=lcov was specified but lcov is not in \$PATH]) + fi + fi + AC_SUBST([LCOV], [$lcov])]) + dnl Checks for --enable-ndebug and defines NDEBUG if it is specified. AC_DEFUN([OVS_CHECK_NDEBUG], [AC_ARG_ENABLE(