From 11886e005ac3f1368f210e4badae026aec997290 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 22 Jul 2006 07:16:18 +0000 Subject: [PATCH] Merge: Don't link Boost.Python to python library [SVN r34663] --- src/tools/python.jam | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 3fcd6b446..8025b3570 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -50,6 +50,8 @@ lib dl ; # This contains 'openpty' function need by python. Again, on # some system need to pass this to linker explicitly. lib util ; +# Python uses pthread symbols. +lib pthread ; # Initializes the Python toolset. @@ -129,21 +131,26 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } - + local extra-libs ; - if [ os.name ] = SOLARIS + + switch [ os.name ] { - extra-libs = dl ; - } - else if [ os.name ] = OSF || [ os.name ] = QNXTO - { - # Nothing. - } - else - { - extra-libs = dl util ; + case SOLARIS : extra-libs = dl ; + case OSF : extra-libs = ; + case QNXTO : extra-libs = util ; + case * : extra-libs = dl util ; } + # Depending on system, Python library is either static + # or shared. When it's static, we need to add 'pthread' + # to link line of all clients, otherwise we'll get + # unresolved symbols. Same effect can be accomplished + # by using multi on the client, but + # that can have performance overhead, and is not really + # necessary, as Python interface has nothing that's + # affected by threading mode. + extra-libs += pthread ; # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions @@ -159,7 +166,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : $(extra-libs) + : $(extra-libs) : $(condition) : : $(includes)