+# Python is needed for the C++ bindings.
+AC_CHECK_PROG([HAVE_PYTHON], [python], [yes])
+if test "x$HAVE_PYTHON" != "xyes"; then
+ BINDINGS_CXX="no"; cxx_msg="Python required"
+fi
+
+# The Python bindings need Python development files
+PKG_CHECK_MODULES([python], [python >= 2.7],
+ [CXXFLAGS="$CXXFLAGS $python_CFLAGS";
+ CXXLIBS="$CXXLIBS $python_LIBS"],
+[PKG_CHECK_MODULES([python27], [python-2.7 >= 2.7],
+ [CXXFLAGS="$CXXFLAGS $python27_CFLAGS";
+ CXXLIBS="$CXXLIBS $python27_LIBS"],
+ [BINDINGS_PYTHON="no"; python_msg="Python headers required"])])
+
+# The Python bindings need the setuptools Python module.
+m4_ifdef([AX_PYTHON_MODULE], [AX_PYTHON_MODULE([setuptools])],
+ # We'll let it go through even if the macro wasn't found, the python
+ # module may still be there.
+ [HAVE_PYTHON_SETUPTOOLS="yes";
+ AC_MSG_NOTICE([Missing macro m4_toupper(aX_PYTHON_MODULE), no setuptools check])]
+)
+if test "x$HAVE_PYMOD_SETUPTOOLS" != "xyes"; then
+ BINDINGS_PYTHON="no"; python_msg="Python setuptools module required"
+fi
+
+# The Python and Java bindings use swig to generate code.
+AC_CHECK_PROG([HAVE_SWIG], [swig], [yes])
+if test "x$HAVE_SWIG" != "xyes"; then
+ BINDINGS_PYTHON="no"; python_msg="swig required"
+ BINDINGS_JAVA="no"; java_msg="swig required"