diff --git a/src/tools/python.jam b/src/tools/python.jam index aa819e9a3..a5eb79a8d 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -21,9 +21,6 @@ # SHARED_LIB, not PYTHON_EXTENSION. That's because we reuse # 'lib-target-class', which creates SHARED_LIB explicitly. - - - import type ; import testing ; import generators ; @@ -235,7 +232,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) } - local extra-libs ; + local extra-libs extra-libs-conditional ; # Depending on system, Python library is either static # or shared. When it's static, we need to add 'pthread' @@ -247,32 +244,32 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) # affected by threading mode. switch [ os.name ] { - case SOLARIS : extra-libs = pthread dl ; - case OSF : extra-libs = pthread ; - case QNX* : extra-libs = ; + case SOLARIS : + { + extra-libs = pthread dl ; + + # Add 'rt' option on Sun. While we duplicate the + # logic already in sun.jam and gcc.jam, I see no easy + # way to refactor it -- Volodya. + # Note that for 'sun' toolset, rt is already unconditionally + # added. + extra-libs-conditional = gcc:rt ; + } + + case OSF : + { + extra-libs = pthread z ; + extra-libs-conditional = gcc:rt ; + } + + case QNX* : + { + extra-libs = ; + } + case * : extra-libs = pthread dl util ; } - extra-libs-conditional = ; - # Add 'rt' option on Sun. While we duplicate the - # logic already in sun.jam and gcc.jam, I see no easy - # way to refactor it. - # Note that for 'sun' toolset, rt is already unconditionally - # added. - - # (MS) Question: Why not [ os.name ] in the next statement? - switch [ modules.peek : JAMUNAME ] - { - case SunOS* : - { - extra-libs-conditional += gcc:rt ; - } - case OSF* : - { - extra-libs-conditional += gcc:rt ; - } - } - if ! [ os.on-windows ] { # On *nix, we don't want to link either Boost.Python or Python @@ -298,29 +295,6 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) $(libraries) python$(version) ; - - - # NOTES: - # - V1 had logic to force intel to use gcc's runtime. - # Note sure why that was needed, with icc 8.0 extensions - # built with intel are loaded by python without problems. - # - There was 'python-static-multithread' logic. Don't know - # what it affected, so can't test. - - # TODO: need to figure out when the following code is needed: - # for builtin extensions only or in some other cases too. - - - # if [ modules.peek $(OS) ] = OSF - # { - # PYTHON_PROPERTIES += <*><*>"-expect_unresolved 'Py*' -expect_unresolved '_Py*'" ; - # } - # else if [ modules.peek $(OS) ] = AIX - # { - # PYTHON_PROPERTIES - # += <*><*>"-Wl,-bI:$(PYTHON_LIB_PATH)/python.exp" - # <*><*>pthreads ; - # } } rule init-mac ( version : root ? : includes ? : libraries ? ) @@ -381,14 +355,6 @@ rule init-mac ( version : root ? : includes ? : libraries ? ) rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? ) { -# PYTHON_PROPERTIES = -# boost-python-disable-borland -# select-nt-python-includes -# dynamic -# @boost -# <$(gcc-compilers)><*>USE_DL_IMPORT -# ; - if ! $(cygwin-condition) { root ?= c:/tools/python ; @@ -428,21 +394,6 @@ rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? flags python.capture-output PYTHON : $(interpreter) ; - # This is mingw-specific V1 code. I don't yet understand - # why mingw must be specially-cased. - #local lib = $(PYTHON_IMPORT_LIB) ; - #if BOOST_DEBUG_PYTHON in $(properties) - #{ - # lib = $(PYTHON_DEBUG_IMPORT_LIB) ; - #} - #lib ?= $(PYTHON_DLL) ; - #if BOOST_DEBUG_PYTHON in $(properties) - #{ - # lib ?= $(PYTHON_DEBUG_DLL) ; - #} - #properties += $(lib) ; - #} - properties += $(PYTHON_LIB_PATH) ; # msvc compilers auto-find the python library @@ -457,11 +408,6 @@ rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? ; local lib = python$(PYTHON_VERSION_NODOT) ; - # TODO: don't support BOOST_DEBUG_PYTHON yet. - # if BOOST_DEBUG_PYTHON in $(properties) - # { - # lib = python$(PYTHON_VERSION_NODOT)_d ; - # } alias python : @@ -490,19 +436,12 @@ rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? CYGWIN_PYTHON_DEBUG_LIB_PATH ?= $(CYGWIN_PYTHON_DEBUG_ROOT)/lib/python$(CYGWIN_PYTHON_DEBUG_VERSION)/config ; local properties ; - # TODO: don't support BOOST_DEBUG_PYTHON yet. - #if BOOST_DEBUG_PYTHON in $(properties) - #{ - # properties += $(CYGWIN_PYTHON_DEBUG_LIB_PATH) python$(CYGWIN_PYTHON_DEBUG_VERSION).dll ; - #} - #else - #{ + properties += $(CYGWIN_PYTHON_LIB_PATH) python$(CYGWIN_PYTHON_VERSION).dll ; properties += $(root)/include/python$(version) ; - #} alias python : : $(cygwin-condition) @@ -535,35 +474,7 @@ rule python-extension ( name : sources * : requirements * : default-build * : usage-requirements * ) { requirements += /python//python_for_extensions ; - - # TODO: handle the following V1 code - #if $(OS) = MACOSX && $(toolset) = darwin - #{ - # if PYD in $(properties) - # { - # properties += bundle ; - # } - # properties += $(PYTHON_FRAMEWORK) ; - #} - -# <*>"-inline deferred" -# <*>"-inline deferred" # added for internal testing purposes -# <*>@boost/boost/compatibility/cpp_c_headers -# BOOST_PYTHON_DYNAMIC_LIB - - -# PYTHON_PROPERTIES += -# @boost -# on -# select-python-library - -# boost-python-disable-borland -# select-nt-python-includes -# dynamic -# @boost -# <$(gcc-compilers)><*>USE_DL_IMPORT -# $(PYTHON_INCLUDES) - + local project = [ project.current ] ;