diff options
| author | David Bremner <david@tethera.net> | 2021-10-07 08:59:06 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-10-09 16:39:06 -0300 |
| commit | 6e050de4c01107ad0d914170aacf261701d2b71c (patch) | |
| tree | e76a82d9e37e220abeafd663367d443384f31b86 | |
| parent | 3e2e724d53a1dce3ba00a20c71b2e6f735678136 (diff) | |
configure: check explicitely for python dev (include) files
As discussed at [1] we have received reports that the implicit check
using cffi.FFI().verify() is not reliable in all environments. Since
we already use pkg-config, and the python dev package should include a
.pc file [2], add an extra check using pkg-config. On at least
Debian, we have to know which version of python dev files with are
looking for, so calculate that first.
[1]: id:87im1g35ey.fsf@tethera.netid:87im1g35ey.fsf@tethera.net,
[2]: checked on Debian and Fedora
| -rwxr-xr-x | configure | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -775,9 +775,25 @@ if [ $have_python -eq 1 ]; then fi fi +have_python3_dev=0 +if [ $have_python3 -eq 1 ]; then + printf "Checking for python3 version ..." + python3_version=$("$python" -c 'import sysconfig; print(sysconfig.get_python_version());') + printf "(%s)\n" $python3_version + + printf "Checking for python $python3_version development files..." + if pkg-config --exists "python-$python3_version"; then + have_python3_dev=1 + printf "Yes.\n" + else + have_python3_dev=0 + printf "No (will not install CFFI-based python bindings).\n" + fi +fi + have_python3_cffi=0 have_python3_pytest=0 -if [ $have_python3 -eq 1 ]; then +if [ $have_python3_dev -eq 1 ]; then printf "Checking for python3 cffi and setuptools... " if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then printf "Yes.\n" |
