summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-04-23 10:54:27 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-04-23 10:54:27 +0100
commitd660085d7aff275b720ef4efb28ecafd7d7209e5 (patch)
treecfd03d8a88e591eb55627e0101ded3be884039ee
parentcf13c86a2c6fd56c07d7a92bcd28f99598c6a259 (diff)
downloadlibguestfs-d660085d7aff275b720ef4efb28ecafd7d7209e5.tar.gz
libguestfs-d660085d7aff275b720ef4efb28ecafd7d7209e5.tar.xz
libguestfs-d660085d7aff275b720ef4efb28ecafd7d7209e5.zip
Configure script tests for Perl modules.
-rw-r--r--configure.ac22
1 files changed, 20 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index fd0578ae..1c0216a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,9 +147,27 @@ AC_PROG_FINDLIB
AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLC" != "xno" -a "x$OCAMLFIND" != "xno"])
dnl Check for Perl (optional, for Perl bindings).
-dnl XXX This isn't quite right, we should check for devel libraries.
+dnl XXX This isn't quite right, we should check for Perl devel library.
AC_CHECK_PROG([PERL],[perl],[perl],[no])
-AM_CONDITIONAL([HAVE_PERL],[test "x$PERL" != "xno"])
+
+dnl Check for Perl modules that must be present to compile and
+dnl test the Perl bindings.
+missing_perl_modules=no
+for pm in Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker; do
+ AC_MSG_CHECKING([for $pm])
+ if ! perl -M$pm >/dev/null 2>&1; then
+ AC_MSG_RESULT([no])
+ missing_perl_modules=yes
+ else
+ AC_MSG_RESULT([yes])
+ fi
+done
+if test "x$missing_perl_modules" = "xyes"; then
+ AC_MSG_WARN([some Perl modules required to compile or test the Perl bindings are missing])
+fi
+
+AM_CONDITIONAL([HAVE_PERL],
+ [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
dnl Check for Python (optional, for Python bindings).
AC_CHECK_PROG([PYTHON],[python],[python],[no])