build: Test for virt tools Perl libraries conditionally.
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 8 Nov 2010 14:53:48 +0000 (14:53 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 18 Nov 2010 11:30:22 +0000 (11:30 +0000)
Only test for these if $PERL is defined, and use $PERL as
the interpreter.
(cherry picked from commit 8e4a4d3d88b814504c6f2abbf6bf3dab789021b1)

configure.ac

index e85c998..a170f28 100644 (file)
@@ -777,19 +777,22 @@ AM_CONDITIONAL([HAVE_HASKELL],
     [test "x$GHC" != "xno"])
 
 dnl Check for Perl modules needed by virt-df, inspector, etc.
-missing_perl_modules=no
-for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer Locale::TextDomain Win::Hivex Win::Hivex::Regedit; do
-    AC_MSG_CHECKING([for $pm])
-    if ! perl -M$pm -e1 >/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 virt-inspector and the other virt-* tools are missing])
-fi
+AS_IF([test "x$PERL" != "xno"],
+        [
+        missing_perl_modules=no
+        for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer Locale::TextDomain Win::Hivex Win::Hivex::Regedit; do
+            AC_MSG_CHECKING([for $pm])
+            if ! $PERL -M$pm -e1 >/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 virt-inspector and the other virt-* tools are missing])
+        fi
+        ])
 
 AM_CONDITIONAL([HAVE_INSPECTOR],
     [test "x$PERL" != "xno" && test "x$missing_perl_modules" != "xyes"])