mc-tests.m4 950 B

12345678910111213141516171819202122232425262728293031323334353637
  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.
  9. AC_DEFUN([MC_UNIT_TESTS],[
  10. AC_ARG_ENABLE(
  11. [tests],
  12. AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://check.sourceforge.net/)])
  13. )
  14. if test x$enable_tests != xno; then
  15. PKG_CHECK_MODULES(
  16. CHECK,
  17. [check >= 0.9.0],
  18. [have_check=yes],
  19. [AC_MSG_WARN(['Check' utility not found. Check your environment])])
  20. fi
  21. AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes")
  22. # on cygwin, the linker does not accept the "-z" option
  23. case $host_os in
  24. cygwin*)
  25. TESTS_LDFLAGS="-Wl,--allow-multiple-definition"
  26. ;;
  27. *)
  28. TESTS_LDFLAGS="-Wl,-z,muldefs"
  29. ;;
  30. esac
  31. AC_SUBST(TESTS_LDFLAGS)
  32. ])