boost.inc 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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-native zlib"
  10. DEPENDS_virtclass-native = ""
  11. LICENSE = "BSL-1.0 & MIT & Python-2.0"
  12. ARM_INSTRUCTION_SET = "arm"
  13. BOOST_VER = "${@"_".join(d.getVar("PV",1).split("."))}"
  14. BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}"
  15. BOOST_P = "boost_${BOOST_VER}"
  16. INC_PR = "r4"
  17. SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BOOST_P}.tar.bz2"
  18. S = "${WORKDIR}/${BOOST_P}"
  19. BOOST_LIBS = "\
  20. date_time \
  21. filesystem \
  22. graph \
  23. iostreams \
  24. program_options \
  25. regex \
  26. signals \
  27. system \
  28. test \
  29. thread \
  30. "
  31. # FIXME: for some reason this fails on powerpc
  32. #BOOST_LIBS += "serialization"
  33. # To enable python, uncomment the following:
  34. #BOOST_LIBS += "python"
  35. #DEPENDS += "python"
  36. #PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
  37. #PYTHON_VERSION = "2.7"
  38. # Make a package for each library, plus -dev
  39. PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
  40. python __anonymous () {
  41. packages = []
  42. extras = []
  43. for lib in d.getVar('BOOST_LIBS', True).split( ):
  44. pkg = "boost-%s" % lib.replace("_", "-")
  45. extras.append("--with-%s" % lib)
  46. packages.append(pkg)
  47. if not d.getVar("FILES_%s" % pkg, True):
  48. d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
  49. d.setVar("BOOST_PACKAGES", " ".join(packages))
  50. d.setVar("BJAM_EXTRA", " ".join(extras))
  51. }
  52. # Override the contents of specific packages
  53. FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
  54. ${libdir}/libboost_wserialization*.so.*"
  55. FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
  56. ${libdir}/libboost_unit_test_framework*.so.*"
  57. # -dev last to pick up the remaining stuff
  58. PACKAGES += "${PN}-dev ${PN}-staticdev"
  59. FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
  60. FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
  61. # "boost" is a metapackage which pulls in all boost librabries
  62. PACKAGES += "${PN}"
  63. RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
  64. RRECOMMENDS_${PN}_virtclass-native = ""
  65. ALLOW_EMPTY_${PN} = "1"
  66. # to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
  67. TARGET_CC_ARCH += " ${LDFLAGS}"
  68. # Oh yippee, a new build system, it's sooo cooool I could eat my own
  69. # foot. inlining=on lets the compiler choose, I think. At least this
  70. # stuff is documented...
  71. # NOTE: if you leave <debug-symbols>on then in a debug build the build sys
  72. # objcopy will be invoked, and that won't work. Building debug apparently
  73. # requires hacking gcc-tools.jam
  74. #
  75. # Sometimes I wake up screaming. Famous figures are gathered in the nightmare,
  76. # Steve Bourne, Larry Wall, the whole of the ANSI C committee. They're just
  77. # standing there, waiting, but the truely terrifying thing is what they carry
  78. # in their hands. At first sight each seems to bear the same thing, but it is
  79. # not so for the forms in their grasp are ever so slightly different one from
  80. # the other. Each is twisted in some grotesque way from the other to make each
  81. # an unspeakable perversion impossible to perceive without the onset of madness.
  82. # True insanity awaits anyone who perceives all of these horrors together.
  83. #
  84. # Quotation marks, there might be an easier way to do this, but I can't find
  85. # it. The problem is that the user.hpp configuration file must receive a
  86. # pre-processor macro defined as the appropriate string - complete with "'s
  87. # around it. (<> is a possibility here but the danger to that is that the
  88. # failure case interprets the < and > as shell redirections, creating
  89. # random files in the source tree.)
  90. #
  91. #bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
  92. #do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
  93. SQD = '"'
  94. EQD = '\"'
  95. #boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
  96. BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
  97. # bzip2 and zip are disabled because... they're broken - the compilation simply
  98. # isn't working with bjam. I guess they will fix it, but who needs it? This
  99. # only affects the (new in 33) iostream library.
  100. BJAM_TOOLS = "-sTOOLS=gcc \
  101. '-sGCC=${CC} '${BJAM_CONF} \
  102. '-sGXX=${CXX} '${BJAM_CONF} \
  103. '-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
  104. '-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
  105. '-sNO_BZIP2=1' \
  106. '-sNO_ZLIB=1' \
  107. '-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
  108. '-sPYTHON_VERSION=${PYTHON_VERSION}' \
  109. '-sPYTHON_ROOT=${PYTHON_ROOT}' \
  110. '--layout=system' \
  111. "
  112. BJAM_OPTS = '${BJAM_TOOLS} \
  113. -sBOOST_BUILD_USER_CONFIG=${S}/tools/build/v2/user-config.jam \
  114. --builddir=${S}/${TARGET_SYS} \
  115. --disable-icu \
  116. ${BJAM_EXTRA}'
  117. do_boostconfig() {
  118. cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
  119. # D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
  120. if ! grep -qe "^using gcc : 4.3.1" ${S}/tools/build/v2/user-config.jam
  121. then
  122. echo 'using gcc : 4.3.1 : ${CXX} : compileflags -DBOOST_SP_USE_PTHREADS -I${includedir} linkflags -L${libdir} ;' >> ${S}/tools/build/v2/user-config.jam
  123. fi
  124. echo "using python : ${PYTHON_VERSION} : : ${STAGING_INCDIR}/python${PYTHON_VERSION} ;" >> ${S}/tools/build/v2/user-config.jam
  125. CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
  126. sed -i '/^using python/d' project-config.jam
  127. }
  128. addtask do_boostconfig after do_patch before do_configure
  129. do_compile() {
  130. set -ex
  131. bjam ${BJAM_OPTS} --prefix=${prefix} \
  132. --exec-prefix=${exec_prefix} \
  133. --libdir=${libdir} \
  134. --includedir=${includedir}
  135. }
  136. do_install() {
  137. set -ex
  138. bjam ${BJAM_OPTS} \
  139. --libdir=${D}${libdir} \
  140. --includedir=${D}${includedir} \
  141. install
  142. for lib in ${BOOST_LIBS}; do
  143. if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
  144. ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
  145. fi
  146. if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
  147. ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
  148. fi
  149. done
  150. }
  151. BBCLASSEXTEND = "native"
  152. do_configure_virtclass-native() {
  153. :
  154. }
  155. do_boostconfig_virtclass-native() {
  156. :
  157. }
  158. do_compile_virtclass-native() {
  159. set -ex
  160. cd ${S}/tools/build/v2/engine
  161. rm -rf bin.*
  162. ./build.sh gcc
  163. }
  164. # This is too terrible - the build script doesn't give any good
  165. # way I can see to find out where the binaries are placed, so
  166. # rely on only one bin.foo directory being created.
  167. do_install_virtclass-native () {
  168. set -ex
  169. cd ${S}/tools/build/v2/engine
  170. install -d ${D}${bindir}/
  171. install -c -m 755 bin.*/bjam ${D}${bindir}/
  172. }