autotools: Fix for autoconf-archive 2019.01.19

The code coverage macros from the archive changed in a backward
incompatible way. This adds a workaround to autodetect either version
and do the right thing.

Change-Id: I63d1cdf6edb125d75872d6dae38f8602fc043431
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/configure.ac b/configure.ac
index d766ba8..df031b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 AC_INIT([swampd], [0.1], [https://github.com/openbmc/phosphor-pid-control/issues])
 AC_LANG([C++])
 AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz])
+AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability -Werror foreign dist-xz])
 AM_SILENT_RULES([yes])
 
 # Make sure the default CFLAGS of `-O2 -g` don't override CODE_COVERAGE_CFLAGS
@@ -132,10 +132,13 @@
 
 # Code coverage
 AX_CODE_COVERAGE
-AM_EXTRA_RECURSIVE_TARGETS([check-code-coverage])
 AS_IF([test "x$CODE_COVERAGE_ENABLED" = "xyes"], [
     AX_APPEND_COMPILE_FLAGS([-DHAVE_GCOV], [CODE_COVERAGE_CPPFLAGS])
 ])
+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(