diff options
author | William A. Kennington III <wak@google.com> | 2019-04-04 18:00:09 -0700 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2019-04-11 18:40:25 -0700 |
commit | 5023aa95ff56ea9ebf6a9e265dc4498c38f18bc7 (patch) | |
tree | 59636295ba05ae068e78ddb5a3379db68ad9c7d3 /configure.ac | |
parent | 0d49e47978d5f2d0b108b0ddc65943763e88f729 (diff) | |
download | phosphor-host-ipmid-5023aa95ff56ea9ebf6a9e265dc4498c38f18bc7.tar.gz phosphor-host-ipmid-5023aa95ff56ea9ebf6a9e265dc4498c38f18bc7.zip |
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.
Tested:
Against the typical, older autotools and the new autotools
2019.01.09 in the CI environment.
Change-Id: I765ec46051c2666874dce51675092aa4da989ec5
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index a73976e..2bb011f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,10 +2,22 @@ AC_PREREQ([2.69]) AC_INIT([phosphor-host-ipmid], [1.0], [https://github.com/openbmc/phosphor-host-ipmid/issues]) 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]) AC_LANG([C++]) +# Make sure the default CFLAGS of `-O2 -g` don't override CODE_COVERAGE_CFLAGS +# It is important that this comes before AC_PROG_C{C,XX}, as we are attempting +# to stop them from populating default CFLAGS and CXXFLAGS. +AS_IF([test "x$enable_code_coverage" != "xno"], [ + AS_IF([test "x${CXXFLAGS+set}" != "xset"], [ + AC_SUBST(CXXFLAGS, [""]) + ]) + AS_IF([test "x${CFLAGS+set}" != "xset"], [ + AC_SUBST(CFLAGS, [""]) + ]) +]) + # Checks for programs. AC_PROG_CXX AC_PROG_CC @@ -77,6 +89,14 @@ AS_IF([test "x$enable_oe_sdk" == "xyes"], # Add code coverage tool AX_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_VAR(WHITELIST_CONF, [Paths to IPMI whitelisted commands conf files. (default = ${srcdir}/host-ipmid-whitelist.conf)]) if test -z "$WHITELIST_CONF"; then |