diff mbox series

[API-NEXT,v1,17/19] test: try detecting CUnit location, if it is not found by pkg-config

Message ID 1505156408-13887-18-git-send-email-odpbot@yandex.ru
State New
Headers show
Series None | expand

Commit Message

Github ODP bot Sept. 11, 2017, 7 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


CUnit 2.1-2 supplied incorrect cunit.pc file, resulting in pkg-config
failing to detect library. Try checking CUnit header/library in case of
pkg-config failure.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 173 (muvarov:api-next)
 ** https://github.com/Linaro/odp/pull/173
 ** Patch: https://github.com/Linaro/odp/pull/173.patch
 ** Base sha: 7fa8e2c97ed18f8dd6e95cbc78b7e668ccb98869
 ** Merge commit sha: 057be0905a62a157cc96a91743ea70e66e8554ca
 **/
 test/common_plat/m4/validation.m4 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/common_plat/m4/validation.m4 b/test/common_plat/m4/validation.m4
index e303f8f2..78c4ec03 100644
--- a/test/common_plat/m4/validation.m4
+++ b/test/common_plat/m4/validation.m4
@@ -12,7 +12,13 @@  AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
 ##########################################################################
 cunit_support=$test_vald
 AS_IF([test "x$cunit_support" = "xyes"],
-      [PKG_CHECK_MODULES([CUNIT], [cunit])])
+      [PKG_CHECK_MODULES([CUNIT], [cunit], [],
+      [AC_MSG_WARN([pkg-config could not find CUnit, guessing])
+    AC_CHECK_HEADERS([CUnit/Basic.h], [],
+        [AC_MSG_ERROR(["can't find CUnit headers"])])
+    AC_CHECK_LIB([cunit],[CU_get_error], [CUNIT_LIBS="-lcunit"],
+        [AC_MSG_ERROR([CUnit libraries required])])
+])])
 
 AC_SUBST([CUNIT_CFLAGS])
 AC_SUBST([CUNIT_LIBS])