Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Marco van Wieringen committed May 25, 2015
1 parent 6f1a9d0 commit 4603530
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions autoconf/configure.in
Expand Up @@ -881,40 +881,39 @@ 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 <stdarg.h>
#include <stddef.h>
#ifdef HAVE_SETJMP_H
#include <setjmp.h>
#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
AC_DEFINE(HAVE_CMOCKA, 1, [Define to 1 if cmocka support should be enabled])
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
Expand Down

0 comments on commit 4603530

Please sign in to comment.