summaryrefslogtreecommitdiffstats
path: root/recipes-support/boost
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-support/boost')
-rw-r--r--recipes-support/boost/bjam-native_1.57.0.bb15
-rw-r--r--recipes-support/boost/boost-1.57.0.inc19
-rw-r--r--recipes-support/boost/boost.inc184
-rw-r--r--recipes-support/boost/boost/arm-intrinsics.patch55
-rw-r--r--recipes-support/boost/boost_1.57.0.bb6
5 files changed, 279 insertions, 0 deletions
diff --git a/recipes-support/boost/bjam-native_1.57.0.bb b/recipes-support/boost/bjam-native_1.57.0.bb
new file mode 100644
index 0000000..d85d1a9
--- /dev/null
+++ b/recipes-support/boost/bjam-native_1.57.0.bb
@@ -0,0 +1,15 @@
1include boost-${PV}.inc
2
3SUMMARY = "Portable Boost.Jam build tool for boost"
4SECTION = "devel"
5
6inherit native
7
8do_compile() {
9 ./bootstrap.sh --with-toolset=gcc
10}
11
12do_install() {
13 install -d ${D}${bindir}/
14 install -c -m 755 bjam ${D}${bindir}/
15}
diff --git a/recipes-support/boost/boost-1.57.0.inc b/recipes-support/boost/boost-1.57.0.inc
new file mode 100644
index 0000000..809419d
--- /dev/null
+++ b/recipes-support/boost/boost-1.57.0.inc
@@ -0,0 +1,19 @@
1# The Boost web site provides free peer-reviewed portable
2# C++ source libraries. The emphasis is on libraries which
3# work well with the C++ Standard Library. The libraries are
4# intended to be widely useful, and are in regular use by
5# thousands of programmers across a broad spectrum of applications.
6HOMEPAGE = "http://www.boost.org/"
7LICENSE = "BSL-1.0 & MIT & Python-2.0"
8LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
9
10BOOST_VER = "${@"_".join(d.getVar("PV",1).split("."))}"
11BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}"
12BOOST_P = "boost_${BOOST_VER}"
13
14SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2"
15
16SRC_URI[md5sum] = "1be49befbdd9a5ce9def2983ba3e7b76"
17SRC_URI[sha256sum] = "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967"
18
19S = "${WORKDIR}/${BOOST_P}"
diff --git a/recipes-support/boost/boost.inc b/recipes-support/boost/boost.inc
new file mode 100644
index 0000000..bc2dc8c
--- /dev/null
+++ b/recipes-support/boost/boost.inc
@@ -0,0 +1,184 @@
1SUMMARY = "Free peer-reviewed portable C++ source libraries"
2SECTION = "libs"
3DEPENDS = "bjam-native zlib bzip2"
4
5ARM_INSTRUCTION_SET = "arm"
6
7BOOST_LIBS = "\
8 atomic \
9 chrono \
10 date_time \
11 filesystem \
12 graph \
13 iostreams \
14 log \
15 program_options \
16 random \
17 regex \
18 serialization \
19 signals \
20 system \
21 test \
22 thread \
23 "
24
25# optional boost-python library
26PACKAGECONFIG ??= ""
27PACKAGECONFIG[python] = ",,python"
28BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
29inherit python-dir
30PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
31
32# Make a package for each library, plus -dev
33PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
34python __anonymous () {
35 packages = []
36 extras = []
37 for lib in d.getVar('BOOST_LIBS', True).split( ):
38 pkg = "boost-%s" % lib.replace("_", "-")
39 extras.append("--with-%s" % lib)
40 packages.append(pkg)
41 if not d.getVar("FILES_%s" % pkg, True):
42 d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
43 d.setVar("BOOST_PACKAGES", " ".join(packages))
44 d.setVar("BJAM_EXTRA", " ".join(extras))
45}
46
47# Override the contents of specific packages
48FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
49 ${libdir}/libboost_wserialization*.so.*"
50FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
51 ${libdir}/libboost_unit_test_framework*.so.*"
52
53# -dev last to pick up the remaining stuff
54PACKAGES += "${PN}-dev ${PN}-staticdev"
55FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
56FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
57
58# "boost" is a metapackage which pulls in all boost librabries
59PACKAGES += "${PN}"
60RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
61RRECOMMENDS_${PN}_class-native = ""
62ALLOW_EMPTY_${PN} = "1"
63
64# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
65TARGET_CC_ARCH += "${LDFLAGS}"
66
67# Oh yippee, a new build system, it's sooo cooool I could eat my own
68# foot. inlining=on lets the compiler choose, I think. At least this
69# stuff is documented...
70# NOTE: if you leave <debug-symbols>on then in a debug build the build sys
71# objcopy will be invoked, and that won't work. Building debug apparently
72# requires hacking gcc-tools.jam
73#
74# Sometimes I wake up screaming. Famous figures are gathered in the nightmare,
75# Steve Bourne, Larry Wall, the whole of the ANSI C committee. They're just
76# standing there, waiting, but the truely terrifying thing is what they carry
77# in their hands. At first sight each seems to bear the same thing, but it is
78# not so for the forms in their grasp are ever so slightly different one from
79# the other. Each is twisted in some grotesque way from the other to make each
80# an unspeakable perversion impossible to perceive without the onset of madness.
81# True insanity awaits anyone who perceives all of these horrors together.
82#
83# Quotation marks, there might be an easier way to do this, but I can't find
84# it. The problem is that the user.hpp configuration file must receive a
85# pre-processor macro defined as the appropriate string - complete with "'s
86# around it. (<> is a possibility here but the danger to that is that the
87# failure case interprets the < and > as shell redirections, creating
88# random files in the source tree.)
89#
90#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
91#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
92SQD = '"'
93EQD = '\"'
94#boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
95BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
96
97BJAM_TOOLS = "--ignore-site-config \
98 '-sTOOLS=gcc' \
99 '-sGCC=${CC} '${BJAM_CONF} \
100 '-sGXX=${CXX} '${BJAM_CONF} \
101 '-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
102 '-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
103 '-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
104 '-sPYTHON_VERSION=${PYTHON_BASEVERSION}' \
105 '-sPYTHON_ROOT=${PYTHON_ROOT}' \
106 '--layout=system' \
107 "
108
109# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater paralelism causes bjam to segfault or to ignore -j
110# https://svn.boost.org/trac/boost/ticket/7634
111def get_boost_parallel_make(bb, d):
112 pm = d.getVar('PARALLEL_MAKE', True)
113 if pm:
114 # look for '-j' and throw other options (e.g. '-l') away
115 # because they might have different meaning in bjam
116 pm = pm.split()
117 while pm:
118 v = None
119 opt = pm.pop(0)
120 if opt == '-j':
121 v = pm.pop(0)
122 elif opt.startswith('-j'):
123 v = opt[2:].strip()
124 else:
125 v = None
126
127 if v:
128 v = min(64, int(v))
129 return '-j' + str(v)
130
131 return ""
132
133BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}"
134BJAM_OPTS = '${BOOST_PARALLEL_MAKE} \
135 ${BJAM_TOOLS} \
136 -sBOOST_BUILD_USER_CONFIG=${S}/tools/build/example/user-config.jam \
137 --builddir=${S}/${TARGET_SYS} \
138 --disable-icu \
139 ${BJAM_EXTRA}'
140
141# Native compilation of bzip2 isn't working
142BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
143
144do_boostconfig() {
145 cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
146
147 # D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
148 sed -i "/^using gcc : 4.3.1/d" ${S}/tools/build/example/user-config.jam
149 sed -i "/^using python : ${PYTHON_BASEVERSION}"/d ${S}/tools/build/example/user-config.jam
150 echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${S}/tools/build/example/user-config.jam
151 echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/example/user-config.jam
152
153 CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
154 sed -i '/^using python/d' project-config.jam
155}
156
157addtask do_boostconfig after do_patch before do_configure
158
159do_compile() {
160 set -ex
161 bjam ${BJAM_OPTS} --prefix=${prefix} \
162 --exec-prefix=${exec_prefix} \
163 --libdir=${libdir} \
164 --includedir=${includedir}
165}
166
167do_install() {
168 set -ex
169 bjam ${BJAM_OPTS} \
170 --libdir=${D}${libdir} \
171 --includedir=${D}${includedir} \
172 install
173 for lib in ${BOOST_LIBS}; do
174 if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
175 ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
176 fi
177 if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
178 ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
179 fi
180 done
181
182}
183
184BBCLASSEXTEND = "native"
diff --git a/recipes-support/boost/boost/arm-intrinsics.patch b/recipes-support/boost/boost/arm-intrinsics.patch
new file mode 100644
index 0000000..fe85c69
--- /dev/null
+++ b/recipes-support/boost/boost/arm-intrinsics.patch
@@ -0,0 +1,55 @@
1Upstream-Status: Backport
2
38/17/2010 - rebased to 1.44 by Qing He <qing.he@intel.com>
4
5diff --git a/boost/smart_ptr/detail/atomic_count_sync.hpp b/boost/smart_ptr/detail/atomic_count_sync.hpp
6index b6359b5..78b1cc2 100644
7--- a/boost/smart_ptr/detail/atomic_count_sync.hpp
8+++ b/boost/smart_ptr/detail/atomic_count_sync.hpp
9@@ -33,17 +33,46 @@ public:
10
11 long operator++()
12 {
13+#ifdef __ARM_ARCH_7A__
14+ int v1, tmp;
15+ asm volatile ("1: \n\t"
16+ "ldrex %0, %1 \n\t"
17+ "add %0 ,%0, #1 \n\t"
18+ "strex %2, %0, %1 \n\t"
19+ "cmp %2, #0 \n\t"
20+ "bne 1b \n\t"
21+ : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
22+ );
23+#else
24 return __sync_add_and_fetch( &value_, 1 );
25+#endif
26 }
27
28 long operator--()
29 {
30+#ifdef __ARM_ARCH_7A__
31+ int v1, tmp;
32+ asm volatile ("1: \n\t"
33+ "ldrex %0, %1 \n\t"
34+ "sub %0 ,%0, #1 \n\t"
35+ "strex %2, %0, %1 \n\t"
36+ "cmp %2, #0 \n\t"
37+ "bne 1b \n\t"
38+ : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
39+ );
40+ return value_;
41+#else
42 return __sync_add_and_fetch( &value_, -1 );
43+#endif
44 }
45
46 operator long() const
47 {
48+#if __ARM_ARCH_7A__
49+ return value_;
50+#else
51 return __sync_fetch_and_add( &value_, 0 );
52+#endif
53 }
54
55 private:
diff --git a/recipes-support/boost/boost_1.57.0.bb b/recipes-support/boost/boost_1.57.0.bb
new file mode 100644
index 0000000..c09d5f4
--- /dev/null
+++ b/recipes-support/boost/boost_1.57.0.bb
@@ -0,0 +1,6 @@
1include boost-${PV}.inc
2include boost.inc
3
4SRC_URI += "\
5 file://arm-intrinsics.patch \
6"