From 215e0dac13b7b861d6db4a6d4d4d6dd891a80592 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Tue, 13 Dec 2011 16:12:29 +0000 Subject: [PATCH] Make configure check for Perl modules required by test suite. --- NEWS | 2 ++ configure.ac | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/NEWS b/NEWS index 16227e4..fd59eec 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/configure.ac b/configure.ac index 7d4ac4a..7563a99 100644 --- a/configure.ac +++ b/configure.ac @@ -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 <&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])