X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fpython%2Fbuild%2FJamfile;h=1fd6d0301ac43d9d39c4b8e1bd20cc5576069599;hb=b32b81446b3b05102be0267e79203f59329c1d97;hp=313fdab35dae259bc4f67a77c61d0e6efbd4cbd3;hpb=215dd7151453fae88e6f968c975b6ce309d42dcf;p=ceph.git diff --git a/ceph/src/boost/libs/python/build/Jamfile b/ceph/src/boost/libs/python/build/Jamfile index 313fdab35..1fd6d0301 100644 --- a/ceph/src/boost/libs/python/build/Jamfile +++ b/ceph/src/boost/libs/python/build/Jamfile @@ -6,6 +6,7 @@ import os ; import indirect ; import modules ; import feature ; +import property ; import python ; @@ -30,21 +31,8 @@ else ; } -rule find-py3-version -{ - local versions = [ feature.values python ] ; - local py3ver ; - for local v in $(versions) - { - if $(v) >= 3.0 - { - py3ver = $(v) ; - } - } - return $(py3ver) ; -} - -py3-version = [ find-py3-version ] ; +py2-version = [ py-version 2 ] ; +py3-version = [ py-version 3 ] ; project boost/python : source-location ../src @@ -52,13 +40,18 @@ project boost/python rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } } rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } } +local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } } -rule lib_boost_python ( is-py3 ? ) -{ +lib_boost_python(2) = boost_python ; +lib_boost_python(3) = boost_python3 ; - lib [ cond $(is-py3) : boost_python3 : boost_python ] +lib_boost_python($(py2-version)) = $(lib_boost_python(2)) ; +lib_boost_python($(py3-version)) = $(lib_boost_python(3)) ; + +rule lib_boost_python ( version ) +{ + lib $(lib_boost_python($(version))) : # sources - numeric.cpp list.cpp long.cpp dict.cpp @@ -112,11 +105,13 @@ rule lib_boost_python ( is-py3 ? ) config-warning on:BOOST_DEBUG_PYTHON - [ cond $(is-py3) : $(py3-version) ] + $(version) -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag @$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag + @python.require-py + : # default build shared : # usage requirements @@ -125,51 +120,68 @@ rule lib_boost_python ( is-py3 ? ) ; } -rule lib_boost_numpy ( is-py3 ? ) +lib_boost_numpy(2) = boost_numpy ; +lib_boost_numpy(3) = boost_numpy3 ; + +lib_boost_numpy($(py2-version)) = $(lib_boost_numpy(2)) ; +lib_boost_numpy($(py3-version)) = $(lib_boost_numpy(3)) ; + +rule lib_boost_numpy ( version ) { numpy-include = [ python.numpy-include ] ; - lib [ cond $(is-py3) : boost_numpy3 : boost_numpy ] + lib $(lib_boost_numpy($(version))) : # sources numpy/dtype.cpp numpy/matrix.cpp numpy/ndarray.cpp - numpy/numpy.cpp - numpy/scalars.cpp - numpy/ufunc.cpp + numpy/numpy.cpp + numpy/scalars.cpp + numpy/ufunc.cpp : # requirements + static:BOOST_NUMPY_STATIC_LIB + BOOST_NUMPY_SOURCE [ cond [ python.numpy ] : /python//python_for_extensions ] [ unless [ python.numpy ] : no ] - $(numpy-include) - boost_python + $(numpy-include) + $(lib_boost_python($(version))) on:BOOST_DEBUG_PYTHON - [ cond $(is-py3) : $(py3-version) ] + $(version) -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag @$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag + @python.require-py + : # default build shared : # usage requirements + static:BOOST_NUMPY_STATIC_LIB on:BOOST_DEBUG_PYTHON ; } -libraries = boost_python ; -libraries3 = boost_python3 ; -if [ python.numpy ] -{ - libraries += boost_numpy ; - libraries3 += boost_numpy3 ; -} - -lib_boost_python ; -lib_boost_numpy ; +libraries = ; -if $(py3-version) +for local N in 2 3 { - lib_boost_python yes ; - lib_boost_numpy yes ; - libraries += $(libraries3) ; + if $(py$(N)-version) + { + lib_boost_python $(py$(N)-version) ; + libraries += $(lib_boost_python($(py$(N)-version))) ; + } + else + { + alias $(lib_boost_python($(N))) ; + } + if $(py$(N)-version) && [ python.numpy ] + { + lib_boost_numpy $(py$(N)-version) ; + libraries += $(lib_boost_numpy($(py$(N)-version))) ; + } + else + { + alias $(lib_boost_numpy($(N))) ; + } } boost-install $(libraries) ;