Skip to content

Commit

Permalink
Try to locate the real dereferenced Python DSO
Browse files Browse the repository at this point in the history
Try to pre-load the Python library with its real, fully dereferenced
path.

This is necessary because some installations don't have the symlink
from the generic (.so) to the versioned one (.so.X.Y) when the Python
development files aren't installed (i.e. libpython2.7-dev on Debian).

Fortunately for us (at least under Debian) Python has the name of the
final installed library in its `INSTSONAME` sysconfig's config var, so
use this instead of `LDLIBRARY` when it's available.

Closes #20.
  • Loading branch information
b4n committed Oct 11, 2015
1 parent dca86e4 commit 8c2e6f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion m4/ax_python_library.m4
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ cvars = get_config_vars()
# support multiarch-enabled distributions like Ubuntu
if not 'MULTIARCH' in cvars.keys():
cvars[['MULTIARCH']] = ''
print(path_join(cvars[['LIBDIR']], cvars[['MULTIARCH']], cvars[['LDLIBRARY']]))
# try to find the real installed lib, not the generic link
if not 'INSTSONAME' in cvars.keys():
cvars[['INSTSONAME']] = cvars[['LDLIBRARY']]
print(path_join(cvars[['LIBDIR']], cvars[['MULTIARCH']], cvars[['INSTSONAME']]))
EOD`
AC_SUBST([PYTHON_LIBRARY], [$ax_python_library])
Expand Down

0 comments on commit 8c2e6f7

Please sign in to comment.