1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnikdnl A macro to check presence of cmocka on the system
1c7f25390572025baa6783ede14523e22fc73043Lukas SlebodnikAC_DEFUN([AM_CHECK_CMOCKA],
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik[
cecee447d41c3ca22e94880a7d0cbd910f230fe5Jakub Hrozek PKG_CHECK_EXISTS(cmocka >= 1.0.0,
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik [AC_CHECK_HEADERS([stdarg.h stddef.h setjmp.h],
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik [], dnl We are only intrested in action-if-not-found
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik [AC_MSG_WARN([Header files stdarg.h stddef.h setjmp.h are required by cmocka])
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik cmocka_required_headers="no"
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik ]
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik )
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik AS_IF([test x"$cmocka_required_headers" != x"no"],
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik [PKG_CHECK_MODULES([CMOCKA], [cmocka], [have_cmocka="yes"])]
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik )],
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik dnl PKG_CHECK_EXISTS ACTION-IF-NOT-FOUND
cecee447d41c3ca22e94880a7d0cbd910f230fe5Jakub Hrozek [AC_MSG_WARN([No libcmocka-1.0.0 or newer library found, cmocka tests will not be built])]
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik )
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik AM_CONDITIONAL([HAVE_CMOCKA], [test x$have_cmocka = xyes])
1c7f25390572025baa6783ede14523e22fc73043Lukas Slebodnik])