You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

399 lines
10 KiB

  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. #
  8. # Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
  9. # Dude, this "boost" is really one of the most crude stuff I ported yet.
  10. #
  11. include $(TOPDIR)/rules.mk
  12. PKG_NAME:=boost
  13. PKG_VERSION:=1_57_0
  14. PKG_RELEASE:=1
  15. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=@SF/boost
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
  18. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_VERSION)
  19. PKG_MD5SUM:=25f9a8ac28beeb5ab84aa98510305299
  20. PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
  21. PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com> (Modified from Mirko Vogt <mirko@openwrt.org> Boost 1.51 Original Makefile and patches)
  22. PKG_BUILD_DEPENDS:=boost/host
  23. PKG_BUILD_PARALLEL:=0
  24. PKG_USE_MIPS16:=0
  25. PKG_CONFIG_DEPENDS := \
  26. CONFIG_PACKAGE_boost-date_time \
  27. CONFIG_PACKAGE_boost-filesystem \
  28. CONFIG_PACKAGE_boost-graph \
  29. CONFIG_PACKAGE_boost-iostreams \
  30. CONFIG_PACKAGE_boost-math \
  31. CONFIG_PACKAGE_boost-program_options \
  32. CONFIG_PACKAGE_boost-python \
  33. CONFIG_PACKAGE_boost-regex \
  34. CONFIG_PACKAGE_boost-serialization \
  35. CONFIG_PACKAGE_boost-signals \
  36. CONFIG_PACKAGE_boost-system \
  37. CONFIG_PACKAGE_boost-test \
  38. CONFIG_PACKAGE_boost-thread \
  39. CONFIG_PACKAGE_boost-wave \
  40. CONFIG_PACKAGE_boost-atomic \
  41. include $(INCLUDE_DIR)/package.mk
  42. include $(INCLUDE_DIR)/host-build.mk
  43. define Package/boost/Default
  44. SECTION:=libs
  45. CATEGORY:=Libraries
  46. TITLE:=Boost C++ source libraries
  47. URL:=http://www.boost.org
  48. DEPENDS:=+libstdcpp +libpthread +librt
  49. endef
  50. define Package/boost/Default/description
  51. Boost provides free peer-reviewed portable C++ source libraries
  52. endef
  53. define Package/boost-atomic
  54. $(call Package/boost/Default)
  55. TITLE+= (atomic)
  56. DEPENDS+= +boost-system
  57. endef
  58. define Package/boost-chrono
  59. $(call Package/boost/Default)
  60. TITLE+= (chrono)
  61. DEPENDS+= +boost-system
  62. endef
  63. define Package/boost-date_time
  64. $(call Package/boost/Default)
  65. TITLE+= (date_time)
  66. endef
  67. define Package/boost-exception
  68. $(call Package/boost/Default)
  69. TITLE+= (exception)
  70. endef
  71. define Package/boost-filesystem
  72. $(call Package/boost/Default)
  73. TITLE+= (filesystem)
  74. DEPENDS+= +boost-system
  75. endef
  76. define Package/boost-graph
  77. $(call Package/boost/Default)
  78. TITLE+= (graph)
  79. DEPENDS+= +boost-regex
  80. endef
  81. define Package/boost-graph_parallel
  82. $(call Package/boost/Default)
  83. TITLE+= (graph_parallel)
  84. endef
  85. define Package/boost-iostreams
  86. $(call Package/boost/Default)
  87. TITLE+= (iostreams)
  88. DEPENDS+= +zlib
  89. endef
  90. define Package/boost-locale
  91. $(call Package/boost/Default)
  92. TITLE+= (locale)
  93. endef
  94. define Package/boost-math
  95. $(call Package/boost/Default)
  96. TITLE+= (math)
  97. endef
  98. define Package/boost-mpi
  99. $(call Package/boost/Default)
  100. TITLE+= (mpi)
  101. endef
  102. define Package/boost-program_options
  103. $(call Package/boost/Default)
  104. TITLE+= (program_options)
  105. endef
  106. define Package/boost-python
  107. $(call Package/boost/Default)
  108. TITLE+= (python)
  109. DEPENDS+= +PACKAGE_boost-python:python
  110. endef
  111. define Package/boost-random
  112. $(call Package/boost/Default)
  113. TITLE+= (random)
  114. DEPENDS+= +boost-system
  115. endef
  116. define Package/boost-regex
  117. $(call Package/boost/Default)
  118. TITLE+= (regex)
  119. endef
  120. define Package/boost-serialization
  121. $(call Package/boost/Default)
  122. TITLE+= (serialization)
  123. endef
  124. define Package/boost-signals
  125. $(call Package/boost/Default)
  126. TITLE+= (signals)
  127. endef
  128. define Package/boost-system
  129. $(call Package/boost/Default)
  130. TITLE+= (system)
  131. endef
  132. define Package/boost-test
  133. $(call Package/boost/Default)
  134. TITLE+= (test)
  135. endef
  136. define Package/boost-thread
  137. $(call Package/boost/Default)
  138. TITLE+= (thread)
  139. DEPENDS+= +boost-system +boost-chrono +boost-atomic
  140. endef
  141. define Package/boost-timer
  142. $(call Package/boost/Default)
  143. TITLE+= (timer)
  144. DEPENDS+= boost-chrono
  145. endef
  146. define Package/boost-wave
  147. $(call Package/boost/Default)
  148. TITLE+= (wave)
  149. DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
  150. endef
  151. define Package/boost
  152. $(call Package/boost/Default)
  153. TITLE+= (header-only)
  154. BUILDONLY:=1
  155. endef
  156. define Build/Configure
  157. endef
  158. define Host/Compile
  159. # bjam does not provide a configure-script nor a Makefile
  160. ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
  161. endef
  162. CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
  163. TARGET_LDFLAGS += -pthread -lrt
  164. define Build/Compile
  165. ( cd $(PKG_BUILD_DIR) ; \
  166. echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
  167. $(if $(CONFIG_PACKAGE_boost-python), \
  168. echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \
  169. tools/build/src/user-config.jam; \
  170. ) \
  171. bjam \
  172. '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
  173. --toolset=gcc-$(ARCH) --build-type=minimal --layout=system \
  174. --disable-long-double \
  175. $(CONFIGURE_ARGS) \
  176. $(if $(CONFIG_PACKAGE_boost-atomic),,--without-atomic) \
  177. $(if $(CONFIG_PACKAGE_boost-chrono),,--without-chrono) \
  178. $(if $(CONFIG_PACKAGE_boost-date_time),,--without-date_time) \
  179. $(if $(CONFIG_PACKAGE_boost-exception),,--without-exception) \
  180. $(if $(CONFIG_PACKAGE_boost-filesystem),,--without-filesystem) \
  181. $(if $(CONFIG_PACKAGE_boost-graph),,--without-graph) \
  182. $(if $(CONFIG_PACKAGE_boost-graph_parallel),,--without-graph_parallel) \
  183. $(if $(CONFIG_PACKAGE_boost-iostreams),,--without-iostreams) \
  184. $(if $(CONFIG_PACKAGE_boost-locale),,--without-locale) \
  185. $(if $(CONFIG_PACKAGE_boost-math),,--without-math) \
  186. $(if $(CONFIG_PACKAGE_boost-mpi),,--without-mpi) \
  187. $(if $(CONFIG_PACKAGE_boost-program_options),,--without-program_options) \
  188. $(if $(CONFIG_PACKAGE_boost-python),,--without-python) \
  189. $(if $(CONFIG_PACKAGE_boost-random),,--without-random) \
  190. $(if $(CONFIG_PACKAGE_boost-regex),,--without-regex) \
  191. $(if $(CONFIG_PACKAGE_boost-serialization),,--without-serialization) \
  192. $(if $(CONFIG_PACKAGE_boost-signals),,--without-signals) \
  193. $(if $(CONFIG_PACKAGE_boost-system),,--without-system) \
  194. $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
  195. $(if $(CONFIG_PACKAGE_boost-thread),,--without-thread) \
  196. $(if $(CONFIG_PACKAGE_boost-timer),,--without-timer) \
  197. $(if $(CONFIG_PACKAGE_boost-wave),,--without-wave) \
  198. \
  199. $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
  200. -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
  201. install \
  202. )
  203. endef
  204. define Build/InstallDev
  205. $(INSTALL_DIR) \
  206. $(1)/usr/include/boost/
  207. $(CP) \
  208. $(PKG_INSTALL_DIR)/include/boost/* \
  209. $(1)/usr/include/boost/ \
  210. # copies _all_ header files - independent of <--with-library>-argument above
  211. if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
  212. $(INSTALL_DIR) \
  213. $(1)/usr/lib; \
  214. $(CP) \
  215. $(PKG_INSTALL_DIR)/lib/*.a \
  216. $(1)/usr/lib/; \
  217. $(CP) \
  218. $(PKG_INSTALL_DIR)/lib/*.so* \
  219. $(1)/usr/lib/; \
  220. fi
  221. endef
  222. define Host/Install
  223. $(INSTALL_DIR) \
  224. $(STAGING_DIR_HOST)/bin
  225. $(CP) \
  226. $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/bjam \
  227. $(STAGING_DIR_HOST)/bin/
  228. endef
  229. define Package/boost/Default/install
  230. $(INSTALL_DIR) \
  231. $(1)/usr/lib
  232. $(CP) \
  233. $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
  234. $(1)/usr/lib/
  235. endef
  236. define Package/boost-atomic/install
  237. $(call Package/boost/Default/install,$(1),atomic)
  238. endef
  239. define Package/boost-chrono/install
  240. $(call Package/boost/Default/install,$(1),chrono)
  241. endef
  242. define Package/boost-date_time/install
  243. $(call Package/boost/Default/install,$(1),date_time)
  244. endef
  245. define Package/boost-exception/install
  246. $(call Package/boost/Default/install,$(1),exception)
  247. endef
  248. define Package/boost-filesystem/install
  249. $(call Package/boost/Default/install,$(1),filesystem)
  250. endef
  251. define Package/boost-graph/install
  252. $(call Package/boost/Default/install,$(1),graph)
  253. endef
  254. define Package/boost-graph_parallel/install
  255. $(call Package/boost/Default/install,$(1),graph_parallel)
  256. endef
  257. define Package/boost-iostreams/install
  258. $(call Package/boost/Default/install,$(1),iostreams)
  259. endef
  260. define Package/boost-math/install
  261. $(call Package/boost/Default/install,$(1),math)
  262. endef
  263. define Package/boost-mpi/install
  264. $(call Package/boost/Default/install,$(1),mpi)
  265. endef
  266. define Package/boost-program_options/install
  267. $(call Package/boost/Default/install,$(1),program_options)
  268. endef
  269. define Package/boost-python/install
  270. $(call Package/boost/Default/install,$(1),python)
  271. endef
  272. define Package/boost-random/install
  273. $(call Package/boost/Default/install,$(1),random)
  274. endef
  275. define Package/boost-regex/install
  276. $(call Package/boost/Default/install,$(1),regex)
  277. endef
  278. define Package/boost-serialization/install
  279. $(call Package/boost/Default/install,$(1),serialization)
  280. endef
  281. define Package/boost-signals/install
  282. $(call Package/boost/Default/install,$(1),signals)
  283. endef
  284. define Package/boost-system/install
  285. $(call Package/boost/Default/install,$(1),system)
  286. endef
  287. define Package/boost-test/install
  288. $(INSTALL_DIR) \
  289. $(1)/usr/lib
  290. $(CP) \
  291. $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
  292. $(1)/usr/lib/
  293. $(CP) \
  294. $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
  295. $(1)/usr/lib/
  296. endef
  297. define Package/boost-thread/install
  298. $(call Package/boost/Default/install,$(1),thread)
  299. endef
  300. define Package/boost-timer/install
  301. $(call Package/boost/Default/install,$(1),timer)
  302. endef
  303. define Package/boost-wave/install
  304. $(call Package/boost/Default/install,$(1),wave)
  305. endef
  306. $(eval $(call HostBuild))
  307. $(eval $(call BuildPackage,boost))
  308. $(eval $(call BuildPackage,boost-atomic))
  309. $(eval $(call BuildPackage,boost-chrono))
  310. $(eval $(call BuildPackage,boost-date_time))
  311. #$(eval $(call BuildPackage,boost-exception))
  312. $(eval $(call BuildPackage,boost-filesystem))
  313. $(eval $(call BuildPackage,boost-graph))
  314. #$(eval $(call BuildPackage,boost-graph_parallel))
  315. $(eval $(call BuildPackage,boost-iostreams))
  316. $(eval $(call BuildPackage,boost-locale))
  317. $(eval $(call BuildPackage,boost-math))
  318. #$(eval $(call BuildPackage,boost-mpi))
  319. $(eval $(call BuildPackage,boost-program_options))
  320. $(eval $(call BuildPackage,boost-random))
  321. $(eval $(call BuildPackage,boost-python))
  322. $(eval $(call BuildPackage,boost-regex))
  323. $(eval $(call BuildPackage,boost-serialization))
  324. $(eval $(call BuildPackage,boost-signals))
  325. $(eval $(call BuildPackage,boost-system))
  326. $(eval $(call BuildPackage,boost-test))
  327. $(eval $(call BuildPackage,boost-thread))
  328. $(eval $(call BuildPackage,boost-timer))
  329. $(eval $(call BuildPackage,boost-wave))