If --with-cunit-path=DIR is used, skip the AC_CHECK_LIB and modify the linker
flags accordingly.

Signed-off-by: Brian Brooks <brian.bro...@linaro.org>
---
 test/m4/validation.m4 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/m4/validation.m4 b/test/m4/validation.m4
index b137118..f6c93f7 100644
--- a/test/m4/validation.m4
+++ b/test/m4/validation.m4
@@ -33,12 +33,16 @@ AC_HELP_STRING([--with-cunit-path=DIR   path to CUnit libs 
and headers],
 ##########################################################################
 # Check for CUnit availability
 ##########################################################################
-if test x$cunit_support = xyes
+if test x$cunit_support = xyes -a -z "$CUNIT_PATH"
 then
     AC_CHECK_LIB([cunit],[CU_get_error], [],
         [AC_MSG_ERROR([CUnit libraries required])])
     AC_CHECK_HEADERS([CUnit/Basic.h], [],
         [AC_MSG_FAILURE(["can't find cunit headers"])])
 else
-    cunit_support=no
+    if test -z "$CUNIT_PATH"; then
+        cunit_support=no
+    else
+        AM_LDFLAGS="$AM_LDFLAGS -lcunit"
+    fi
 fi
-- 
2.8.0

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to