Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[vuplus_openembedded] / recipes / boost / boost.inc
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.
6 DESCRIPTION = "Free peer-reviewed portable C++ source libraries"
7 HOMEPAGE = "http://www.boost.org/"
8 SECTION = "libs"
9 DEPENDS = "boost-jam-native zlib"
10 PRIORITY = "optional"
11 LICENSE = "Boost Software License"
12 PR = "r1"
13
14 BOOST_VER = "${@"_".join(bb.data.getVar("PV",d,1).split("."))}"
15 BOOST_MAJ = "${@"_".join(bb.data.getVar("PV",d,1).split(".")[0:2])}"
16 BOOST_P = "boost_${BOOST_VER}"
17
18 S = "${WORKDIR}/${BOOST_P}"
19
20 # Make a package for each library, plus -dev and -python
21 PACKAGES = "${PN}-dbg"
22 BOOSTLIBS = ""
23
24 PACKAGES += "boost-date-time"
25 FILES_boost-date-time = "${libdir}/libboost_date_time.so.${PV}"
26
27 BOOSTLIBS += "boost-filesystem"
28 FILES_boost-filesystem = "${libdir}/libboost_filesystem.so.${PV}"
29
30 BOOSTLIBS += "boost-prg-exec-monitor"
31 FILES_boost-prg-exec-monitor = "${libdir}/libboost_prg_exec_monitor.so.${PV}"
32
33 BOOSTLIBS += "boost-program-options"
34 FILES_boost-program-options = "${libdir}/libboost_program_options.so.${PV}"
35
36 BOOSTLIBS += "boost-regex"
37 FILES_boost-regex = "${libdir}/libboost_regex.so.${PV}"
38
39 BOOSTLIBS += "boost-signals"
40 FILES_boost-signals = "${libdir}/libboost_signals.so.${PV}"
41
42 BOOSTLIBS += "boost-test-exec-monitor"
43 FILES_boost-test-exec-monitor = "${libdir}/libboost_test_exec_monitor.so.${PV}"
44
45 BOOSTLIBS += "boost-thread-mt"
46 FILES_boost-thread-mt = "${libdir}/libboost_thread-mt.so.${PV}"
47
48 BOOSTLIBS += "boost-unit-test-framework"
49 FILES_boost-unit-test-framework = "${libdir}/libboost_unit_test_framework.so.${PV}"
50
51 BOOSTLIBS += "boost-iostreams"
52 FILES_boost-iostreams = "${libdir}/libboost_iostreams.so.${PV}"
53
54 BOOSTLIBS += "boost-serialization"
55 FILES_boost-serialization = "${libdir}/libboost_serialization.so.${PV}"
56
57 BOOSTLIBS += "boost-wserialization"
58 FILES_boost-wserialization = "${libdir}/libboost_wserialization.so.${PV}"
59
60 # Python - remove this and set:
61 #PYTHON_ROOT = "/dev/null"
62 # to remove the python build
63 DEPENDS += "python"
64 PYTHON_ROOT = "${STAGING_DIR_HOST}/${layout_prefix}"
65 PYTHON_VERSION = "2.5"
66
67 BOOSTLIBS += "boost-python"
68 FILES_boost-python = "${libdir}/libboost_python.so.${PV}"
69
70 PACKAGES += "${BOOSTLIBS}"
71
72 # -dev last to pick up the remaining stuff
73 PACKAGES += "${PN}-dev"
74 FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so ${libdir}/libboost_*.a"
75
76 # "boost" is a metapackage which pulls in all boost librabries
77 PACKAGES += "${PN}"
78 RRECOMMENDS_${PN} += "${BOOSTLIBS}"
79
80 # Oh yippee, a new build system, it's sooo cooool I could eat my own
81 # foot.  inlining=on lets the compiler choose, I think.  At least this
82 # stuff is documented...
83 # NOTE: if you leave <debug-symbols>on then in a debug build the build sys
84 # objcopy will be invoked, and that won't work.  Building debug apparently
85 # requires hacking gcc-tools.jam
86 #
87 # Sometimes I wake up screaming.  Famous figures are gathered in the nightmare,
88 # Steve Bourne, Larry Wall, the whole of the ANSI C committee.  They're just
89 # standing there, waiting, but the truely terrifying thing is what they carry
90 # in their hands.  At first sight each seems to bear the same thing, but it is
91 # not so for the forms in their grasp are ever so slightly different one from
92 # the other.  Each is twisted in some grotesque way from the other to make each
93 # an unspeakable perversion impossible to perceive without the onset of madness.
94 # True insanity awaits anyone who perceives all of these horrors together.
95 #
96 # Quotation marks, there might be an easier way to do this, but I can't find
97 # it.  The problem is that the user.hpp configuration file must receive a
98 # pre-processor macro defined as the appropriate string - complete with "'s
99 # around it.  (<> is a possibility here but the danger to that is that the
100 # failure case interprets the < and > as shell redirections, creating
101 # random files in the source tree.)
102 #
103 #bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
104 #do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
105 SQD = '"'
106 EQD = '\"'
107 #boost.bb:   "...  '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
108 BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
109
110 # bzip2 and zip are disabled because... they're broken - the compilation simply
111 # isn't working with bjam.  I guess they will fix it, but who needs it?  This
112 # only affects the (new in 33) iostream library.
113 BJAM_TOOLS   = "-sTOOLS=gcc \
114                 '-sGCC=${CC} '${BJAM_CONF} \
115                 '-sGXX=${CXX} '${BJAM_CONF} \
116                 '-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
117                 '-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
118                 '-sNO_BZIP2=1' \
119                 '-sNO_ZLIB=1' \
120                 '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
121                 '-sPYTHON_VERSION=${PYTHON_VERSION}' \
122                 '--layout=system' \
123                 "
124
125 BJAM_OPTS    = '${BJAM_TOOLS} \
126                 --builddir=${S}/${TARGET_SYS} \
127                 --with-python-root=${PYTHON_ROOT} \
128                 ${BJAM_EXTRA}'
129
130
131 do_configure_prepend() {
132         cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
133 }
134
135 do_compile() {
136         set -ex
137         bjam ${BJAM_OPTS} --prefix=${prefix} \
138                 --exec-prefix=${exec_prefix} \
139                 --libdir=${libdir} \
140                 --includedir=${includedir}
141 }
142
143 do_stage() {
144         set -ex
145         bjam ${BJAM_OPTS} \
146                 --libdir=${STAGING_LIBDIR} \
147                 --includedir=${STAGING_INCDIR} \
148                 install
149 }
150
151 do_install() {
152         set -ex
153         bjam ${BJAM_OPTS} \
154                 --libdir=${D}${libdir} \
155                 --includedir=${D}${includedir} \
156                 install
157 }