diff options
author | Ubuntu <ubuntu@ip-172-31-14-192.eu-central-1.compute.internal> | 2018-04-11 12:35:46 +0000 |
---|---|---|
committer | Ubuntu <ubuntu@ip-172-31-14-192.eu-central-1.compute.internal> | 2018-04-11 12:35:46 +0000 |
commit | 5048bf8d2b9ecd070c9ed4e584f274f8ab6cfbfa (patch) | |
tree | d9c4057eefd28db1748a6469d01d1cc78a34cf7a /recipes-support/boost/boost.inc | |
download | meta-updater-daisy.tar.gz |
Initial commit of Daisy aktualizr builddaisy
Diffstat (limited to 'recipes-support/boost/boost.inc')
-rw-r--r-- | recipes-support/boost/boost.inc | 184 |
1 files changed, 184 insertions, 0 deletions
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 @@ | |||
1 | SUMMARY = "Free peer-reviewed portable C++ source libraries" | ||
2 | SECTION = "libs" | ||
3 | DEPENDS = "bjam-native zlib bzip2" | ||
4 | |||
5 | ARM_INSTRUCTION_SET = "arm" | ||
6 | |||
7 | BOOST_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 | ||
26 | PACKAGECONFIG ??= "" | ||
27 | PACKAGECONFIG[python] = ",,python" | ||
28 | BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" | ||
29 | inherit python-dir | ||
30 | PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}" | ||
31 | |||
32 | # Make a package for each library, plus -dev | ||
33 | PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}" | ||
34 | python __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 | ||
48 | FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \ | ||
49 | ${libdir}/libboost_wserialization*.so.*" | ||
50 | FILES_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 | ||
54 | PACKAGES += "${PN}-dev ${PN}-staticdev" | ||
55 | FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so" | ||
56 | FILES_${PN}-staticdev = "${libdir}/libboost_*.a" | ||
57 | |||
58 | # "boost" is a metapackage which pulls in all boost librabries | ||
59 | PACKAGES += "${PN}" | ||
60 | RRECOMMENDS_${PN} += "${BOOST_PACKAGES}" | ||
61 | RRECOMMENDS_${PN}_class-native = "" | ||
62 | ALLOW_EMPTY_${PN} = "1" | ||
63 | |||
64 | # to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works | ||
65 | TARGET_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\"'" | ||
92 | SQD = '"' | ||
93 | EQD = '\"' | ||
94 | #boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..." | ||
95 | BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}" | ||
96 | |||
97 | BJAM_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 | ||
111 | def 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 | |||
133 | BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}" | ||
134 | BJAM_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 | ||
142 | BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1' | ||
143 | |||
144 | do_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 | |||
157 | addtask do_boostconfig after do_patch before do_configure | ||
158 | |||
159 | do_compile() { | ||
160 | set -ex | ||
161 | bjam ${BJAM_OPTS} --prefix=${prefix} \ | ||
162 | --exec-prefix=${exec_prefix} \ | ||
163 | --libdir=${libdir} \ | ||
164 | --includedir=${includedir} | ||
165 | } | ||
166 | |||
167 | do_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 | |||
184 | BBCLASSEXTEND = "native" | ||