build: Add ./configure --disable-php option.
[libguestfs.git] / configure.ac
index bda6c3a..9cfb000 100644 (file)
@@ -763,25 +763,50 @@ AC_SUBST(JNI_VERSION_INFO)
 AM_CONDITIONAL([HAVE_JAVA],[test -n "$JAVAC"])
 
 dnl Check for Haskell (GHC).
-AC_CHECK_PROG([GHC],[ghc],[ghc],[no])
-
+GHC=no
+AC_ARG_ENABLE([haskell],
+        AS_HELP_STRING([--disable-haskell], [Disable Haskell language bindings]),
+        [],
+        [enable_haskell=yes])
+AS_IF([test "x$enable_haskell" != "xno"],
+        [
+        GHC=
+        AC_CHECK_PROG([GHC],[ghc],[ghc],[no])
+        ])
 AM_CONDITIONAL([HAVE_HASKELL],
     [test "x$GHC" != "xno"])
 
+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 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"])
@@ -792,11 +817,6 @@ dnl po4a for translating man pages and POD files (optional).
 AC_CHECK_PROG([PO4A],[po4a],[po4a],[no])
 AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"])
 
-dnl 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 Library versioning.
 MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
 AC_SUBST(MAX_PROC_NR)