diff options
author | Patrick Venture <venture@google.com> | 2018-04-17 17:38:02 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-04-18 08:56:11 -0700 |
commit | caac77dc638377c67db15ca2db9d72d05076841b (patch) | |
tree | 7aed8476629885ee2bedb1cc1195e323d2fd17c9 | |
parent | d4beecfa33c1cd8ecc688ce472594284216cf541 (diff) | |
download | phosphor-hwmon-caac77dc638377c67db15ca2db9d72d05076841b.tar.gz phosphor-hwmon-caac77dc638377c67db15ca2db9d72d05076841b.zip |
Update configure.ac to fix gtest
Updated the configure.ac to match the example and this
fixed gtest.
Change-Id: I246f5e4da257a0475c69505fd357d7441087b525
Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r-- | configure.ac | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 0878173..0bc5fc4 100644 --- a/configure.ac +++ b/configure.ac @@ -29,14 +29,21 @@ AC_CHECK_HEADER(experimental/filesystem, ,[AC_MSG_ERROR([Could not find experime LT_INIT # Check/set gtest specific functions. -AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"]) -AC_SUBST(GTEST_CPPFLAGS) +PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])]) +PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])]) +AX_PTHREAD([GTEST_CFLAGS+=" -DGTEST_HAS_PTHREAD=1 "],[GTEST_CFLAGS+=" -DGTEST_HAS_PTHREAD=0 "]) +# Add --enable-oe-sdk flag to configure script AC_ARG_ENABLE([oe-sdk], AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) ) + +# Check for OECORE_TARGET_SYSROOT in the environment. AC_ARG_VAR(OECORE_TARGET_SYSROOT, [Path to the OE SDK SYSROOT]) + +# Configure OESDK_TESTCASE_FLAGS environment variable, which will be later +# used in test/Makefile.am AS_IF([test "x$enable_oe_sdk" == "xyes"], AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |