]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: add a configure option to enable gcov
authorVincent Bernat <vincent@bernat.im>
Fri, 10 Jun 2016 06:08:23 +0000 (08:08 +0200)
committerVincent Bernat <vincent@bernat.im>
Fri, 10 Jun 2016 06:08:23 +0000 (08:08 +0200)
README.md
configure.ac

index 271bf2cf2173442f3bdfc42d44d4a0ad10376ec6..344c35e27cfa425e82a249224219340a7b65d692 100644 (file)
--- a/README.md
+++ b/README.md
@@ -259,8 +259,8 @@ and rely on Linux containers to be executed.
 To enable code coverage, use:
 
     ../configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
-                 --enable-sanitizers --with-snmp \
-                 CFLAGS="-O0 -g --coverage" LDFLAGS="--coverage"
+                 --enable-sanitizers --enable-gcov --with-snmp \
+                 CFLAGS="-O0 -g"
     make
     make check
     # maybe, run integration tests
index 539384cbbd48ba35bc1e4f929909b964bb1f90b8..a36efee980f1c4a9b4eddd9bcc9646a8c36f7074 100644 (file)
@@ -116,8 +116,7 @@ fi
 
 # Sanitizers
 AC_ARG_ENABLE([sanitizers],
-  AS_HELP_STRING(
-    [--enable-sanitizers],
+  AS_HELP_STRING([--enable-sanitizers],
     [Enable code instrumentation with selected sanitizers @<:@default=no@:>@]),
   [
 case "$enableval" in
@@ -132,6 +131,17 @@ if test x"$sanitizers" != x; then
 fi
   ])
 
+# Code coverage
+AC_ARG_ENABLE([gcov],
+  AS_HELP_STRING([--enable-gcov],
+    [Enable coverage instrumentation @<:@default=no@:>@]),
+    [gcov="$enableval"],
+    [gcov="no"])
+if test x"$gcov" != x"no"; then
+  LLDP_CFLAGS="$LLDP_CFLAGS --coverage"
+  LLDP_LDFLAGS="$LLDP_LDFLAGS --coverage"
+fi
+
 # OS
 lldp_CHECK_OS
 lldp_CFLAGS_OS