2 # Copyright (C) 2015-2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 # Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
10 # Dude, this "boost" is really one of the most crude stuff I ported yet.
14 include $(TOPDIR
)/rules.mk
15 include $(INCLUDE_DIR
)/nls.mk
16 include $(INCLUDE_DIR
)/target.mk
20 PKG_SOURCE_VERSION
:=1_63_0
23 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
).
tar.bz2
24 PKG_SOURCE_URL
:=https
://sourceforge.net
/projects
/boost
/files
/boost
/$(PKG_VERSION
)
25 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
26 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
27 PKG_MD5SUM
:=beae2529f759f6b3bf3f4969a19c2e9d6f0c503edcb2de4a61d1428519fcb3b0
28 PKG_LICENSE
:=Boost Software License
<http
://www.boost.org
/users
/license.html
>
29 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
34 include $(INCLUDE_DIR
)/package.mk
35 include $(INCLUDE_DIR
)/host-build.mk
38 define Package
/boost
/Default
41 TITLE
:=Boost C
++ source library
42 URL
:=http
://www.boost.org
43 DEPENDS
:=+libstdcpp
+libpthread
+librt
46 define Package
/boost
/description
47 This package provides the Boost v1.63 libraries.
48 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
50 -----------------------------------------------------------------------------
52 | In order to build
all of the Boost Libraries
, it is necessary |
53 | to use
, at least
, GCC version
5 (C
++14 support
) and
, it is necessary to |
54 | compile the kernel with Full Language Support. |
55 | Without these requirerements
, the following libs will not be available
: |
57 |
- Boost.Coroutine2 |
59 | Also
, due to hardware contraints
, the following libs and those that are |
60 | dependent
, are disabled for some Targets. |
62 |
- Disabled for
-> avr32
, octeon and netlogic. |
64 |
- Disabled for
-> ar7
, rb532
, brcm63xx.smp
, brcm63xx
, brcm47xx
, |
65 | brcm47xx.legacy
, brcm2708_bcm2708
, au1000
, ath25
, |
66 | adm8668 and adm5120. |
67 -----------------------------------------------------------------------------
69 This package provides the following run-time libraries
:
74 - coroutine
(Deprecated
- use Coroutine2
)
75 - - coroutine2
(Requires GCC v5 or newer
)
79 - fiber
(Requires GCC v5 or newer
)
83 - locale
(Requires kernel being compiled with full language support
)
98 There are many more header-only libraries supported by Boost.
99 See more at http
://www.boost.org
/doc
/libs
/1_63_0
/
102 PKG_BUILD_DEPENDS
:=boost
/host PACKAGE_python
:python PACKAGE_python3
:python3
106 define Package
/boost-libs
107 $(call Package
/boost
/Default
)
109 DEPENDS
+= $(BOOST_DEPENDS
)
113 define Package
/boost-libs
/description
114 This meta package contains only dependencies to the other libraries from
115 the boost libraries collection.
118 # Create a meta-package of dependent libraries (for ALL)
119 define Package
/boost-libs
/install
123 define Package
/boost
/install
128 $(call Package
/boost
/Default
)
132 define Package
/boost
/config
133 menu
"Select Boost Options"
134 depends on PACKAGE_boost
135 comment
"Boost compilation options."
138 prompt
"Compile Boost libraries."
139 default boost-static-and-shared-libs
141 Choose which version to compile.
143 - Only Shared libs will be compiled.
145 - Only Static libs will be compiled.
147 - Both Static and Shared libs will be compiled.
149 config boost-shared-libs
152 config boost-static-libs
155 config boost-static-and-shared-libs
160 prompt
"Selects Boost Runtime linkage."
161 default boost-runtime-shared
163 Choose which C and C
++ runtimes to use
:
164 -> Use Shared runtimes.
165 -> Use Static runtimes.
166 - Not available if Shared libs are to be built.
167 -> Use both runtimes.
168 - Not available if Shared libs are to be built.
169 - Two separate versions of Boost are built
, linking each to a different runtime.
170 - This option requires
"Use tagged names" option to be active.
172 config boost-runtime-shared
175 config boost-runtime-static
176 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
179 config boost-runtime-static-and-shared
180 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
185 prompt
"Select a Variant."
186 default boost-variant-release
188 Chooses which boost variant should be selected
:
189 -> Release
: Optimizes Boost for release.
190 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
192 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
194 - Profiling
: On
; Debug Symbols
: On.
196 config boost-variant-release
199 config boost-variant-debug
202 config boost-variant-profile
206 config boost-use-name-tags
207 bool
"Use tagged names."
209 Add name
tags the lib files
, to diferentiate each library version
:
210 "-mt" for multi-threading.
212 "-s" for runtime static link
".
213 Might break compatibility with libraries that expect boost libs with default names.
216 config boost-single-thread
217 depends on @boost-use-name-tags
218 bool "Single thread Support.
"
220 Compile Boost libraries in single-thread mode.
223 config boost-build-type-complete
224 depends on @boost-use-name-tags
225 bool "Complete Boost Build.
"
227 Builds both release and debug libs. It will take much longer to compile.
231 menu "Select Boost libraries
"
232 depends on PACKAGE_boost
235 config boost-libs-all
236 bool "Include
all Boost libraries.
"
238 select PACKAGE_boost-container
239 select PACKAGE_boost-date_time
240 select PACKAGE_boost-iostreams
241 select PACKAGE_boost-math
242 select PACKAGE_boost-program_options
243 select PACKAGE_boost-serialization
244 select PACKAGE_boost-signals
245 select PACKAGE_boost-regex
246 select PACKAGE_boost-graph if PACKAGE_boost-regex
247 select PACKAGE_boost-system
248 select PACKAGE_boost-atomic if PACKAGE_boost-system
249 select PACKAGE_boost-chrono if PACKAGE_boost-system
250 select PACKAGE_boost-random if PACKAGE_boost-system
251 select PACKAGE_boost-filesystem if PACKAGE_boost-system
252 select PACKAGE_boost-locale if PACKAGE_boost-system
253 select PACKAGE_boost-timer if PACKAGE_boost-chrono
254 select PACKAGE_boost-thread if PACKAGE_boost-chrono&&PACKAGE_boost-atomic
255 select PACKAGE_boost-context if PACKAGE_boost-chrono&&PACKAGE_boost-thread
256 select PACKAGE_boost-coroutine if PACKAGE_boost-context
257 select PACKAGE_boost-fiber if boost-coroutine2
258 select PACKAGE_boost-log if PACKAGE_boost-chrono&&PACKAGE_boost-date_time&&PACKAGE_boost-thread&&PACKAGE_boost-filesystem&&PACKAGE_boost-regex
259 select PACKAGE_boost-wave if PACKAGE_boost-date_time&&PACKAGE_boost-thread&&PACKAGE_boost-filesystem
260 select PACKAGE_boost-python
261 select PACKAGE_boost-python3
262 select boost-test-pkg if PACKAGE_boost-system&&PACKAGE_boost-timer
263 select boost-coroutine2 if PACKAGE_boost-coroutine
264 select boost-graph-parallel if PACKAGE_boost-graph
267 config boost-test-pkg
268 depends on PACKAGE_boost-system&&PACKAGE_boost-timer
269 bool "Boost
test package.
"
271 select PACKAGE_boost-test
273 config boost-coroutine2
274 depends on !@GCC_VERSION_4_8&&PACKAGE_boost-coroutine
275 bool "Boost couroutine2 support.
"
278 config boost-graph-parallel
279 depends on PACKAGE_boost-graph
280 bool "Boost parallel graph support.
"
283 $(foreach lib,$(BOOST_LIBS), \
284 config PACKAGE_boost-$(lib)
285 prompt "Boost
$(lib
) library.
"
287 $(if $(findstring graph,$(lib)),depends on PACKAGE_boost-regex,)\
288 $(if $(findstring atomic,$(lib)),depends on PACKAGE_boost-system,)\
289 $(if $(findstring chrono,$(lib)),depends on PACKAGE_boost-system,)\
290 $(if $(findstring random,$(lib)),depends on PACKAGE_boost-system,)\
291 $(if $(findstring filesystem,$(lib)),depends on PACKAGE_boost-system,)\
292 $(if $(findstring locale,$(lib)),depends on PACKAGE_boost-system&&BUILD_NLS,)\
293 $(if $(findstring timer,$(lib)),depends on PACKAGE_boost-chrono,)\
294 $(if $(findstring thread,$(lib)),depends on PACKAGE_boost-chrono&&PACKAGE_boost-atomic,)\
295 $(if $(findstring context,$(lib)),depends on PACKAGE_boost-chrono&&PACKAGE_boost-thread&&@(!TARGET_avr32&&!TARGET_octeon&&!TARGET_netlogic),)\
296 $(if $(findstring coroutine,$(lib)),depends on PACKAGE_boost-context,)\
297 $(if $(findstring fiber,$(lib)),depends on @boost-coroutine2&&@(!TARGET_ar7&&!TARGET_rb532&&!TARGET_brcm63xx_smp&&!TARGET_brcm63xx&&!TARGET_brcm47xx&&!TARGET_brcm47xx_legacy&&!TARGET_brcm2708_bcm2708&&!TARGET_au1000&&!TARGET_ath25&&!TARGET_adm8668&&!TARGET_adm5120),)\
298 $(if $(findstring log,$(lib)),depends on PACKAGE_boost-chrono&&PACKAGE_boost-date_time&&PACKAGE_boost-thread&&PACKAGE_boost-filesystem&&PACKAGE_boost-regex,)\
299 $(if $(findstring wave,$(lib)),depends on PACKAGE_boost-date_time&&PACKAGE_boost-thread&&PACKAGE_boost-filesystem,)\
300 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)
306 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
308 define Package/boost-test
309 $(call Package/boost/Default)
314 define Build/Configure
318 # 2: dependencies on other boost libraries (short name) - Deprecated
319 # 3: dependencies on other packages
320 # 4: conditional/inward dependencies
321 define DefineBoostLibrary
323 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
324 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
328 define Package/boost-$(1)
329 $(call Package/boost/Default)
331 DEPENDS+= $(3) $(if $(4),@$(4),)
335 define Package/boost-$(1)/description
336 This package contains the Boost $(1) library.
341 ## If you are thinking in making changes to the following list, for some reason, the order of what follows matters.
342 $(eval $(call DefineBoostLibrary,container,,,))
343 $(eval $(call DefineBoostLibrary,date_time,,,))
344 $(eval $(call DefineBoostLibrary,iostreams,,+zlib,))
345 $(eval $(call DefineBoostLibrary,math,,,))
346 $(eval $(call DefineBoostLibrary,program_options,,,))
347 $(eval $(call DefineBoostLibrary,serialization,,,))
348 $(eval $(call DefineBoostLibrary,signals,,,))
350 $(eval $(call DefineBoostLibrary,regex,,,))
351 $(eval $(call DefineBoostLibrary,graph,,,))
353 $(eval $(call DefineBoostLibrary,system,,,))
354 $(eval $(call DefineBoostLibrary,atomic,,,))
355 $(eval $(call DefineBoostLibrary,chrono,,,))
356 $(eval $(call DefineBoostLibrary,random,,,))
357 $(eval $(call DefineBoostLibrary,filesystem,,,))
358 $(eval $(call DefineBoostLibrary,locale,,$(ICONV_DEPENDS),BUILD_NLS))
359 $(eval $(call DefineBoostLibrary,timer,,,))
360 $(eval $(call DefineBoostLibrary,thread,,,))
361 $(eval $(call DefineBoostLibrary,context,,,))
362 $(eval $(call DefineBoostLibrary,coroutine,,,))
363 $(eval $(call DefineBoostLibrary,fiber,,,))
364 $(eval $(call DefineBoostLibrary,log,,,))
365 $(eval $(call DefineBoostLibrary,wave,,,))
366 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
367 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
369 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
370 #$(eval $(call DefineBoostLibrary,exception,,))
374 # b2 does not provide a configure-script nor a Makefile
375 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
378 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
379 TARGET_LDFLAGS += -pthread -lrt
382 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
384 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
386 ifneq ($(findstring mips,$(ARCH)),)
388 ifneq ($(findstring 64,$(ARCH)),)
391 else ifneq ($(findstring arm,$(ARCH)),)
393 else ifeq ($(ARCH),aarch64)
403 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
404 ( cd $(PKG_BUILD_DIR) ; \
405 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > tools/build/src/user-config.jam ; \
406 $(if $(CONFIG_PACKAGE_boost-python3), \
407 echo "using python
: 3.6 : : $(STAGING_DIR
)/usr
/include/python3.6
/ ;" >> \
408 tools/build/src/user-config.jam; \
410 $(if $(CONFIG_PACKAGE_boost-python), \
411 echo "using python
: 2.7 : : $(STAGING_DIR
)/usr
/include/python2.7
/ ;" >> \
412 tools/build/src/user-config.jam; \
416 --ignore-site-config \
417 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
418 --disable-long-double \
419 $(if $(CONFIG_boost-variant-release), variant=release,) \
420 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
421 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
422 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
423 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
424 $(if $(CONFIG_boost-shared-libs),link=shared,) \
425 $(if $(CONFIG_boost-static-libs),link=static,) \
426 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
427 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
428 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
429 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
430 $(if $(CONFIG_boost-single-thread),threading=single,) \
433 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
434 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
435 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
436 $(foreach lib,$(BOOST_LIBS), \
437 $(if $(findstring python,$(lib)), \
438 $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
439 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
441 $(if $(CONFIG_PACKAGE_boost-python),python=2.7,) \
442 $(if $(CONFIG_PACKAGE_boost-python3),python=3.6,) \
443 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
444 boost.locale.iconv=off) \
446 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
447 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
452 define Build/InstallDev
454 $(1)/usr/include/boost/
457 $(PKG_INSTALL_DIR)/include/boost/* \
458 $(1)/usr/include/boost/ \
459 # copies _all_ header files - independent of <--with-library>-argument above
461 $(INSTALL_DIR) $(1)/usr/lib
462 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
463 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
468 $(STAGING_DIR_HOSTPKG)/bin
471 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
472 $(STAGING_DIR_HOSTPKG)/bin/
475 define Package/boost/Default/install
480 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2).so*' -exec $(CP) {} $(1)/usr/lib/ \;
482 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)_*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
485 define Package/boost-test/install
490 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
493 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
496 define BuildBoostLibrary
497 define Package/boost-$(1)/install
498 $(call Package/boost/Default/install,$$(1),$(1))
501 $$(eval $$(call BuildPackage,boost-$(1)))
504 $(eval $(call HostBuild))
506 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
507 $(eval $(call BuildPackage,boost-test))
508 $(eval $(call BuildPackage,boost-libs))
509 $(eval $(call BuildPackage,boost))