changed mcedit man.
[midnight-commander.git] / m4.include / mc-tests.m4
blobcc6fc67635008edc3a88453daf7e52fcdd939296
1 dnl @synopsis MC_UNIT_TESTS
2 dnl
3 dnl Check if unit tests enabled
4 dnl
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2011-02-10
7 dnl @license GPL
8 dnl @copyright Free Software Foundation, Inc.
10 AC_DEFUN([MC_UNIT_TESTS],[
12     AC_ARG_ENABLE(
13         [tests],
14         AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://check.sourceforge.net/)])
15     )
17     if test x$enable_tests != xno; then
18         PKG_CHECK_MODULES(
19             CHECK,
20             [check >= 0.9.8],
21             [have_check=yes],
22             [AC_MSG_WARN(['Check' utility not found. Check your environment])])
23     fi
24     AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes")
26     # on cygwin, the linker does not accept the "-z" option
27     case $host_os in
28         cygwin*)
29             TESTS_LDFLAGS="-Wl,--allow-multiple-definition"
30             ;;
31         *)
32             TESTS_LDFLAGS="-Wl,-z,muldefs"
33             ;;
34     esac
36     AC_SUBST(TESTS_LDFLAGS)