boost: add support to build with python2 and python3

Add support to build with python2 and python3 so other packages
like ceph can choose to build against python2 or python3.

fix #483
fix #497

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Babak Sarashki <Babak.SarAshki@windriver.com>
This commit is contained in:
Jackie Huang 2020-04-17 17:25:56 +08:00 committed by Babak Sarashki
parent 46d78550bd
commit 7511ca1805

View File

@ -0,0 +1,31 @@
DEP_PYTHON = "\
python \
python-native \
python-numpy-native \
python3 \
python3-native \
python3-numpy-native \
"
PACKAGECONFIG = "locale python"
PACKAGECONFIG[python] = ",,${DEP_PYTHON}"
BJAM_OPTS += "${@bb.utils.contains('BOOST_LIBS', 'python', 'python=${PYTHON_BASEVERSION},2.7', '', d)}"
do_configure_append () {
if ${@bb.utils.contains('BOOST_LIBS', 'python', 'true', 'false', d)}; then
echo "using python : 2.7 : ${STAGING_BINDIR_NATIVE}/python-native/python : ${STAGING_INCDIR}/python2.7 : ${STAGING_LIBDIR}/python2.7 ;" >> ${WORKDIR}/user-config.jam
sed -i -e 's|${STAGING_DIR_HOST}${bindir}/python3|${STAGING_BINDIR_NATIVE}/python3-native/python3|' ${WORKDIR}/user-config.jam
fi
}
PACKAGES += "${PN}-python3"
FILES_${PN}-python = " \
${libdir}/libboost_python2*.so.* \
${libdir}/libboost_numpy2*.so.* \
"
FILES_${PN}-python3 = " \
${libdir}/libboost_python3*.so.* \
${libdir}/libboost_numpy3*.so.* \
"