You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/hivex/files/1.3.3/0003_autoconf_fix_automagic...

106 lines
3.2 KiB

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -183,11 +183,19 @@
AC_CHECK_FUNC([open_memstream])
AM_CONDITIONAL([HAVE_HIVEXSH],[test "x$ac_cv_func_open_memstream" = "xyes"])
+
dnl Check for OCaml (optional, for OCaml bindings).
+AC_ARG_ENABLE([ocaml],
+ AS_HELP_STRING([--with-ocaml],[build Ocaml binding]))
+
+
+
+
AC_PROG_OCAML
AC_PROG_FINDLIB
AM_CONDITIONAL([HAVE_OCAML],
- [test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"])
+ [test "x$OCAMLC" != "xno" -a "x$OCAMLFIND" != "xno" -a "x$enable_ocaml" = "xyes"])
+
AM_CONDITIONAL([HAVE_OCAMLOPT],
[test "x$OCAMLOPT" != "xno" && test "x$OCAMLFIND" != "xno"])
@@ -227,21 +235,32 @@
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 ExtUtils::MakeMaker IO::Stringy; 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 or test the Perl bindings are missing])
-fi
+AC_ARG_ENABLE([perl],
+ AS_HELP_STRING([--with-perl],[build Perl binding]))
+
+
+PERL=
+AS_IF([test "x$enable_perl" != "xno" ],[
+ AC_CHECK_PROG([PERL],[perl],[yes],[no])
+
+ for pm in Test::More ExtUtils::MakeMaker IO::Stringy; 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
+
+ AS_IF([test "x$missing_perl_modules" = "xyes"],
+ [AC_MSG_FAILURE([some Perl modules required to compile or test the Perl bindings are missing])],
+ )
+])
AM_CONDITIONAL([HAVE_PERL],
- [test "x$PERL" != "xno" && test "x$missing_perl_modules" != "xyes"])
+ [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes" -a "x$enable_perl" = "xyes"])
+
dnl Check for Python (optional, for Python bindings).
PYTHON_PREFIX=
@@ -251,6 +270,7 @@
AC_CHECK_PROG([PYTHON],[python],[python],[no])
+
if test "x$PYTHON" != "xno"; then
AC_MSG_CHECKING([Python prefix])
PYTHON_PREFIX=`$PYTHON -c "import sys; print (sys.prefix)"`
@@ -308,15 +328,24 @@
AC_SUBST(PYTHON_INCLUDEDIR)
AC_SUBST(PYTHON_INSTALLDIR)
+AC_ARG_ENABLE([python],
+ AS_HELP_STRING([--with-python],[build Python binding]))
+
AM_CONDITIONAL([HAVE_PYTHON],
- [test "x$PYTHON" != "xno" && test "x$PYTHON_INCLUDEDIR" != "x" && test "x$PYTHON_INSTALLDIR" != "x"])
+ [test "x$PYTHON_INCLUDEDIR" != "x" -a "x$PYTHON_SITE_PACKAGES" != "x" -a "x$enable_python" = "xyes"])
+
+
dnl Check for Ruby and rake (optional, for Ruby bindings).
+AC_ARG_ENABLE([ruby],
+ AS_HELP_STRING([--with-ruby],[build Ruby binding]))
+
AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0])
AC_CHECK_PROG([RAKE],[rake],[rake],[no])
AM_CONDITIONAL([HAVE_RUBY],
- [test "x$RAKE" != "xno" && test -n "$HAVE_LIBRUBY"])
+ [test "x$RAKE" != "xno" && test -n "$HAVE_LIBRUBY" -a "x$enable_ruby" = "xyes"])
+
dnl dnl Check for Java.
dnl AC_ARG_WITH(java_home,