Make configure check for Perl modules required by test suite.

This commit is contained in:
Adam Spiers 2011-12-13 16:12:29 +00:00
parent d3847e951a
commit 215e0dac13
2 changed files with 31 additions and 0 deletions

2
NEWS
View file

@ -1,5 +1,7 @@
News file for Stow.
* Changes in version 2.1.3
** ./configure now checks for Perl modules required by the test suite.
* Changes in version 2.1.2
Many thanks to Stefano Lattarini for help with numerous autoconf and
automake issues which are addressed in this release.

View file

@ -17,6 +17,18 @@ then
AC_MSG_ERROR([Perl not found; check your \$PATH.])
fi
missing_test_deps=
for mod in Test::More Test::Output; do
AC_MSG_CHECKING([$mod])
if $PERL -M$mod -e 1 2>/dev/null
then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
missing_test_deps="$missing_test_deps $mod"
fi
done
# N.B. ${var#pattern} will not work with some shells, such as
# Solaris 10's /bin/sh :-(
#
@ -59,6 +71,23 @@ EOF
EOF
echo
fi
if test -n "$missing_test_deps"; then
cat <<EOF >&2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! WARNING! $PERL was missing modules:
!
! $missing_test_deps
!
! The test suite will fail. 'make install' may still render
! a working installation, but this cannot be guaranteed.
!
! Please (re-)read INSTALL, then install the missing modules
! and try again.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
fi
]])
AC_SUBST([PMDIR])