diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index d36d104e1..f543652b0 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -470,15 +470,15 @@ rule add-prefix-and-suffix ( specified-name : type ? : property-set ) suffix = .$(suffix) ; local prefix = [ type.generated-target-prefix $(type) : $(property-set) ] ; - - if ! $(prefix) - && [ type.is-derived $(type) LIB ] && [ os.on-unix ] - # This becomes hacky! Need to introduce more general mechanism. - # Invoke type.set-target-prefix in unix toolkit? - && ! [ type.is-derived $(type) PYTHON_EXTENSION ] - { - prefix = lib ; - } + +# if ! $(prefix) +# && [ type.is-derived $(type) LIB ] && [ os.on-unix ] +# # This becomes hacky! Need to introduce more general mechanism. +# # Invoke type.set-target-prefix in unix toolkit? +# && ! [ type.is-derived $(type) PYTHON_EXTENSION ] +# { +# prefix = lib ; +# } if [ MATCH ^($(prefix)) : $(specified-name) ] { prefix = ; diff --git a/v2/tools/python.jam b/v2/tools/python.jam index e28734979..c215599a9 100644 --- a/v2/tools/python.jam +++ b/v2/tools/python.jam @@ -128,6 +128,22 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) { flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } + + + local extra-libs ; + if [ os.name ] = SOLARIS + { + extra-libs = dl ; + } + else if [ os.name ] = OSF || [ os.name ] = QNXTO + { + # Nothing. + } + else + { + extra-libs = dl util ; + } + # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions @@ -143,7 +159,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : dl util + : $(extra-libs) : $(condition) : : $(includes) @@ -373,6 +389,9 @@ type.set-generated-target-suffix PYTHON_EXTENSION : : so ; type.set-generated-target-suffix PYTHON_EXTENSION : NT : dll ; type.set-generated-target-suffix PYTHON_EXTENSION : CYGWIN : so ; +# Unset 'lib' prefix for PYTHON_EXTENSION +type.set-generated-target-prefix PYTHON_EXTENSION : : "" ; + rule python-extension ( name : sources * : requirements * : default-build * : usage-requirements * ) { diff --git a/v2/tools/types/lib.jam b/v2/tools/types/lib.jam index 9c753cc2c..21fab6773 100644 --- a/v2/tools/types/lib.jam +++ b/v2/tools/types/lib.jam @@ -3,9 +3,15 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import type ; # for set-generated-target-suffix +import os ; type.register LIB ; +if [ os.on-unix ] +{ + type.set-generated-target-prefix LIB : : "lib" ; +} + type STATIC_LIB : lib a : LIB : NT CYGWIN ; type STATIC_LIB : a : LIB : MACOSX ; type STATIC_LIB : a : LIB ;