I'm trying to build unbound with python 3.x (bug #1115489) and it apparently expect to find a python so including the full python version. It detect that the used python version is 3.4 and then expects to find libpython3.4 just like it did with libpython2.7. The relevant line from configure output: checking for Python library path... -L/usr/lib64/python3.4 -L/usr/lib64 -lpython3.4 Details about the scratch build attempt is here: http://koji.fedoraproject.org/koji/taskinfo?taskID=7618550
The reason why this fails are "Python ABI Flags" [1] added since Python 3.2. For example, Fedora's python3 builds have "m" abi flag appended to soname, hence you have to link against "python3.4m". The upstream shouldn't hardcode "-lpython3.4", Instead, they should get the library name dynamically, there are two ways to do this: - $PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('BLDLIBRARY'))" (on Fedora, this returns "-L. -lpython3.4m") - -lpython`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('LDVERSION'))"` The second option however doesn't work with Python 2, so I'd recommend using the first one. I'm closing this as notabug, but feel free to reopen this if you think it needs a longer discussion. [1] http://legacy.python.org/dev/peps/pep-3149/
I'm ok with closing, will work with upstream to configure using `sysconfig`. Is there any best practice for using `distutils.sysconfig` data in makefiles/autotools? Why does it return `-L.` by the way? I certainly need an option which works at least with the most common Python 2.x variants.
(In reply to Pavel Šimerda (pavlix) from comment #2) > I'm ok with closing, will work with upstream to configure using `sysconfig`. > Is there any best practice for using `distutils.sysconfig` data in > makefiles/autotools? I'm not aware of any approach being talked about as "best practice" in this regard. AFAIK it's normal to just use $PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('BLDLIBRARY'))" makefiles/autotools files to get the proper values. > Why does it return `-L.` by the way? I certainly need > an option which works at least with the most common Python 2.x variants. Honestly, I have no idea why it also returns "-L.", I can investigate... The above option works fine with Python >= 2.6, is that good enough?