From 4603530304296a18c0bf5484ea9e5a03b015791d Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Mon, 25 May 2015 16:23:26 +0200 Subject: [PATCH] Change configure logic to return yes or no. In no other check we use AC_MSG_WARN so lets also not use it for the cmocka tests. --- autoconf/configure.in | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/autoconf/configure.in b/autoconf/configure.in index e273204bb6d..5f656076eaf 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -881,33 +881,28 @@ AC_CHECK_HEADERS(varargs.h) dnl --------------------------------------------------------------------------- dnl - Check for cmocka unit test framework http://cmocka.cryptomilk.org/ dnl --------------------------------------------------------------------------- +AC_MSG_CHECKING(for cmocka support) -AC_SUBST(CMOCKA_LIBS) -AC_SUBST(CMOCKA_CFLAGS) -AC_SUBST(UNITTEST_DIRS) - -AC_CHECK_HEADERS( - [setjmp.h cmocka.h],,, - [[#include - #include - #ifdef HAVE_SETJMP_H - #include - #endif - ]] +AC_CHECK_HEADERS( \ + setjmp.h \ + cmocka.h \ ) UNITTEST_DIRS= if test "x$ac_cv_header_setjmp_h" = "xyes" && test "x$ac_cv_header_cmocka_h" = "xyes" ; then - AC_CHECK_LIB([cmocka], [_will_return], - [ CMOCKA_LIBS="-lcmocka" - AC_MSG_RESULT([libcmocka available, cmocka tests will be build]) - have_cmocka="yes" ], - [AC_MSG_WARN([No libcmocka library found, cmocka tests will not be build]) - have_cmocka="no" ]) + AC_CHECK_LIB(cmocka, _will_return, + [ + CMOCKA_LIBS="-lcmocka" + AC_MSG_RESULT(yes) + have_cmocka="yes" + ], [ + AC_MSG_RESULT(no) + have_cmocka="no" + ]) else - AC_MSG_WARN([Required header files for libcmocka are missing, cmocka tests will not be build]) - have_cmocka="no" + AC_MSG_RESULT(no) + have_cmocka="no" fi if test x$have_cmocka = xyes; then @@ -915,6 +910,10 @@ if test x$have_cmocka = xyes; then UNITTEST_DIRS="src/lib/unittests src/findlib/unittests" fi +AC_SUBST(CMOCKA_LIBS) +AC_SUBST(CMOCKA_CFLAGS) +AC_SUBST(UNITTEST_DIRS) + dnl ----------------------------------------------------------------------- dnl Check for Python support