1 dnl @synopsis mc_UNIT_TESTS
3 dnl Check if unit tests enabled
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2011-02-10
8 dnl @copyright Free Software Foundation, Inc.
10 AC_DEFUN([mc_UNIT_TESTS],[
14 AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://libcheck.github.io/check/) @<:@auto@:>@])
17 dnl 'tests_msg' holds the human-readable message to show in configure's summary text.
19 if test x"$enable_tests" = "xno"; then
20 dnl The user explicitly specified '--disable-tests'.
31 AC_MSG_WARN(['Check' testing framework not found. Check your environment])
32 tests_msg="no ('Check' testing framework not found)"
34 dnl The following behavior, of "exit if feature requested but not found", is just a
35 dnl preference and can be safely removed.
36 if test x"$enable_tests" = "xyes"; then
37 AC_MSG_ERROR([You explicitly specified '--enable-tests', but this requirement cannot be met.])
40 AC_SUBST(CHECK_CFLAGS)
43 AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes")
45 dnl sighandler_t is GNU extension
46 dnl AC_USE_SYSTEM_EXTENSIONS is required
47 AC_CHECK_TYPES([sighandler_t], [], [], [
51 # on cygwin, the linker does not accept the "-z" option
54 TESTS_LDFLAGS="-Wl,--allow-multiple-definition"
57 TESTS_LDFLAGS="-Wl,-z,muldefs"
61 AC_SUBST(TESTS_LDFLAGS)