InterNetNews / inn

INN (InterNetNews) Usenet server
https://www.isc.org/othersoftware/#INN
Other
68 stars 12 forks source link

Use python-config to find the Python link flags #295

Closed Julien-Elie closed 5 months ago

Julien-Elie commented 5 months ago

Reported by Matthias Klose in the Debian bug tracker, INN fails to build with Python support on some hosts.

checking for Python.h... yes
checking for Py_Initialize... no
configure: error: in `/<<PKGBUILDDIR>>/build':
configure: error: unable to link with Python library

because of:

LOCALMODLIBS="-lm      -lm   -lz -lm -lm   -lexpat  -lexpat Modules/_hacl/libHacl_Hash_SHA2.a         -lz"
/usr/bin/ld: cannot find Modules/_hacl/libHacl_Hash_SHA2.a: No such file or directory

It appears that LOCALMODLIBS should not actually be used and breaks the build with recent Python versions. We should only keep BASEMODLIBS. Let's use python-config to find Python link flags, and fall back on the previous behaviour (minus LOCALMODLIBS) when python-config is not installed.