-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
+dnl PHP
+PHP=no
+AC_ARG_ENABLE([php],
+ AS_HELP_STRING([--disable-php], [Disable PHP language bindings]),
+ [],
+ [enable_php=yes])
+AS_IF([test "x$enable_php" != "xno"],
+ [
+ PHP=
+ AC_CHECK_PROG([PHP],[php],[php],[no])
+ AC_CHECK_PROG([PHPIZE],[phpize],[phpize],[no])
+ ])
+AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"])
+
+dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
+AS_IF([test "x$PERL" != "xno"],
+ [
+ missing_perl_modules=no
+ for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper 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 the Perl virt-* tools are missing])
+ fi
+ ])