configure: Add code coverage magic

Autoconf changed the way code-coverage was handled in the recent past,
so there a slight complication so we work across both implementations.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I675c64953d262cd4b26a8ab758290ef4325790c0
diff --git a/configure.ac b/configure.ac
index 9ae4681..77212cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,5 +31,11 @@
 AM_CONDITIONAL([LIBMCTP_BINDING_serial], [true])
 AM_CONDITIONAL([LIBMCTP_BINDING_astlpc], [true])
 
+AX_CODE_COVERAGE
+m4_ifdef([_AX_CODE_COVERAGE_RULES],
+    [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [true])],
+    [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [false])])
+AX_ADD_AM_MACRO_STATIC([])
+
 AC_CONFIG_FILES([Makefile libmctp.pc])
 AC_OUTPUT