From eea24b89c13776d3644c347653d0f76aed10a0fe Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 22 Jul 2006 07:12:10 +0000 Subject: [PATCH] Don't link Boost.Python to python library, and don't require multi for embedding applications. * libs/python/build/Jamfile.v2: (boost_python): Don't link to /python//python. Use /python//python_for_extensions. * libs/python/test/Jamfile.v2: Remove multi project requirements. (py-run): Link to /python//python. (exec): Likewise. * tools/build/v2/tools/python.jam: (pthread): Declare. (init-unix): Add 'pthread' to extra-libs. ( [SVN r34662] --- src/tools/python.jam | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index d10a6c38c..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,7 +131,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } - + local extra-libs ; switch [ os.name ] @@ -140,6 +142,16 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) 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 # loaded in the interpreter, the symbols in the interpreter