Skip to content

Commit

Permalink
scons: Include flags required to link statically with Python
Browse files Browse the repository at this point in the history
Python requires the flags in LINKFORSHARED to be added the linker
flags when linking with a statically with Python. Failing to do so
typically results in errors from the Python's dynamic module loader at
start up.
  • Loading branch information
andysan committed Mar 14, 2013
1 parent 3ab91cd commit 0772f25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SConstruct
Expand Up @@ -839,6 +839,8 @@ py_lib_path = [ py_getvar('LIBDIR') ]
# shared library in prefix/lib/.
if not py_getvar('Py_ENABLE_SHARED'):
py_lib_path.append(py_getvar('LIBPL'))
# Python sometimes needs special flags when linking statically.
main.Append(LINKFLAGS=[py_getvar('LINKFORSHARED').split()])

py_libs = []
for lib in py_getvar('LIBS').split() + py_getvar('SYSLIBS').split():
Expand Down

0 comments on commit 0772f25

Please sign in to comment.