configure.ac: provide fallback for systems where libcheck is not installed with pkg-config

This commit is contained in:
Benjamin Dauvergne 2015-08-24 14:27:11 +02:00
parent 9e5c4389a8
commit eb6ed4f85a
2 changed files with 9 additions and 2 deletions

View File

@ -103,8 +103,11 @@ TESTS = AllJunitTests
AllJunitTests: JAVAFLAGS +="-Dsrcdir=$(srcdir)"
AllJunitTests: $(test_source_files:.java=.class)
echo "OBJDIR=`libtool --config | grep ^objdir | sed 's/.*=//'`"
echo "#! /bin/sh" > $@
echo "OBJDIR=`libtool --config | grep ^objdir | sed s/.*=//`" >> $@
echo "OBJDIR=`libtool --config | grep ^objdir | sed 's/.*=//'`" >> $@
cat $@
echo $@
echo 'LD_LIBRARY_PATH=$$OBJDIR DYLD_LIBRARY_PATH=$$OBJDIR @JUNIT@ -Djava.library.path=$$OBJDIR BindingTests' >> $@
echo 'LD_LIBRARY_PATH=$$OBJDIR DYLD_LIBRARY_PATH=$$OBJDIR @JUNIT@ -Djava.library.path=$$OBJDIR LoginTest' >> $@
chmod +x $@

View File

@ -605,7 +605,11 @@ dnl Check if user disabled the tests.
AC_ARG_ENABLE(tests, [ --disable-tests disable the test suite],,
enable_tests="yes")
if test "x$enable_tests" = xyes ; then
PKG_CHECK_MODULES(CHECK, check)
PKG_CHECK_MODULES(CHECK, check, [], [
AC_CHECK_LIB(check, srunner_set_log, enable_tests="yes", enable_tests="no")
CHECK_CFLAGS=""
CHECK_LIBS="-lcheck"
])
AC_SUBST(CHECK_CFLAGS)
AC_SUBST(CHECK_LIBS)
AC_CHECK_LIB(check, srunner_set_xml, [AC_DEFINE(CHECK_IS_XML, [], [Define if check available with XML support])])