2011-02-15 13:42:51 +03:00
|
|
|
dnl @synopsis MC_UNIT_TESTS
|
|
|
|
dnl
|
|
|
|
dnl Check if unit tests enabled
|
|
|
|
dnl
|
|
|
|
dnl @author Slava Zanko <slavazanko@gmail.com>
|
|
|
|
dnl @version 2011-02-10
|
|
|
|
dnl @license GPL
|
|
|
|
dnl @copyright Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
AC_DEFUN([MC_UNIT_TESTS],[
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(
|
|
|
|
[tests],
|
2011-05-25 17:51:18 +04:00
|
|
|
AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://check.sourceforge.net/)])
|
2011-02-15 13:42:51 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
if test x$enable_tests != xno; then
|
|
|
|
PKG_CHECK_MODULES(
|
|
|
|
CHECK,
|
2012-12-19 13:25:32 +04:00
|
|
|
[check >= 0.9.8],
|
2011-02-15 13:42:51 +03:00
|
|
|
[have_check=yes],
|
|
|
|
[AC_MSG_WARN(['Check' utility not found. Check your environment])])
|
2015-02-23 16:22:37 +03:00
|
|
|
AC_SUBST(CHECK_CFLAGS)
|
|
|
|
AC_SUBST(CHECK_LIBS)
|
2011-02-15 13:42:51 +03:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes")
|
2012-10-19 14:14:57 +04:00
|
|
|
|
|
|
|
# on cygwin, the linker does not accept the "-z" option
|
|
|
|
case $host_os in
|
|
|
|
cygwin*)
|
|
|
|
TESTS_LDFLAGS="-Wl,--allow-multiple-definition"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
TESTS_LDFLAGS="-Wl,-z,muldefs"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_SUBST(TESTS_LDFLAGS)
|
2011-02-15 13:42:51 +03:00
|
|
|
])
|