autotools: Fix autoconf-archive compatibility issues

autoconf-archive 2019-01-06 changed the setup of code coverage support.
Deal with both old and new. Based on Patrick Venture's similar patch in
other repositories[1].

[1] https://github.com/openbmc/phosphor-pid-control/commit/90e9dbcae6c1df3127dd3de41f9d1e1b5a438828

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ibf7b240f0b3e78ba80f587de7a0f8a1e804a7446
diff --git a/configure.ac b/configure.ac
index 9cf54c9..1b38879 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 AC_PREREQ([2.69])
 AC_INIT([phosphor-snmp], [1.0], [https://github.com/openbmc/openbmc/phosphor-snmp.git])
 AC_LANG([C++])
-AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign])
+AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability -Werror foreign])
 AM_SILENT_RULES([yes])
 
 # Compiler flags
@@ -65,6 +65,10 @@
 
 # Add the code covererage
 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_ARG_ENABLE([oe-sdk],
     AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])