2009-07-16 11:08:42 +00:00
|
|
|
DESCRIPTION = "Free peer-reviewed portable C++ source libraries"
|
|
|
|
SECTION = "libs"
|
2013-03-26 13:02:19 +00:00
|
|
|
DEPENDS = "bjam-native zlib bzip2"
|
2009-07-16 11:08:42 +00:00
|
|
|
|
|
|
|
ARM_INSTRUCTION_SET = "arm"
|
2011-11-15 20:58:44 +00:00
|
|
|
|
2009-07-16 11:08:42 +00:00
|
|
|
BOOST_LIBS = "\
|
|
|
|
date_time \
|
|
|
|
filesystem \
|
|
|
|
graph \
|
|
|
|
iostreams \
|
|
|
|
program_options \
|
|
|
|
regex \
|
2013-09-02 05:08:04 +00:00
|
|
|
serialization \
|
2009-07-16 11:08:42 +00:00
|
|
|
signals \
|
|
|
|
system \
|
|
|
|
test \
|
|
|
|
thread \
|
|
|
|
"
|
|
|
|
|
2013-09-16 04:59:13 +00:00
|
|
|
# optional boost-python library
|
|
|
|
PACKAGECONFIG ??= ""
|
|
|
|
PACKAGECONFIG[python] = ",,python"
|
|
|
|
BOOST_LIBS += "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}"
|
|
|
|
inherit python-dir
|
|
|
|
PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
|
2009-07-16 11:08:42 +00:00
|
|
|
|
|
|
|
# Make a package for each library, plus -dev
|
|
|
|
PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
|
|
|
|
python __anonymous () {
|
|
|
|
packages = []
|
|
|
|
extras = []
|
2012-03-03 10:59:25 +00:00
|
|
|
for lib in d.getVar('BOOST_LIBS', True).split( ):
|
2009-07-16 11:08:42 +00:00
|
|
|
pkg = "boost-%s" % lib.replace("_", "-")
|
|
|
|
extras.append("--with-%s" % lib)
|
|
|
|
packages.append(pkg)
|
2012-03-03 10:59:25 +00:00
|
|
|
if not d.getVar("FILES_%s" % pkg, True):
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
|
2011-11-25 14:25:16 +00:00
|
|
|
d.setVar("BOOST_PACKAGES", " ".join(packages))
|
|
|
|
d.setVar("BJAM_EXTRA", " ".join(extras))
|
2009-07-16 11:08:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Override the contents of specific packages
|
2010-08-19 05:32:07 +00:00
|
|
|
FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
|
|
|
|
${libdir}/libboost_wserialization*.so.*"
|
|
|
|
FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
|
|
|
|
${libdir}/libboost_unit_test_framework*.so.*"
|
2009-07-16 11:08:42 +00:00
|
|
|
|
|
|
|
# -dev last to pick up the remaining stuff
|
2012-01-19 00:02:22 +00:00
|
|
|
PACKAGES += "${PN}-dev ${PN}-staticdev"
|
|
|
|
FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
|
|
|
|
FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
|
2009-07-16 11:08:42 +00:00
|
|
|
|
|
|
|
# "boost" is a metapackage which pulls in all boost librabries
|
|
|
|
PACKAGES += "${PN}"
|
|
|
|
RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
|
recipes-support: replace virtclass-native(sdk) with class-native(sdk)
The overrides virtclass-native and virtclass-nativesdk are deprecated,
which should be replaced by class-native and class-nativesdk.
NOTE:
There were 2 errors in libcap.inc, the BUILD_LDFLAGS_virtclass_native
should be BUILD_LDFLAGS_virtclass-native (the "_" should be "-"),
otherwise it doesn't work, and the value was: "-Wl,rpath=...", this is
incorrect, it shoudl be: "-Wl,-rpath=..." (lacked a - ), but we don't
need this line, since it is already in the default BUILD_LDFLAGS. Remove
it and we don't need to bump the PR since we just removed a unused line.
[YOCTO #3297]
(From OE-Core rev: cafb550fe9034754933f1708446dde155dcc3d51)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-27 08:48:17 +00:00
|
|
|
RRECOMMENDS_${PN}_class-native = ""
|
2010-08-19 05:32:07 +00:00
|
|
|
ALLOW_EMPTY_${PN} = "1"
|
2009-07-16 11:08:42 +00:00
|
|
|
|
|
|
|
# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
|
|
|
|
TARGET_CC_ARCH += " ${LDFLAGS}"
|
|
|
|
|
|
|
|
# Oh yippee, a new build system, it's sooo cooool I could eat my own
|
|
|
|
# foot. inlining=on lets the compiler choose, I think. At least this
|
|
|
|
# stuff is documented...
|
|
|
|
# NOTE: if you leave <debug-symbols>on then in a debug build the build sys
|
|
|
|
# objcopy will be invoked, and that won't work. Building debug apparently
|
|
|
|
# requires hacking gcc-tools.jam
|
|
|
|
#
|
|
|
|
# Sometimes I wake up screaming. Famous figures are gathered in the nightmare,
|
|
|
|
# Steve Bourne, Larry Wall, the whole of the ANSI C committee. They're just
|
|
|
|
# standing there, waiting, but the truely terrifying thing is what they carry
|
|
|
|
# in their hands. At first sight each seems to bear the same thing, but it is
|
|
|
|
# not so for the forms in their grasp are ever so slightly different one from
|
|
|
|
# the other. Each is twisted in some grotesque way from the other to make each
|
|
|
|
# an unspeakable perversion impossible to perceive without the onset of madness.
|
|
|
|
# True insanity awaits anyone who perceives all of these horrors together.
|
|
|
|
#
|
|
|
|
# Quotation marks, there might be an easier way to do this, but I can't find
|
|
|
|
# it. The problem is that the user.hpp configuration file must receive a
|
|
|
|
# pre-processor macro defined as the appropriate string - complete with "'s
|
|
|
|
# around it. (<> is a possibility here but the danger to that is that the
|
|
|
|
# failure case interprets the < and > as shell redirections, creating
|
|
|
|
# random files in the source tree.)
|
|
|
|
#
|
|
|
|
#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
|
|
|
|
#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
|
|
|
|
SQD = '"'
|
|
|
|
EQD = '\"'
|
|
|
|
#boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
|
|
|
|
BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
|
|
|
|
|
|
|
|
BJAM_TOOLS = "-sTOOLS=gcc \
|
|
|
|
'-sGCC=${CC} '${BJAM_CONF} \
|
|
|
|
'-sGXX=${CXX} '${BJAM_CONF} \
|
|
|
|
'-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
|
|
|
|
'-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
|
2011-12-28 01:03:03 +00:00
|
|
|
'-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
|
2013-09-16 04:59:13 +00:00
|
|
|
'-sPYTHON_VERSION=${PYTHON_BASEVERSION}' \
|
2012-04-25 00:12:04 +00:00
|
|
|
'-sPYTHON_ROOT=${PYTHON_ROOT}' \
|
2009-07-16 11:08:42 +00:00
|
|
|
'--layout=system' \
|
|
|
|
"
|
|
|
|
|
2013-06-26 17:19:32 +00:00
|
|
|
# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater paralelism causes bjam to segfault or to ignore -j
|
|
|
|
# https://svn.boost.org/trac/boost/ticket/7634
|
|
|
|
def get_boost_parallel_make(bb, d):
|
|
|
|
pm = d.getVar('PARALLEL_MAKE', True)
|
|
|
|
if pm:
|
|
|
|
# people are usually using "-jN" or "-j N", but let it work with something else appended to it
|
|
|
|
import re
|
|
|
|
pm_prefix = re.search("\D+", pm)
|
|
|
|
pm_val = re.search("\d+", pm)
|
|
|
|
if pm_prefix is None or pm_val is None:
|
|
|
|
bb.error("Unable to analyse format of PARALLEL_MAKE variable: %s" % pm)
|
|
|
|
pm_nval = min(64, int(pm_val.group(0)))
|
|
|
|
return pm_prefix.group(0) + str(pm_nval) + pm[pm_val.end():]
|
2013-08-21 13:08:32 +00:00
|
|
|
else:
|
|
|
|
return ""
|
2013-06-26 17:19:32 +00:00
|
|
|
|
|
|
|
BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}"
|
|
|
|
BJAM_OPTS = '${BOOST_PARALLEL_MAKE} \
|
2013-01-10 10:35:47 +00:00
|
|
|
${BJAM_TOOLS} \
|
|
|
|
-sBOOST_BUILD_USER_CONFIG=${S}/tools/build/v2/user-config.jam \
|
2009-07-16 11:08:42 +00:00
|
|
|
--builddir=${S}/${TARGET_SYS} \
|
2013-01-10 10:35:47 +00:00
|
|
|
--disable-icu \
|
2009-07-16 11:08:42 +00:00
|
|
|
${BJAM_EXTRA}'
|
|
|
|
|
2013-03-26 13:02:19 +00:00
|
|
|
# Native compilation of bzip2 isn't working
|
|
|
|
BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
|
2009-07-16 11:08:42 +00:00
|
|
|
|
2011-06-21 00:17:29 +00:00
|
|
|
do_boostconfig() {
|
2009-07-16 11:08:42 +00:00
|
|
|
cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
|
|
|
|
|
2012-04-13 11:42:46 +00:00
|
|
|
# D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
|
|
|
|
if ! grep -qe "^using gcc : 4.3.1" ${S}/tools/build/v2/user-config.jam
|
|
|
|
then
|
|
|
|
echo 'using gcc : 4.3.1 : ${CXX} : compileflags -DBOOST_SP_USE_PTHREADS -I${includedir} linkflags -L${libdir} ;' >> ${S}/tools/build/v2/user-config.jam
|
|
|
|
fi
|
2012-04-25 00:12:04 +00:00
|
|
|
|
2013-09-16 04:59:13 +00:00
|
|
|
echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/v2/user-config.jam
|
2012-04-25 00:12:04 +00:00
|
|
|
|
2013-03-26 13:02:19 +00:00
|
|
|
CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
|
2012-04-25 00:12:04 +00:00
|
|
|
sed -i '/^using python/d' project-config.jam
|
2009-07-16 11:08:42 +00:00
|
|
|
}
|
|
|
|
|
2011-06-21 00:17:29 +00:00
|
|
|
addtask do_boostconfig after do_patch before do_configure
|
|
|
|
|
2009-07-16 11:08:42 +00:00
|
|
|
do_compile() {
|
|
|
|
set -ex
|
|
|
|
bjam ${BJAM_OPTS} --prefix=${prefix} \
|
|
|
|
--exec-prefix=${exec_prefix} \
|
|
|
|
--libdir=${libdir} \
|
|
|
|
--includedir=${includedir}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
set -ex
|
|
|
|
bjam ${BJAM_OPTS} \
|
|
|
|
--libdir=${D}${libdir} \
|
|
|
|
--includedir=${D}${includedir} \
|
|
|
|
install
|
2011-12-28 01:03:03 +00:00
|
|
|
for lib in ${BOOST_LIBS}; do
|
|
|
|
if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
|
|
|
|
ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
|
|
|
|
fi
|
|
|
|
if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
|
|
|
|
ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2009-07-16 11:08:42 +00:00
|
|
|
}
|
2011-11-15 20:58:44 +00:00
|
|
|
|
|
|
|
BBCLASSEXTEND = "native"
|