Browse files

scons: Include flags required to link statically with Python

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...
1 parent 3ab91cd commit 0772f25e6bce617884e752bb36bcd0636aff8004 @andysan committed Mar 13, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 SConstruct
@@ -839,6 +839,8 @@ py_lib_path = [ py_getvar('LIBDIR') ]
# shared library in prefix/lib/.
if not py_getvar('Py_ENABLE_SHARED'):
+ # 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():

0 comments on commit 0772f25

Please sign in to comment.