2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
7 # Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
8 # Dude, this "boost" is really one of the most crude stuff I ported yet.
11 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE_VERSION
:=1_69_0
18 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
).
tar.bz2
19 PKG_SOURCE_URL
:=@SF
/$(PKG_NAME
)/$(PKG_NAME
)/$(PKG_VERSION
) https
://dl.bintray.com
/boostorg
/release
/$(PKG_VERSION
)/source
/
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
21 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
22 PKG_HASH
:=8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406
23 PKG_LICENSE
:=Boost Software License
<http
://www.boost.org
/users
/license.html
>
24 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
29 include $(INCLUDE_DIR
)/package.mk
30 include $(INCLUDE_DIR
)/nls.mk
32 define Package
/boost
/Default
35 TITLE
:=Boost C
++ source library
36 URL
:=http
://www.boost.org
37 DEPENDS
:=+libstdcpp
+libpthread
+librt
40 define Package
/boost
/description
41 This package provides the Boost v1.69
.0 libraries.
42 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
44 -----------------------------------------------------------------------------
46 | In order to build
all of the Boost Libraries
, it is necessary |
47 | to use
, at least
, GCC version
5 (C
++14 support
) and
, it is necessary to |
48 | compile the kernel with Full Language Support. |
49 | Without these requirerements
, the following libs will not be available
: |
51 |
- Boost.Coroutine2
(header-only library
- requires C
++11) |
52 |
- Boost.Fiber
(requires C
++14) |
53 -----------------------------------------------------------------------------
55 This package provides the following run-time libraries
:
61 - coroutine
(Deprecated
- use Coroutine2
)
62 - - coroutine2
(Requires GCC v5 and up
)
66 - fiber
(Requires GCC v5 and up
)
70 - locale
(Requires kernel being compiled with full language support
)
78 - serialization and wserialization
86 There are many more header-only libraries supported by Boost.
87 See more at http
://www.boost.org
/doc
/libs
/1_69_0
/
90 PKG_BUILD_DEPENDS
:=boost
/host PACKAGE_python
:python PACKAGE_python3
:python3
92 include ..
/..
/lang
/python
/python-version.mk
93 BOOST_PYTHON_VER
=$(PYTHON_VERSION
)
95 include ..
/..
/lang
/python
/python3-version.mk
96 BOOST_PYTHON3_VER
=$(PYTHON3_VERSION
)
100 define Package
/boost-libs
101 $(call Package
/boost
/Default
)
103 DEPENDS
+= $(BOOST_DEPENDS
)
107 define Package
/boost-libs
/description
108 This meta package contains only dependencies to the other libraries from
109 the boost libraries collection.
112 # Create a meta-package of dependent libraries (for ALL)
113 define Package
/boost-libs
/install
117 define Package
/boost
/install
122 $(call Package
/boost
/Default
)
126 define Package
/boost
/config
127 menu
"Select Boost Options"
128 depends on PACKAGE_boost
129 comment
"Boost compilation options."
132 prompt
"Compile Visibility."
133 default boost-compile-visibility-hidden
135 Choose Boost symbols compilation visibility.
137 - a.k.a.
"default" in gcc documentation. Global symbols are considered public
,
138 they are exported from shared libraries and can be redefined by another
139 shared library or executable.
141 - a.k.a.
"symbolic". Protected symbols are exported from shared libraries but
142 cannot be redefined by another shared library or executable. This mode is
143 not supported on some platforms
, for example OS X.
145 - Hidden symbols are not exported from shared libraries and cannot be
146 redefined by a different shared library or executable loaded in a process.
147 In this mode
, public symbols have to be explicitly marked in the source code
148 to be exported from shared libraries. This is the recommended mode.
150 config boost-compile-visibility-global
153 config boost-compile-visibility-protected
156 config boost-compile-visibility-hidden
161 prompt
"Compile Boost libraries."
162 default boost-static-and-shared-libs
164 Choose which version to compile.
166 - Only Shared libs will be compiled.
168 - Only Static libs will be compiled.
170 - Both Static and Shared libs will be compiled.
172 config boost-shared-libs
175 config boost-static-libs
178 config boost-static-and-shared-libs
183 prompt
"Selects Boost Runtime linkage."
184 default boost-runtime-shared
186 Choose which C and C
++ runtimes to use
:
187 -> Use Shared runtimes.
188 -> Use Static runtimes.
189 - Not available if Shared libs are to be built.
190 -> Use both runtimes.
191 - Not available if Shared libs are to be built.
192 - Two separate versions of Boost are built
, linking each to a different runtime.
193 - This option requires
"Use tagged names" option to be active.
195 config boost-runtime-shared
198 config boost-runtime-static
199 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
202 config boost-runtime-static-and-shared
203 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
208 prompt
"Select a Variant."
209 default boost-variant-release
211 Chooses which boost variant should be selected
:
212 -> Release
: Optimizes Boost for release.
213 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
215 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
217 - Profiling
: On
; Debug Symbols
: On.
219 config boost-variant-release
222 config boost-variant-debug
225 config boost-variant-profile
229 config boost-use-name-tags
230 bool
"Use tagged names."
232 Add name
tags the lib files
, to diferentiate each library version
:
233 "-mt" for multi-threading.
235 "-s" for runtime static link
".
236 Might break compatibility with libraries that expect boost libs with default names.
239 config boost-single-thread
240 depends on @boost-use-name-tags
241 bool "Single thread Support.
"
243 Compile Boost libraries in single-thread mode.
246 config boost-build-type-complete
247 depends on @boost-use-name-tags
248 bool "Complete Boost Build.
"
250 Builds both release and debug libs. It will take much longer to compile.
254 menu "Select Boost libraries
"
255 depends on PACKAGE_boost
258 config boost-libs-all
259 bool "Include
all Boost libraries.
"
261 select PACKAGE_boost-libs
262 select boost-test-pkg
263 select boost-coroutine2
264 select boost-graph-parallel
266 # Invisible config dependency
267 config boost-fiber-exclude
269 default y if (CPU_TYPE=mips32 || CPU_TYPE=mips64)
271 config boost-test-pkg
272 bool "Boost
test package.
"
274 select PACKAGE_boost-test
276 config boost-coroutine2
277 depends on !@GCC_VERSION_4_8
278 bool "Boost couroutine2 support.
"
279 select PACKAGE_boost-coroutine
282 config boost-graph-parallel
283 bool "Boost parallel graph support.
"
284 select PACKAGE_boost-graph
287 $(foreach lib,$(BOOST_LIBS), \
288 config PACKAGE_boost-$(lib)
289 prompt "Boost
$(lib
) $(if
$(findstring python
,$(lib
)),$(paren_left
)v
$(if
$(findstring 3,$(lib
)),$(BOOST_PYTHON3_VER
),$(BOOST_PYTHON_VER
))$(paren_right
) ,)library.
"
291 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
292 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)\
293 $(if $(findstring fiber,$(lib)),depends on (CPU_TYPE!=mips32 && CPU_TYPE!=mips64),)
299 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
301 define Package/boost-test
302 $(call Package/boost/Default)
305 DEPENDS+=+boost-system +boost-timer
308 define Build/Configure
312 # 2: dependencies on other boost libraries (short name)
313 # 3: dependencies on other packages
314 # 4: conditional/inward dependencies
315 define DefineBoostLibrary
317 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
318 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
322 define Package/boost-$(1)
323 $(call Package/boost/Default)
325 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
329 define Package/boost-$(1)/description
330 This package contains the Boost $(1) library.
334 $(eval $(call DefineBoostLibrary,atomic,system,))
335 $(eval $(call DefineBoostLibrary,chrono,system,))
336 $(eval $(call DefineBoostLibrary,container,,))
337 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
338 $(eval $(call DefineBoostLibrary,contract,system,))
339 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
340 $(eval $(call DefineBoostLibrary,date_time,,))
341 #$(eval $(call DefineBoostLibrary,exception,,))
342 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
343 $(eval $(call DefineBoostLibrary,filesystem,system,))
344 $(eval $(call DefineBoostLibrary,graph,regex,))
345 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2))
346 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
347 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
348 $(eval $(call DefineBoostLibrary,math,,))
349 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
350 $(eval $(call DefineBoostLibrary,program_options,,))
351 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
352 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
353 $(eval $(call DefineBoostLibrary,random,system,))
354 $(eval $(call DefineBoostLibrary,regex,,))
355 $(eval $(call DefineBoostLibrary,serialization,,))
356 $(eval $(call DefineBoostLibrary,wserialization,serialization,))
357 $(eval $(call DefineBoostLibrary,stacktrace,,))
358 $(eval $(call DefineBoostLibrary,system,,))
359 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
360 $(eval $(call DefineBoostLibrary,timer,chrono))
361 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
362 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
364 include $(INCLUDE_DIR)/host-build.mk
367 # b2 does not provide a configure-script nor a Makefile
368 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
371 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
372 TARGET_LDFLAGS += -pthread -lrt
375 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
377 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
379 ifneq ($(findstring mips,$(ARCH)),)
381 ifneq ($(findstring 64,$(ARCH)),)
384 else ifneq ($(findstring arm,$(ARCH)),)
386 else ifeq ($(ARCH),aarch64)
395 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CONFIG_CPU_TYPE) $(if $(CONFIG_CPU_SUBTYPE),and cpu subtype $(CONFIG_CPU_SUBTYPE),))
396 ( cd $(PKG_BUILD_DIR) ; \
397 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
398 tools/build/src/user-config.jam ; \
401 --ignore-site-config \
402 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
403 --disable-long-double \
404 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
405 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
406 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
407 $(if $(CONFIG_boost-variant-release), variant=release,) \
408 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
409 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
410 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
411 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
412 $(if $(CONFIG_boost-shared-libs),link=shared,) \
413 $(if $(CONFIG_boost-static-libs),link=static,) \
414 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
415 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
416 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
417 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
418 $(if $(CONFIG_boost-single-thread),threading=single,) \
421 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
422 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
424 $(foreach lib,$(BOOST_LIBS), \
425 $(if $(findstring python,$(lib)),, \
426 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
427 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
431 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
432 boost.locale.iconv=off) \
434 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
435 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
437 $(if $(CONFIG_PACKAGE_boost-python), \
438 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
) -I
$(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON_VER
)/ \" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
439 tools/build/src/user-config.jam ; \
440 echo "using python
: $(BOOST_PYTHON_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON_VER
).so
;" >> \
441 tools/build/src/user-config.jam; \
444 --ignore-site-config \
445 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
446 --disable-long-double \
447 $(if $(CONFIG_boost-variant-release), variant=release,) \
448 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
449 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
450 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
451 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
452 $(if $(CONFIG_boost-shared-libs),link=shared,) \
453 $(if $(CONFIG_boost-static-libs),link=static,) \
454 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
455 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
456 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
457 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
458 $(if $(CONFIG_boost-single-thread),threading=single,) \
463 $(if $(CONFIG_PACKAGE_boost-python3), \
464 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
) -I
$(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ \" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
465 tools/build/src/user-config.jam ; \
466 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
467 tools/build/src/user-config.jam; \
470 --ignore-site-config \
471 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
472 --disable-long-double \
473 $(if $(CONFIG_boost-variant-release), variant=release,) \
474 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
475 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
476 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
477 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
478 $(if $(CONFIG_boost-shared-libs),link=shared,) \
479 $(if $(CONFIG_boost-static-libs),link=static,) \
480 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
481 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
482 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
483 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
484 $(if $(CONFIG_boost-single-thread),threading=single,) \
492 define Build/InstallDev
494 $(1)/usr/include/boost/
497 $(PKG_INSTALL_DIR)/include/boost/* \
498 $(1)/usr/include/boost/ \
499 # copies _all_ header files - independent of <--with-library>-argument above
501 $(INSTALL_DIR) $(1)/usr/lib
502 # copies all compiled archive and shared object files
503 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.{a,so*} $(1)/usr/lib/ || :
507 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
508 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 $(STAGING_DIR_HOSTPKG)/bin/
511 define Package/boost/Default/install
512 $(INSTALL_DIR) $(1)/usr/lib
513 $(if $(findstring python,$(2)), $(if $(findstring 3,$(2)), \
514 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_python3*.so* $(1)/usr/lib/ , \
515 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_python2*.so* $(1)/usr/lib/ ), \
516 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/ )
519 define Package/boost-test/install
520 $(INSTALL_DIR) $(1)/usr/lib
521 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* $(1)/usr/lib/
522 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* $(1)/usr/lib/
525 define BuildBoostLibrary
526 define Package/boost-$(1)/install
527 $(call Package/boost/Default/install,$$(1),$(1))
530 $$(eval $$(call BuildPackage,boost-$(1)))
533 $(eval $(call HostBuild))
535 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
536 $(eval $(call BuildPackage,boost-test))
537 $(eval $(call BuildPackage,boost-libs))
538 $(eval $(call BuildPackage,boost))