Hi Matthias,

looking at m4/python.m4, this comes from getting the configuration out of the sysconfig module.

and _sysconfigdata_* has:

  'LOCALMODLIBS': '-lm      -lm   -lz -lm -lm   -lexpat  -lexpat     '
                  'Modules/_hacl/libHacl_Hash_SHA2.a         -lz',


So, I'm not sure, how to better get the required information for linking, but this interface doesn't look very reliable.

maybe better use: python3-config --embed --libs

Oh, yes, your proposal to use python3-config is far better.
After testing, "python3-config --libs" is enough; there's no need in adding "--embed" as the "-lpython3.12" flag otherwise appears twice in PYTHON_LIBS.

Also, if python3-config (which may also be python2-config, python-config or any other variant) is not installed, I've kept the current check just to be sure we'll still have something.


I've opened a PR upstream:

https://github.com/rra/rra-c-util/pull/18/commits/63e4ddf8683c8c1dc429043ca8af7984eff21140

Thanks again.

--
Julien ÉLIE

« Le cercle est le plus long chemin d'un point au même point. » (Tom
  Stoppard, _Every Good Boy Deserves Favour_)

Reply via email to