|
@@ -11,15 +11,32 @@ AC_DEFUN([mc_UNIT_TESTS],[
|
|
|
|
|
|
AC_ARG_ENABLE(
|
|
|
[tests],
|
|
|
- AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://check.sourceforge.net/)])
|
|
|
+ AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://libcheck.github.io/check/) @<:@auto@:>@])
|
|
|
)
|
|
|
|
|
|
- if test x$enable_tests != xno; then
|
|
|
+ dnl 'tests_msg' holds the human-readable message to show in configure's summary text.
|
|
|
+
|
|
|
+ if test x$enable_tests == xno; then
|
|
|
+ dnl The user explicitly specified '--disable-tests'.
|
|
|
+ tests_msg="no"
|
|
|
+ else
|
|
|
PKG_CHECK_MODULES(
|
|
|
CHECK,
|
|
|
[check >= 0.9.8],
|
|
|
- [have_check=yes],
|
|
|
- [AC_MSG_WARN(['Check' utility not found. Check your environment])])
|
|
|
+ [
|
|
|
+ have_check=yes
|
|
|
+ tests_msg="yes"
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ AC_MSG_WARN(['Check' testing framework not found. Check your environment])
|
|
|
+ tests_msg="no ('Check' testing framework not found)"
|
|
|
+
|
|
|
+ dnl The following behavior, of "exit if feature requested but not found", is just a
|
|
|
+ dnl preference and can be safely removed.
|
|
|
+ if test x$enable_tests == xyes; then
|
|
|
+ AC_MSG_ERROR([You explicitly specified '--enable-tests', but this requirement cannot be met.])
|
|
|
+ fi
|
|
|
+ ])
|
|
|
AC_SUBST(CHECK_CFLAGS)
|
|
|
AC_SUBST(CHECK_LIBS)
|
|
|
fi
|