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_72_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_HASH
:=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722
22 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
24 PKG_LICENSE_FILES
:=LICENSE_1_0.txt
25 PKG_CPE_ID
:=cpe
:/a
:boost
:boost
27 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
28 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
30 HOST_BUILD_PARALLEL
:=1
34 include $(INCLUDE_DIR
)/package.mk
35 include $(INCLUDE_DIR
)/nls.mk
37 define Package
/boost
/Default
40 TITLE
:=Boost C
++ source library
41 URL
:=https
://www.boost.org
42 DEPENDS
:=+libstdcpp
+libpthread
+librt
45 define Package
/boost
/description
46 This package provides the Boost v1.72
.0 libraries.
47 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
49 This package provides the following run-time libraries
:
55 - coroutine and coroutine2
(Coroutine is deprecated
- use Coroutine2
)
63 - locale
(Requires kernel being compiled with full language support
)
71 - serialization and wserialization
79 There are many more header-only libraries supported by Boost.
80 See more at http
://www.boost.org
/doc
/libs
/1_72_0
/
83 PKG_BUILD_DEPENDS
:=boost
/host PACKAGE_python
:python PACKAGE_python3
:python3
85 include ..
/..
/lang
/python
/python-version.mk
86 BOOST_PYTHON_VER
=$(PYTHON_VERSION
)
88 include ..
/..
/lang
/python
/python3-version.mk
89 BOOST_PYTHON3_VER
=$(PYTHON3_VERSION
)
93 define Package
/boost-libs
94 $(call Package
/boost
/Default
)
96 DEPENDS
+= $(BOOST_DEPENDS
)
100 define Package
/boost-libs
/description
101 This meta package contains only dependencies to the other libraries from
102 the boost libraries collection.
105 # Create a meta-package of dependent libraries (for ALL)
106 define Package
/boost-libs
/install
110 define Package
/boost
/install
115 $(call Package
/boost
/Default
)
119 define Package
/boost
/config
120 # Invisible config dependency
121 config boost-context-exclude
123 default y if
(TARGET_arc770 || TARGET_archs38 || TARGET_octeon || TARGET_octeontx
)
126 config boost-coroutine-exclude
128 default y if boost-context-exclude
131 config boost-fiber-exclude
133 default y if boost-coroutine-exclude
136 menu
"Select Boost Options"
137 depends on PACKAGE_boost
138 comment
"Boost compilation options."
141 prompt
"Compile Visibility."
142 default boost-compile-visibility-hidden
144 Choose Boost symbols compilation visibility.
146 - a.k.a.
"default" in gcc documentation. Global symbols are considered public
,
147 they are exported from shared libraries and can be redefined by another
148 shared library or executable.
150 - a.k.a.
"symbolic". Protected symbols are exported from shared libraries but
151 cannot be redefined by another shared library or executable. This mode is
152 not supported on some platforms
, for example OS X.
154 - Hidden symbols are not exported from shared libraries and cannot be
155 redefined by a different shared library or executable loaded in a process.
156 In this mode
, public symbols have to be explicitly marked in the source code
157 to be exported from shared libraries. This is the recommended mode.
159 config boost-compile-visibility-global
162 config boost-compile-visibility-protected
165 config boost-compile-visibility-hidden
170 prompt
"Compile Boost libraries."
171 default boost-static-and-shared-libs
173 Choose which version to compile.
175 - Only Shared libs will be compiled.
177 - Only Static libs will be compiled.
179 - Both Static and Shared libs will be compiled.
181 config boost-shared-libs
184 config boost-static-libs
187 config boost-static-and-shared-libs
192 prompt
"Selects Boost Runtime linkage."
193 default boost-runtime-shared
195 Choose which C and C
++ runtimes to use
:
196 -> Use Shared runtimes.
197 -> Use Static runtimes.
198 - Not available if Shared libs are to be built.
199 -> Use both runtimes.
200 - Not available if Shared libs are to be built.
201 - Two separate versions of Boost are built
, linking each to a different runtime.
202 - This option requires
"Use tagged names" option to be active.
204 config boost-runtime-shared
207 config boost-runtime-static
208 depends on
(!boost-shared-libs
&& !boost-static-and-shared-libs
)
211 config boost-runtime-static-and-shared
212 depends on
(boost-use-name-tags
&& !boost-shared-libs
&& !boost-static-and-shared-libs
)
217 prompt
"Select a Variant."
218 default boost-variant-release
220 Chooses which boost variant should be selected
:
221 -> Release
: Optimizes Boost for release.
222 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
224 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
226 - Profiling
: On
; Debug Symbols
: On.
228 config boost-variant-release
231 config boost-variant-debug
234 config boost-variant-profile
238 config boost-use-name-tags
239 bool
"Use tagged names."
241 Add name
tags the lib files
, to diferentiate each library version
:
242 "-mt" for multi-threading.
244 "-s" for runtime static link
".
245 Might break compatibility with libraries that expect boost libs with default names.
248 config boost-single-thread
249 depends on boost-use-name-tags
250 bool "Single thread Support.
"
252 Compile Boost libraries in single-thread mode.
255 config boost-build-type-complete
256 depends on boost-use-name-tags
257 bool "Complete Boost Build.
"
259 Builds both release and debug libs. It will take much longer to compile.
263 menu "Select Boost libraries
"
264 depends on PACKAGE_boost
267 config boost-libs-all
268 bool "Include
all Boost libraries.
"
270 select PACKAGE_boost-libs
271 select boost-test-pkg
272 select boost-graph-parallel
274 config boost-test-pkg
275 bool "Boost
test package.
"
277 select PACKAGE_boost-test
279 config boost-graph-parallel
280 bool "Boost parallel graph support.
"
281 select PACKAGE_boost-graph
284 $(foreach lib,$(BOOST_LIBS), \
285 config PACKAGE_boost-$(lib)
286 prompt "Boost
$(lib
) $(if
$(findstring python
,$(lib
)),$(paren_left
)v
$(if
$(findstring 3,$(lib
)),$(BOOST_PYTHON3_VER
),$(BOOST_PYTHON_VER
))$(paren_right
) ,)library.
"
288 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
289 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)\
290 $(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
291 $(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
292 $(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
297 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
299 define Package/boost-test
300 $(call Package/boost/Default)
303 DEPENDS+=+boost-system +boost-timer
306 define Build/Configure
310 # 2: dependencies on other boost libraries (short name)
311 # 3: dependencies on other packages
312 # 4: conditional/inward dependencies
313 define DefineBoostLibrary
315 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
316 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
320 define Package/boost-$(1)
321 $(call Package/boost/Default)
323 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
327 define Package/boost-$(1)/description
328 This package contains the Boost $(1) library.
332 $(eval $(call DefineBoostLibrary,atomic,system))
333 $(eval $(call DefineBoostLibrary,chrono,system))
334 $(eval $(call DefineBoostLibrary,container))
335 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
336 $(eval $(call DefineBoostLibrary,contract,system))
337 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
338 $(eval $(call DefineBoostLibrary,date_time))
339 #$(eval $(call DefineBoostLibrary,exception,,))
340 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
341 $(eval $(call DefineBoostLibrary,filesystem,system))
342 $(eval $(call DefineBoostLibrary,graph,regex))
343 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2 +zstd))
344 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
345 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
346 $(eval $(call DefineBoostLibrary,math))
347 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
348 $(eval $(call DefineBoostLibrary,program_options))
349 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
350 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
351 $(eval $(call DefineBoostLibrary,random,system))
352 $(eval $(call DefineBoostLibrary,regex))
353 $(eval $(call DefineBoostLibrary,serialization))
354 $(eval $(call DefineBoostLibrary,wserialization,serialization))
355 $(eval $(call DefineBoostLibrary,stacktrace))
356 $(eval $(call DefineBoostLibrary,system))
357 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
358 $(eval $(call DefineBoostLibrary,timer,chrono))
359 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
360 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
362 include $(INCLUDE_DIR)/host-build.mk
365 # b2 does not provide a configure-script nor a Makefile
366 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
368 ( cd $(HOST_BUILD_DIR) ; \
369 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
370 --with-libraries=context,filesystem,program_options,regex,system ;\
371 ./b2 --ignore-site-config install )
374 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
375 TARGET_LDFLAGS += -pthread -lrt
378 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
380 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17)
382 ifneq ($(findstring mips,$(ARCH)),)
384 ifneq ($(findstring 64,$(ARCH)),)
387 else ifneq ($(findstring arm,$(ARCH)),)
389 else ifeq ($(ARCH),aarch64)
398 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu type $(CONFIG_CPU_TYPE) $(if $(CONFIG_CPU_SUBTYPE),and cpu subtype $(CONFIG_CPU_SUBTYPE),))
399 ( cd $(PKG_BUILD_DIR) ; \
400 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
401 tools/build/src/user-config.jam ; \
404 --ignore-site-config \
405 --toolset=gcc abi=$(BOOST_ABI) \
406 --disable-long-double \
407 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
408 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
409 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
410 $(if $(CONFIG_boost-variant-release), variant=release,) \
411 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
412 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
413 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
414 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
415 $(if $(CONFIG_boost-shared-libs),link=shared,) \
416 $(if $(CONFIG_boost-static-libs),link=static,) \
417 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
418 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
419 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
420 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
421 $(if $(CONFIG_boost-single-thread),threading=single,) \
424 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
425 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
427 $(foreach lib,$(BOOST_LIBS), \
428 $(if $(findstring python,$(lib)),, \
429 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
430 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
434 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
435 boost.locale.iconv=off) \
437 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
438 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
440 $(if $(CONFIG_PACKAGE_boost-python), \
441 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
) -I
$(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON_VER
)/ \" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
442 tools/build/src/user-config.jam ; \
443 echo "using python
: $(BOOST_PYTHON_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON_VER
).so
;" >> \
444 tools/build/src/user-config.jam; \
447 --ignore-site-config \
448 --toolset=gcc abi=$(BOOST_ABI) \
449 --disable-long-double \
450 $(if $(CONFIG_boost-variant-release), variant=release,) \
451 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
452 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
453 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
454 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
455 $(if $(CONFIG_boost-shared-libs),link=shared,) \
456 $(if $(CONFIG_boost-static-libs),link=static,) \
457 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
458 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
459 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
460 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
461 $(if $(CONFIG_boost-single-thread),threading=single,) \
466 $(if $(CONFIG_PACKAGE_boost-python3), \
467 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
) -I
$(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ \" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
468 tools/build/src/user-config.jam ; \
469 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
470 tools/build/src/user-config.jam; \
473 --ignore-site-config \
474 --toolset=gcc abi=$(BOOST_ABI) \
475 --disable-long-double \
476 $(if $(CONFIG_boost-variant-release), variant=release,) \
477 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
478 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
479 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
480 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
481 $(if $(CONFIG_boost-shared-libs),link=shared,) \
482 $(if $(CONFIG_boost-static-libs),link=static,) \
483 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
484 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
485 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
486 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
487 $(if $(CONFIG_boost-single-thread),threading=single,) \
495 define Build/InstallDev
497 $(1)/usr/include/boost/
500 $(PKG_INSTALL_DIR)/include/boost/* \
501 $(1)/usr/include/boost/ \
502 # copies _all_ header files - independent of <--with-library>-argument above
504 $(INSTALL_DIR) $(1)/usr/lib
505 # copies all cmake files, compiled archive and shared object files
506 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
510 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
511 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
514 define Package/boost/Default/install
515 $(INSTALL_DIR) $(1)/usr/lib
516 $(if $(findstring python,$(2)), $(if $(findstring 3,$(2)), \
517 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_python3*.so* $(1)/usr/lib/ , \
518 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_python2*.so* $(1)/usr/lib/ ), \
519 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/ )
522 define Package/boost-test/install
523 $(INSTALL_DIR) $(1)/usr/lib
524 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* $(1)/usr/lib/
525 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* $(1)/usr/lib/
528 define BuildBoostLibrary
529 define Package/boost-$(1)/install
530 $(call Package/boost/Default/install,$$(1),$(1))
533 $$(eval $$(call BuildPackage,boost-$(1)))
536 $(eval $(call HostBuild))
538 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
539 $(eval $(call BuildPackage,boost-test))
540 $(eval $(call BuildPackage,boost-libs))
541 $(eval $(call BuildPackage,boost))