2 # Copyright (C) 2015-2018 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_67_0
23 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
).
tar.bz2
24 PKG_SOURCE_URL
:=@SF
/$(PKG_NAME
)/$(PKG_NAME
)/$(PKG_VERSION
) https
://dl.bintray.com
/boostorg
/release
/$(PKG_VERSION
)/source
/
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_HASH
:=2684c972994ee57fc5632e03bf044746f6eb45d4920c343937a465fd67a5adba
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.67
.0 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
(header-only library
- requires C
++11) |
58 |
- Boost.Fiber
(requires C
++14) |
59 -----------------------------------------------------------------------------
61 This package provides the following run-time libraries
:
66 - contract
(new in
1.67.0)
67 - coroutine
(Deprecated
- use Coroutine2
)
68 - - coroutine2
(Requires GCC v5 and up
)
72 - fiber
(Requires GCC v5 and up
)
76 - locale
(Requires kernel being compiled with full language support
)
84 - serialization and wserialization
93 There are many more header-only libraries supported by Boost.
94 See more at http
://www.boost.org
/doc
/libs
/1_67_0
/
97 PKG_BUILD_DEPENDS
:=boost
/host PACKAGE_python
:python PACKAGE_python3
:python3
101 define Package
/boost-libs
102 $(call Package
/boost
/Default
)
104 DEPENDS
+= $(BOOST_DEPENDS
)
108 define Package
/boost-libs
/description
109 This meta package contains only dependencies to the other libraries from
110 the boost libraries collection.
113 # Create a meta-package of dependent libraries (for ALL)
114 define Package
/boost-libs
/install
118 define Package
/boost
/install
123 $(call Package
/boost
/Default
)
127 define Package
/boost
/config
128 menu
"Select Boost Options"
129 depends on PACKAGE_boost
130 comment
"Boost compilation options."
133 prompt
"Compile Boost libraries."
134 default boost-static-and-shared-libs
136 Choose which version to compile.
138 - Only Shared libs will be compiled.
140 - Only Static libs will be compiled.
142 - Both Static and Shared libs will be compiled.
144 config boost-shared-libs
147 config boost-static-libs
150 config boost-static-and-shared-libs
155 prompt
"Selects Boost Runtime linkage."
156 default boost-runtime-shared
158 Choose which C and C
++ runtimes to use
:
159 -> Use Shared runtimes.
160 -> Use Static runtimes.
161 - Not available if Shared libs are to be built.
162 -> Use both runtimes.
163 - Not available if Shared libs are to be built.
164 - Two separate versions of Boost are built
, linking each to a different runtime.
165 - This option requires
"Use tagged names" option to be active.
167 config boost-runtime-shared
170 config boost-runtime-static
171 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
174 config boost-runtime-static-and-shared
175 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
180 prompt
"Select a Variant."
181 default boost-variant-release
183 Chooses which boost variant should be selected
:
184 -> Release
: Optimizes Boost for release.
185 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
187 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
189 - Profiling
: On
; Debug Symbols
: On.
191 config boost-variant-release
194 config boost-variant-debug
197 config boost-variant-profile
201 config boost-use-name-tags
202 bool
"Use tagged names."
204 Add name
tags the lib files
, to diferentiate each library version
:
205 "-mt" for multi-threading.
207 "-s" for runtime static link
".
208 Might break compatibility with libraries that expect boost libs with default names.
211 config boost-single-thread
212 depends on @boost-use-name-tags
213 bool "Single thread Support.
"
215 Compile Boost libraries in single-thread mode.
218 config boost-build-type-complete
219 depends on @boost-use-name-tags
220 bool "Complete Boost Build.
"
222 Builds both release and debug libs. It will take much longer to compile.
226 menu "Select Boost libraries
"
227 depends on PACKAGE_boost
230 config boost-libs-all
231 bool "Include
all Boost libraries.
"
233 select PACKAGE_boost-libs
234 select boost-test-pkg
235 select boost-coroutine2
236 select boost-graph-parallel
238 config boost-test-pkg
239 bool "Boost
test package.
"
241 select PACKAGE_boost-test
243 config boost-coroutine2
244 depends on !@GCC_VERSION_4_8
245 bool "Boost couroutine2 support.
"
246 select PACKAGE_boost-coroutine
249 config boost-graph-parallel
250 bool "Boost parallel graph support.
"
251 select PACKAGE_boost-graph
254 $(foreach lib,$(BOOST_LIBS), \
255 config PACKAGE_boost-$(lib)
256 prompt "Boost
$(lib
) library.
"
258 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
259 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)
266 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
268 define Package/boost-test
269 $(call Package/boost/Default)
272 DEPENDS+=+boost-system +boost-timer
275 define Build/Configure
279 # 2: dependencies on other boost libraries (short name)
280 # 3: dependencies on other packages
281 # 4: conditional/inward dependencies
282 define DefineBoostLibrary
284 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
285 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
289 define Package/boost-$(1)
290 $(call Package/boost/Default)
292 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
296 define Package/boost-$(1)/description
297 This package contains the Boost $(1) library.
301 $(eval $(call DefineBoostLibrary,atomic,system,))
302 $(eval $(call DefineBoostLibrary,chrono,system,))
303 $(eval $(call DefineBoostLibrary,container,,))
304 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
305 $(eval $(call DefineBoostLibrary,contract,system,))
306 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
307 $(eval $(call DefineBoostLibrary,date_time,,))
308 #$(eval $(call DefineBoostLibrary,exception,,))
309 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,))
310 $(eval $(call DefineBoostLibrary,filesystem,system,))
311 $(eval $(call DefineBoostLibrary,graph,regex,))
312 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2))
313 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
314 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
315 $(eval $(call DefineBoostLibrary,math,,))
316 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
317 $(eval $(call DefineBoostLibrary,program_options,,))
318 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
319 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
320 $(eval $(call DefineBoostLibrary,random,system,))
321 $(eval $(call DefineBoostLibrary,regex,,))
322 $(eval $(call DefineBoostLibrary,serialization,,))
323 $(eval $(call DefineBoostLibrary,wserialization,serialization,))
324 $(eval $(call DefineBoostLibrary,signals,,))
325 $(eval $(call DefineBoostLibrary,stacktrace,,))
326 $(eval $(call DefineBoostLibrary,system,,))
327 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
328 $(eval $(call DefineBoostLibrary,timer,chrono))
329 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
330 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
334 # b2 does not provide a configure-script nor a Makefile
335 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
338 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
339 TARGET_LDFLAGS += -pthread -lrt
342 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
343 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.6/) \
344 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
346 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
348 ifneq ($(findstring mips,$(ARCH)),)
350 ifneq ($(findstring 64,$(ARCH)),)
353 else ifneq ($(findstring arm,$(ARCH)),)
355 else ifeq ($(ARCH),aarch64)
364 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
365 ( cd $(PKG_BUILD_DIR) ; \
366 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 ; \
367 $(if $(CONFIG_PACKAGE_boost-python3), \
368 echo "using python
: 3.6 : : $(STAGING_DIR
)/usr
/include/python3.6
/ : $(STAGING_DIR
)/usr
/lib
/libpython3.6.so
;" >> \
369 tools/build/src/user-config.jam; \
371 $(if $(CONFIG_PACKAGE_boost-python), \
372 echo "using python
: 2.7 : : $(STAGING_DIR
)/usr
/include/python2.7
/ : $(STAGING_DIR
)/usr
/lib
/libpython2.7.so
;" >> \
373 tools/build/src/user-config.jam; \
377 --ignore-site-config \
378 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
379 --disable-long-double \
380 $(if $(CONFIG_boost-variant-release), variant=release,) \
381 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
382 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
383 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
384 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
385 $(if $(CONFIG_boost-shared-libs),link=shared,) \
386 $(if $(CONFIG_boost-static-libs),link=static,) \
387 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
388 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
389 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
390 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
391 $(if $(CONFIG_boost-single-thread),threading=single,) \
394 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
395 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
396 $(foreach lib,$(BOOST_LIBS), \
397 $(if $(findstring python,$(lib)), \
398 $(if $(CONFIG_PACKAGE_boost-python),python=2.7,--without-python), \
399 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
400 $(if $(findstring $(lib),wserialization),,--without-$(lib)) \
404 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
405 boost.locale.iconv=off) \
407 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
408 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
410 $(if $(CONFIG_PACKAGE_boost-python3), \
413 --ignore-site-config \
414 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
415 --disable-long-double \
416 $(if $(CONFIG_boost-variant-release), variant=release,) \
417 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
418 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
419 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
420 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
421 $(if $(CONFIG_boost-shared-libs),link=shared,) \
422 $(if $(CONFIG_boost-static-libs),link=static,) \
423 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
424 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
425 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
426 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
427 $(if $(CONFIG_boost-single-thread),threading=single,) \
429 $(foreach lib,$(BOOST_LIBS), \
430 $(if $(findstring python,$(lib)), \
431 $(if $(CONFIG_PACKAGE_boost-python3),python=3.6,), \
439 define Build/InstallDev
441 $(1)/usr/include/boost/
444 $(PKG_INSTALL_DIR)/include/boost/* \
445 $(1)/usr/include/boost/ \
446 # copies _all_ header files - independent of <--with-library>-argument above
448 $(INSTALL_DIR) $(1)/usr/lib
449 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
450 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
455 $(STAGING_DIR_HOSTPKG)/bin
458 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
459 $(STAGING_DIR_HOSTPKG)/bin/
462 define Package/boost/Default/install
467 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2).so*' -exec $(CP) {} $(1)/usr/lib/ \;
469 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)_*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
472 define Package/boost-test/install
477 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
480 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
483 define BuildBoostLibrary
484 define Package/boost-$(1)/install
485 $(call Package/boost/Default/install,$$(1),$(1))
488 $$(eval $$(call BuildPackage,boost-$(1)))
491 $(eval $(call HostBuild))
493 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
494 $(eval $(call BuildPackage,boost-test))
495 $(eval $(call BuildPackage,boost-libs))
496 $(eval $(call BuildPackage,boost))