diff mbox

[1/2] configure: support out-of-tree CUnit

Message ID 1460035065-8416-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov April 7, 2016, 1:17 p.m. UTC
From: Brian Brooks <brian.brooks@linaro.org>

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

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

Comments

Anders Roxell April 7, 2016, 1:37 p.m. UTC | #1
On 7 April 2016 at 15:17, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> From: Brian Brooks <brian.brooks@linaro.org>
>
> If --with-cunit-path=DIR is used, skip the AC_CHECK_LIB and modify the linker
> flags accordingly.
>
> Signed-off-by: Brian Brooks <brian.brooks@linaro.org>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@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

Why do you send this again?
This patch isn't needed.

only patch 2/2 is needed!

Cheers,
Anders
diff mbox

Patch

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