On branch swig-py3: Make swig python configure error more meaningful if
Python.h is not found.
* build/ac-macros/swig.m4
(SVN_FIND_SWIG): Add a AC_CHECK_HEADER for Python.h to verify its existence,
and provide a meaningful error if it is not found.
Found By: danielsh
@@ -112,8 +112,20 @@ AC_DEFUN(SVN_FIND_SWIG,
if test "$ac_cv_python_includes" = "none"; then
AC_MSG_WARN([python bindings cannot be built without distutils module])
- fi
+ else
+
+ python_header_found="no"
+
+ save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $ac_cv_python_includes"
+ AC_CHECK_HEADER(Python.h, [
+ python_header_found="yes"
+ ])
+ CPPFLAGS="$save_cppflags"
+ if test "$python_header_found" = "no"; then
+ AC_MSG_WARN([Python.h not found, disabling swig bindings])
+ else
SVN_PY3C()
if test "$py3c_found" = "no"; then
@@ -181,6 +193,8 @@ AC_DEFUN(SVN_FIND_SWIG,
[Define to the Python/C API format character suitable]
[ for apr_int64_t])
fi
+ fi
+ fi
fi
