From 0772f25e6bce617884e752bb36bcd0636aff8004 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Wed, 13 Mar 2013 17:52:48 +0100 Subject: [PATCH] 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. --- SConstruct | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SConstruct b/SConstruct index c0a32ddc3..c937b17f8 100755 --- a/SConstruct +++ b/SConstruct @@ -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():