mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 12:42:11 +00:00
Don't explicitly link python on darwin
Passing -undefined dynamic_lookup to the linker (instead of -lpython or -framework Python) permits undefined symbols in shared libraries on OS X. This allows a module to be linked against one Python framework and imported from another.
This commit is contained in:
committed by
Vladimir Prus
parent
9576ca216c
commit
b1c031d26b
@@ -962,16 +962,18 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
|
||||
# symbols. If we linked to libpython, we would get duplicate symbols. So
|
||||
# declare two targets -- one for building extensions and another for
|
||||
# embedding.
|
||||
#
|
||||
# Unlike most *nix systems, Mac OS X's linker does not permit undefined
|
||||
# symbols when linking a shared library. So, we still need to link against
|
||||
# the Python framework, even when building extensions. Note that framework
|
||||
# builds of Python always use shared libraries, so we do not need to worry
|
||||
# about duplicate Python symbols.
|
||||
if $(target-os) in windows cygwin darwin
|
||||
if $(target-os) in windows cygwin
|
||||
{
|
||||
alias python_for_extensions : python : $(target-requirements) ;
|
||||
}
|
||||
else if $(target-os) = darwin {
|
||||
alias python_for_extensions
|
||||
:
|
||||
: $(target-requirements)
|
||||
:
|
||||
: $(usage-requirements) <linkflags>"-undefined dynamic_lookup"
|
||||
;
|
||||
}
|
||||
# On AIX we need Python extensions and Boost.Python to import symbols from
|
||||
# the Python interpreter. Dynamic libraries opened with dlopen() do not
|
||||
# inherit the symbols from the Python interpreter.
|
||||
|
||||
Reference in New Issue
Block a user