From 7e3f20d02f6555d082cdc320790ac8fd9976effb Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Fri, 2 Aug 2019 13:34:44 +0930 Subject: [PATCH] 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 Change-Id: I29dae544d8feb462e848ab00c25da188f74686a7 Signed-off-by: Andrew Jeffery --- Makefile.am | 6 ++++++ configure.ac | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 0266a53..ac57ea2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,13 @@ mboxctl_SOURCES = mboxctl.c mboxctl_LDFLAGS = $(LIBSYSTEMD_LIBS) mboxctl_CFLAGS = $(LIBSYSTEMD_CFLAGS) +if AUTOCONF_CODE_COVERAGE_2019_01_06 +include $(top_srcdir)/aminclude_static.am +clean-local: code-coverage-clean +distclean-local: code-coverage-dist-clean +else @CODE_COVERAGE_RULES@ +endif check_PROGRAMS = XFAIL_TESTS = diff --git a/configure.ac b/configure.ac index b505e4d..af13732 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.69]) AC_INIT([mboxd], [2.1.1], [https://github.com/openbmc/mboxbridge/issues]) AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([subdir-objects -Wall foreign dist-xz]) +AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability foreign dist-xz]) AM_SILENT_RULES([yes]) AC_CONFIG_MACRO_DIRS([m4]) @@ -65,6 +65,10 @@ AS_IF([test "x$enable_virtual_pnor" == "xyes"], ) 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([]) PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd, , AC_MSG_ERROR([libsytemd not found])) AC_SUBST([LIBSYSTEMD_CFLAGS]) -- 2.30.2