From 3d902d2feb199b09a5d1f90387e8557b75f6eb31 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 6 Feb 2015 14:54:52 +0000 Subject: [PATCH] improvements to python configure --- ChangeLog | 1 + configure.ac | 37 ++++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7de26fa5..7f6041b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 6/2/15 started 7.42.3 - bump version for back-compat ABI change - added vips_image_memory(), an alias for vips_image_new_memory() +- improvements to configure for python 30/12/14 started 7.42.2 - C++ required output params were broken, thanks Lovell diff --git a/configure.ac b/configure.ac index 92919a70..43cbbdab 100644 --- a/configure.ac +++ b/configure.ac @@ -683,16 +683,24 @@ if test "x$enable_pyvips8" = "xauto"; then [enable_pyvips8=yes], [AC_MSG_WARN([pygobject-3.0 not found; disabling vips8 python support]) enable_pyvips8=no - ]) + ] + ) fi -if test "x$enable_pyvips8" = "xyes"; then +if test x"$enable_pyvips8" = x"yes"; then + AM_PATH_PYTHON(2.7,, + [enable_pyvips8=no + AC_MSG_WARN([Python not found; disabling vips8 Python binding])] + ) +fi + +if test x"$enable_pyvips8" = x"yes"; then PKG_CHECK_MODULES(PYGOBJECT, [pygobject-3.0 >= 3.12.0]) pyoverridesdir="\$(pyexecdir)/gi/overrides" AC_SUBST(pyoverridesdir) fi -AM_CONDITIONAL(ENABLE_PYVIPS8, test x"$enable_pyvips8" = "xyes") +AM_CONDITIONAL(ENABLE_PYVIPS8, test x"$enable_pyvips8" = x"yes") # hmm, these don't have .pc files on ubuntu 5.10, how odd FIND_ZIP( @@ -771,24 +779,27 @@ fi # make python binding? AC_ARG_WITH([python], AS_HELP_STRING([--without-python], - [build without Python bindings (default: test)])) + [build without vips7 Python bindings (default: test)])) -if test x"$with_python" != "xno"; then - if test x"$enable_cxx" = "xno"; then +if test x"$with_python" != x"no"; then + if test x"$enable_cxx" = x"no"; then # if C++ is off, we can't do Python with_python=no - AC_MSG_WARN([C++ is off, disabling Python binding]) - else - AM_PATH_PYTHON(2.7,, - [with_python=no - AC_MSG_WARN([Python not found; disabling Python binding])]) + AC_MSG_WARN([C++ is off, disabling vips7 Python binding]) fi fi -if test x"$with_python" != "xno"; then +if test x"$with_python" != x"no"; then + AM_PATH_PYTHON(2.7,, + [with_python=no + AC_MSG_WARN([Python not found; disabling vips7 Python binding])] + ) +fi + +if test x"$with_python" != x"no"; then AM_CHECK_PYTHON_HEADERS(, [with_python=no - AC_MSG_WARN([Python headers not found])]) + AC_MSG_WARN([Python headers not found; disabling vips7 Python binding])]) fi # we don't check for swig: we include the generated bindings in the