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.

476 lines
12 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. include $(INCLUDE_DIR)/nls.mk
  13. include $(INCLUDE_DIR)/target.mk
  14. PKG_NAME:=boost
  15. PKG_VERSION:=1_57_0
  16. PKG_RELEASE:=2
  17. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
  18. PKG_SOURCE_URL:=@SF/boost
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
  20. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_VERSION)
  21. PKG_MD5SUM:=25f9a8ac28beeb5ab84aa98510305299
  22. PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
  23. PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com> (Modified from Mirko Vogt <mirko@openwrt.org> Boost 1.51 Original Makefile and patches)
  24. PKG_BUILD_DEPENDS += boost/host
  25. PKG_BUILD_PARALLEL:=0
  26. PKG_USE_MIPS16:=0
  27. PKG_CONFIG_DEPENDS := \
  28. CONFIG_PACKAGE_boost-date_time \
  29. CONFIG_PACKAGE_boost-filesystem \
  30. CONFIG_PACKAGE_boost-graph \
  31. CONFIG_PACKAGE_boost-iostreams \
  32. CONFIG_PACKAGE_boost-math \
  33. CONFIG_PACKAGE_boost-program_options \
  34. CONFIG_PACKAGE_boost-python \
  35. CONFIG_PACKAGE_boost-regex \
  36. CONFIG_PACKAGE_boost-serialization \
  37. CONFIG_PACKAGE_boost-signals \
  38. CONFIG_PACKAGE_boost-system \
  39. CONFIG_PACKAGE_boost-test \
  40. CONFIG_PACKAGE_boost-thread \
  41. CONFIG_PACKAGE_boost-wave \
  42. CONFIG_PACKAGE_boost-atomic \
  43. CONFIG_PACKAGE_boost-context \
  44. CONFIG_PACKAGE_boost-container \
  45. CONFIG_PACKAGE_boost-coroutine \
  46. CONFIG_PACKAGE_boost-log \
  47. include $(INCLUDE_DIR)/package.mk
  48. include $(INCLUDE_DIR)/host-build.mk
  49. define Package/boost/Default
  50. SECTION:=libs
  51. CATEGORY:=Libraries
  52. TITLE:=Boost C++ source libraries
  53. URL:=http://www.boost.org
  54. DEPENDS:=+libstdcpp +libpthread +librt
  55. endef
  56. define Package/boost/Default/description
  57. Boost provides free peer-reviewed portable C++ source libraries
  58. endef
  59. define Package/boost-atomic
  60. $(call Package/boost/Default)
  61. TITLE+= (atomic)
  62. DEPENDS+= +boost-system
  63. endef
  64. define Package/boost-chrono
  65. $(call Package/boost/Default)
  66. TITLE+= (chrono)
  67. DEPENDS+= +boost-system
  68. endef
  69. define Package/boost-date_time
  70. $(call Package/boost/Default)
  71. TITLE+= (date_time)
  72. endef
  73. define Package/boost-exception
  74. $(call Package/boost/Default)
  75. TITLE+= (exception)
  76. endef
  77. define Package/boost-filesystem
  78. $(call Package/boost/Default)
  79. TITLE+= (filesystem)
  80. DEPENDS+= +boost-system
  81. endef
  82. define Package/boost-graph
  83. $(call Package/boost/Default)
  84. TITLE+= (graph)
  85. DEPENDS+= +boost-regex
  86. endef
  87. define Package/boost-graph_parallel
  88. $(call Package/boost/Default)
  89. TITLE+= (graph_parallel)
  90. endef
  91. define Package/boost-iostreams
  92. $(call Package/boost/Default)
  93. TITLE+= (iostreams)
  94. DEPENDS+= +zlib
  95. endef
  96. define Package/boost-locale
  97. $(call Package/boost/Default)
  98. TITLE+= (locale)
  99. DEPENDS+= $(ICONV_DEPENDS)
  100. endef
  101. define Package/boost-math
  102. $(call Package/boost/Default)
  103. TITLE+= (math)
  104. endef
  105. define Package/boost-mpi
  106. $(call Package/boost/Default)
  107. TITLE+= (mpi)
  108. endef
  109. define Package/boost-program_options
  110. $(call Package/boost/Default)
  111. TITLE+= (program_options)
  112. endef
  113. define Package/boost-python
  114. $(call Package/boost/Default)
  115. TITLE+= (python)
  116. DEPENDS+= +PACKAGE_boost-python:python
  117. endef
  118. define Package/boost-random
  119. $(call Package/boost/Default)
  120. TITLE+= (random)
  121. DEPENDS+= +boost-system
  122. endef
  123. define Package/boost-regex
  124. $(call Package/boost/Default)
  125. TITLE+= (regex)
  126. endef
  127. define Package/boost-serialization
  128. $(call Package/boost/Default)
  129. TITLE+= (serialization)
  130. endef
  131. define Package/boost-signals
  132. $(call Package/boost/Default)
  133. TITLE+= (signals)
  134. endef
  135. define Package/boost-system
  136. $(call Package/boost/Default)
  137. TITLE+= (system)
  138. endef
  139. define Package/boost-test
  140. $(call Package/boost/Default)
  141. TITLE+= (test)
  142. endef
  143. define Package/boost-thread
  144. $(call Package/boost/Default)
  145. TITLE+= (thread)
  146. DEPENDS+= +boost-system +boost-chrono +boost-atomic
  147. endef
  148. define Package/boost-timer
  149. $(call Package/boost/Default)
  150. TITLE+= (timer)
  151. DEPENDS+= boost-chrono
  152. endef
  153. define Package/boost-wave
  154. $(call Package/boost/Default)
  155. TITLE+= (wave)
  156. DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
  157. endef
  158. define Package/boost-context
  159. $(call Package/boost/Default)
  160. TITLE+= (context)
  161. endef
  162. define Package/boost-container
  163. $(call Package/boost/Default)
  164. TITLE+= (container)
  165. endef
  166. define Package/boost-coroutine
  167. $(call Package/boost/Default)
  168. TITLE+= (coroutine)
  169. DEPENDS+= +boost-system +boost-chrono +boost-context +boost-thread
  170. endef
  171. define Package/boost-log
  172. $(call Package/boost/Default)
  173. TITLE+= (log)
  174. DEPENDS+= +boost-system +boost-chrono +boost-date_time +boost-thread +boost-filesystem +boost-regex
  175. endef
  176. define Package/boost
  177. $(call Package/boost/Default)
  178. TITLE+= (header-only)
  179. BUILDONLY:=1
  180. endef
  181. define Build/Configure
  182. endef
  183. define Host/Compile
  184. # bjam does not provide a configure-script nor a Makefile
  185. ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
  186. endef
  187. CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
  188. TARGET_LDFLAGS += -pthread -lrt
  189. ifneq ($(findstring mips,$(ARCH)),)
  190. ifeq ($(ARCH),mips64)
  191. BOOST_ABI = 64
  192. else ifeq ($(ARCH),octeon)
  193. BOOST_ABI = 64
  194. else
  195. BOOST_ABI = o32
  196. endif
  197. else ifeq ($(ARCH),arm)
  198. BOOST_ABI = aapcs
  199. else
  200. BOOST_ABI = sysv
  201. endif
  202. define Build/Compile
  203. echo "Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE)";
  204. ( cd $(PKG_BUILD_DIR) ; \
  205. echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
  206. $(if $(CONFIG_PACKAGE_boost-python), \
  207. echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \
  208. tools/build/src/user-config.jam; \
  209. ) \
  210. bjam \
  211. '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
  212. --toolset=gcc-$(ARCH) --build-type=minimal --layout=system abi=$(BOOST_ABI) \
  213. --disable-long-double \
  214. $(CONFIGURE_ARGS) \
  215. $(if $(CONFIG_PACKAGE_boost-atomic),,--without-atomic) \
  216. $(if $(CONFIG_PACKAGE_boost-chrono),,--without-chrono) \
  217. $(if $(CONFIG_PACKAGE_boost-date_time),,--without-date_time) \
  218. $(if $(CONFIG_PACKAGE_boost-exception),,--without-exception) \
  219. $(if $(CONFIG_PACKAGE_boost-filesystem),,--without-filesystem) \
  220. $(if $(CONFIG_PACKAGE_boost-graph),,--without-graph) \
  221. $(if $(CONFIG_PACKAGE_boost-graph_parallel),,--without-graph_parallel) \
  222. $(if $(CONFIG_PACKAGE_boost-iostreams),,--without-iostreams) \
  223. $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_UCLIBC),on,off), \
  224. --without-locale boost.locale.iconv=off) \
  225. $(if $(CONFIG_PACKAGE_boost-math),,--without-math) \
  226. $(if $(CONFIG_PACKAGE_boost-mpi),,--without-mpi) \
  227. $(if $(CONFIG_PACKAGE_boost-program_options),,--without-program_options) \
  228. $(if $(CONFIG_PACKAGE_boost-python),,--without-python) \
  229. $(if $(CONFIG_PACKAGE_boost-random),,--without-random) \
  230. $(if $(CONFIG_PACKAGE_boost-regex),,--without-regex) \
  231. $(if $(CONFIG_PACKAGE_boost-serialization),,--without-serialization) \
  232. $(if $(CONFIG_PACKAGE_boost-signals),,--without-signals) \
  233. $(if $(CONFIG_PACKAGE_boost-system),,--without-system) \
  234. $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
  235. $(if $(CONFIG_PACKAGE_boost-thread),,--without-thread) \
  236. $(if $(CONFIG_PACKAGE_boost-timer),,--without-timer) \
  237. $(if $(CONFIG_PACKAGE_boost-wave),,--without-wave) \
  238. $(if $(CONFIG_PACKAGE_boost-context),,--without-context) \
  239. $(if $(CONFIG_PACKAGE_boost-container),,--without-container) \
  240. $(if $(CONFIG_PACKAGE_boost-coroutine),,--without-coroutine) \
  241. $(if $(CONFIG_PACKAGE_boost-log),,--without-log) \
  242. \
  243. $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
  244. -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
  245. install \
  246. )
  247. endef
  248. define Build/InstallDev
  249. $(INSTALL_DIR) \
  250. $(1)/usr/include/boost/
  251. $(CP) \
  252. $(PKG_INSTALL_DIR)/include/boost/* \
  253. $(1)/usr/include/boost/ \
  254. # copies _all_ header files - independent of <--with-library>-argument above
  255. if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
  256. $(INSTALL_DIR) \
  257. $(1)/usr/lib; \
  258. $(CP) \
  259. $(PKG_INSTALL_DIR)/lib/*.a \
  260. $(1)/usr/lib/; \
  261. $(CP) \
  262. $(PKG_INSTALL_DIR)/lib/*.so* \
  263. $(1)/usr/lib/; \
  264. fi
  265. endef
  266. define Host/Install
  267. $(INSTALL_DIR) \
  268. $(STAGING_DIR_HOST)/bin
  269. $(CP) \
  270. $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/bjam \
  271. $(STAGING_DIR_HOST)/bin/
  272. endef
  273. define Package/boost/Default/install
  274. $(INSTALL_DIR) \
  275. $(1)/usr/lib
  276. $(CP) \
  277. $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
  278. $(1)/usr/lib/
  279. endef
  280. define Package/boost-atomic/install
  281. $(call Package/boost/Default/install,$(1),atomic)
  282. endef
  283. define Package/boost-chrono/install
  284. $(call Package/boost/Default/install,$(1),chrono)
  285. endef
  286. define Package/boost-date_time/install
  287. $(call Package/boost/Default/install,$(1),date_time)
  288. endef
  289. define Package/boost-exception/install
  290. $(call Package/boost/Default/install,$(1),exception)
  291. endef
  292. define Package/boost-filesystem/install
  293. $(call Package/boost/Default/install,$(1),filesystem)
  294. endef
  295. define Package/boost-graph/install
  296. $(call Package/boost/Default/install,$(1),graph)
  297. endef
  298. define Package/boost-graph_parallel/install
  299. $(call Package/boost/Default/install,$(1),graph_parallel)
  300. endef
  301. define Package/boost-iostreams/install
  302. $(call Package/boost/Default/install,$(1),iostreams)
  303. endef
  304. define Package/boost-math/install
  305. $(call Package/boost/Default/install,$(1),math)
  306. endef
  307. define Package/boost-mpi/install
  308. $(call Package/boost/Default/install,$(1),mpi)
  309. endef
  310. define Package/boost-program_options/install
  311. $(call Package/boost/Default/install,$(1),program_options)
  312. endef
  313. define Package/boost-python/install
  314. $(call Package/boost/Default/install,$(1),python)
  315. endef
  316. define Package/boost-random/install
  317. $(call Package/boost/Default/install,$(1),random)
  318. endef
  319. define Package/boost-regex/install
  320. $(call Package/boost/Default/install,$(1),regex)
  321. endef
  322. define Package/boost-serialization/install
  323. $(call Package/boost/Default/install,$(1),serialization)
  324. endef
  325. define Package/boost-signals/install
  326. $(call Package/boost/Default/install,$(1),signals)
  327. endef
  328. define Package/boost-system/install
  329. $(call Package/boost/Default/install,$(1),system)
  330. endef
  331. define Package/boost-test/install
  332. $(INSTALL_DIR) \
  333. $(1)/usr/lib
  334. $(CP) \
  335. $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
  336. $(1)/usr/lib/
  337. $(CP) \
  338. $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
  339. $(1)/usr/lib/
  340. endef
  341. define Package/boost-thread/install
  342. $(call Package/boost/Default/install,$(1),thread)
  343. endef
  344. define Package/boost-timer/install
  345. $(call Package/boost/Default/install,$(1),timer)
  346. endef
  347. define Package/boost-wave/install
  348. $(call Package/boost/Default/install,$(1),wave)
  349. endef
  350. define Package/boost-context/install
  351. $(call Package/boost/Default/install,$(1),context)
  352. endef
  353. define Package/boost-container/install
  354. $(call Package/boost/Default/install,$(1),container)
  355. endef
  356. define Package/boost-coroutine/install
  357. $(call Package/boost/Default/install,$(1),coroutine)
  358. endef
  359. define Package/boost-log/install
  360. $(call Package/boost/Default/install,$(1),log)
  361. endef
  362. $(eval $(call HostBuild))
  363. $(eval $(call BuildPackage,boost))
  364. $(eval $(call BuildPackage,boost-atomic))
  365. $(eval $(call BuildPackage,boost-chrono))
  366. $(eval $(call BuildPackage,boost-date_time))
  367. #$(eval $(call BuildPackage,boost-exception))
  368. $(eval $(call BuildPackage,boost-filesystem))
  369. $(eval $(call BuildPackage,boost-graph))
  370. #$(eval $(call BuildPackage,boost-graph_parallel))
  371. $(eval $(call BuildPackage,boost-iostreams))
  372. $(eval $(call BuildPackage,boost-locale))
  373. $(eval $(call BuildPackage,boost-math))
  374. #$(eval $(call BuildPackage,boost-mpi))
  375. $(eval $(call BuildPackage,boost-program_options))
  376. $(eval $(call BuildPackage,boost-random))
  377. $(eval $(call BuildPackage,boost-python))
  378. $(eval $(call BuildPackage,boost-regex))
  379. $(eval $(call BuildPackage,boost-serialization))
  380. $(eval $(call BuildPackage,boost-signals))
  381. $(eval $(call BuildPackage,boost-system))
  382. $(eval $(call BuildPackage,boost-test))
  383. $(eval $(call BuildPackage,boost-thread))
  384. $(eval $(call BuildPackage,boost-timer))
  385. $(eval $(call BuildPackage,boost-wave))
  386. $(eval $(call BuildPackage,boost-context))
  387. $(eval $(call BuildPackage,boost-container))
  388. $(eval $(call BuildPackage,boost-coroutine))
  389. $(eval $(call BuildPackage,boost-log))