2008-09-29 07:35:28 -07:00
|
|
|
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
|
|
|
|
dnl That code is public domain and can be freely used or copied.
|
|
|
|
|
|
|
|
dnl Macro that check if tests programs are wanted and if yes, if
|
|
|
|
dnl the Check library is available.
|
|
|
|
|
|
|
|
dnl Usage: EFL_CHECK_TESTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
|
|
dnl Define the automake conditionnal EFL_ENABLE_TESTS
|
|
|
|
|
|
|
|
AC_DEFUN([EFL_CHECK_TESTS],
|
|
|
|
[
|
|
|
|
|
|
|
|
dnl configure option
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([tests],
|
|
|
|
[AC_HELP_STRING([--enable-tests], [enable tests @<:@default=no@:>@])],
|
|
|
|
[
|
|
|
|
if test "x${enableval}" = "xyes" ; then
|
2008-10-03 08:28:13 -07:00
|
|
|
_efl_enable_tests="yes"
|
2008-09-29 07:35:28 -07:00
|
|
|
else
|
2008-10-03 08:28:13 -07:00
|
|
|
_efl_enable_tests="no"
|
2008-09-29 07:35:28 -07:00
|
|
|
fi
|
|
|
|
],
|
2008-10-03 08:28:13 -07:00
|
|
|
[_efl_enable_tests="no"]
|
2008-09-29 07:35:28 -07:00
|
|
|
)
|
|
|
|
AC_MSG_CHECKING([whether tests are built])
|
2008-10-03 08:28:13 -07:00
|
|
|
AC_MSG_RESULT([${_efl_enable_tests}])
|
2008-09-29 07:35:28 -07:00
|
|
|
|
2008-10-03 08:28:13 -07:00
|
|
|
if test "x${_efl_enable_tests}" = "xyes" ; then
|
2008-09-29 07:35:28 -07:00
|
|
|
PKG_CHECK_MODULES([CHECK],
|
|
|
|
[check >= 0.9.5],
|
|
|
|
[dummy="yes"],
|
2008-10-03 08:28:13 -07:00
|
|
|
[_efl_enable_tests="no"]
|
2008-09-29 07:35:28 -07:00
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2008-10-03 08:28:13 -07:00
|
|
|
AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes")
|
2008-09-29 07:35:28 -07:00
|
|
|
|
2008-10-03 08:28:13 -07:00
|
|
|
if test "x${_efl_enable_tests}" = "xyes" ; then
|
2008-09-29 07:35:28 -07:00
|
|
|
ifelse([$1], , :, [$1])
|
|
|
|
else
|
|
|
|
ifelse([$2], , :, [$2])
|
|
|
|
fi
|
2008-10-03 08:28:13 -07:00
|
|
|
])
|