Fix python executed during configure

Previously it relied on AX_PYTHON_DEVEL, which in turn executes
python-config to get the build flags. However this does not work while
cross compiling because we can't execute the python-config build for the
target platform. To circumvent this problem the python build flags are
now queried via pkgconfig, which has the drawback of not having some
extra build flags, but they do not seem to be needed.

I tested this patch with the termux build system and it build without
their existing hack of injecting python after the configure step. I also
tested non cross compile build on Arch Linux and it also still works.

Fixes #851
This commit is contained in:
j.r
2022-02-18 18:50:02 +01:00
parent 57fb10f0bf
commit 5676159aa5
3 changed files with 9 additions and 10 deletions

View File

@@ -908,7 +908,7 @@ _handle_string_or_none_result(ProfPlugin* plugin, PyObject* result, char* hook)
_python_undefined_error(plugin, hook, "string, unicode or None");
return NULL;
}
#if PY_MAJOR_VERSION >= 3
#ifdef PY_IS_PYTHON3
if (result != Py_None && !PyUnicode_Check(result) && !PyBytes_Check(result)) {
allow_python_threads();
_python_type_error(plugin, hook, "string, unicode or None");