diff mbox series

[v1,2/3] test: try detecting CUnit location, if it is not found by pkg-config

Message ID 1504868409-30780-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v1,1/3] DEPENDENCIES: document changes in CUnit localization | expand

Commit Message

Github ODP bot Sept. 8, 2017, 11 a.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>

---
/** Email created from pull request 162 (lumag:fix-deps)
 ** https://github.com/Linaro/odp/pull/162
 ** Patch: https://github.com/Linaro/odp/pull/162.patch
 ** Base sha: 360c1d34b52a2356619b9290811862b9de41de00
 ** Merge commit sha: 987b9e6d4ee471b03e4710fb7f50f9cf2d03ce65
 **/
 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 e303f8f20..78c4ec03a 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])