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_86_0
18 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
).
tar.bz2
19 PKG_SOURCE_URL
:=@SF
/$(PKG_NAME
)/$(PKG_NAME
)/$(PKG_VERSION
) https
://boostorg.jfrog.io
/artifactory
/main
/release
/$(PKG_VERSION
)/source
/
20 PKG_HASH
:=1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b
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
32 PKG_BUILD_FLAGS
:=no-mips16 gc-sections lto
34 include $(INCLUDE_DIR
)/package.mk
36 define Package
/boost
/Default
39 TITLE
:=Boost C
++ source library
40 URL
:=https
://www.boost.org
41 DEPENDS
:=+libstdcpp
+libpthread
+librt
44 define Package
/boost
/description
45 This package provides the Boost v1.86
.0 libraries.
46 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
48 This package provides the following run-time libraries
:
56 - coroutine and coroutine2
(Coroutine is deprecated
- use Coroutine2
)
73 - serialization and wserialization
82 There are many more header-only libraries supported by Boost.
83 See more at http
://www.boost.org
/doc
/libs
/1_86_0
/
86 PKG_BUILD_DEPENDS
:=boost
/host
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
)
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 python3
,$(lib
)),$(paren_left
)v
$(BOOST_PYTHON3_VER
)$(paren_right
) ,)library.
"
288 $(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
289 $(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
290 $(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
295 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
297 define Package/boost-test
298 $(call Package/boost/Default)
301 DEPENDS+=+boost-system +boost-timer
304 define Build/Configure
307 define Package/boost/Default/install
308 $(INSTALL_DIR) $(1)/usr/lib
309 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
313 # 2: dependencies on other boost libraries (short name)
314 # 3: dependencies on other packages
315 # 4: conditional/inward dependencies
316 # 5: dependencies compiled only when this package has been selected
317 define DefineBoostLibrary
318 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
319 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
323 define Package/boost-$(1)
324 $(call Package/boost/Default)
326 DEPENDS+= $(foreach lib,$(2),+boost-$(lib)) $(3) $(if $(4),@$(4),) $(patsubst %,+PACKAGE_boost-$(1):%,$(5))
330 define Package/boost-$(1)/description
331 This package contains the Boost $(1) library.
334 define Package/boost-$(1)/install
335 $(if $(CONFIG_boost-static-libs),true,$(call Package/boost/Default/install,$$(1),$(1)))
339 $(eval $(call DefineBoostLibrary,atomic,system))
340 $(eval $(call DefineBoostLibrary,charconv,,,,libquadmath))
341 $(eval $(call DefineBoostLibrary,chrono,system))
342 $(eval $(call DefineBoostLibrary,cobalt,system container))
343 $(eval $(call DefineBoostLibrary,container))
344 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
345 $(eval $(call DefineBoostLibrary,contract,system))
346 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
347 $(eval $(call DefineBoostLibrary,date_time))
348 #$(eval $(call DefineBoostLibrary,exception,,))
349 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
350 $(eval $(call DefineBoostLibrary,filesystem,system atomic))
351 $(eval $(call DefineBoostLibrary,graph,regex))
352 $(eval $(call DefineBoostLibrary,iostreams,,,,zlib liblzma libbz2 libzstd))
353 $(eval $(call DefineBoostLibrary,json,container))
354 $(eval $(call DefineBoostLibrary,locale,system chrono thread,,,icu))
355 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
356 $(eval $(call DefineBoostLibrary,math))
357 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
358 $(eval $(call DefineBoostLibrary,nowide))
359 $(eval $(call DefineBoostLibrary,program_options))
360 $(eval $(call DefineBoostLibrary,python3,,,,python3-base))
361 $(eval $(call DefineBoostLibrary,random,system))
362 $(eval $(call DefineBoostLibrary,regex,,,,icu))
363 $(eval $(call DefineBoostLibrary,serialization))
364 $(eval $(call DefineBoostLibrary,wserialization,serialization))
365 $(eval $(call DefineBoostLibrary,stacktrace))
366 $(eval $(call DefineBoostLibrary,system))
367 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
368 $(eval $(call DefineBoostLibrary,timer,chrono))
369 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
370 $(eval $(call DefineBoostLibrary,url))
371 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
373 include $(INCLUDE_DIR)/host-build.mk
376 # b2 does not provide a configure-script nor a Makefile
377 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
379 ( cd $(HOST_BUILD_DIR) ; \
380 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
381 --with-libraries=context,filesystem,program_options,regex,system ;\
382 ./b2 --ignore-site-config install )
385 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
386 TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--as-needed,--print-gc-sections
389 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
391 ifeq ($(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION)))),11)
392 EXTRA_CXXFLAGS += -std=gnu++20
394 EXTRA_CXXFLAGS += -std=gnu++23
397 ifneq ($(findstring mips,$(ARCH)),)
399 ifneq ($(findstring 64,$(ARCH)),)
402 else ifneq ($(findstring arm,$(ARCH)),)
404 else ifeq ($(ARCH),aarch64)
413 $(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),))
414 ( cd $(PKG_BUILD_DIR) ; \
415 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
416 tools/build/src/user-config.jam ; \
419 --ignore-site-config \
420 --toolset=gcc abi=$(BOOST_ABI) \
421 --disable-long-double \
422 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
423 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
424 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
425 $(if $(CONFIG_boost-variant-release), variant=release,) \
426 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
427 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
428 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
429 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
430 $(if $(CONFIG_boost-shared-libs),link=shared,) \
431 $(if $(CONFIG_boost-static-libs),link=static,) \
432 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
433 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
434 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
435 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
436 $(if $(CONFIG_boost-single-thread),threading=single,) \
439 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
440 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
442 $(foreach lib,$(BOOST_LIBS), \
443 $(if $(findstring python3,$(lib)),, \
444 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
445 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
449 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.std=off boost.locale.posix=off) \
451 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
452 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
454 $(if $(CONFIG_PACKAGE_boost-python3), \
455 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
)\" ;" > \
456 tools/build/src/user-config.jam ; \
457 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
458 tools/build/src/user-config.jam; \
461 --ignore-site-config \
462 --toolset=gcc abi=$(BOOST_ABI) \
463 --disable-long-double \
464 $(if $(CONFIG_boost-variant-release), variant=release,) \
465 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
466 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
467 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
468 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
469 $(if $(CONFIG_boost-shared-libs),link=shared,) \
470 $(if $(CONFIG_boost-static-libs),link=static,) \
471 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
472 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
473 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
474 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
475 $(if $(CONFIG_boost-single-thread),threading=single,) \
483 define Build/InstallDev
485 $(1)/usr/include/boost/
488 $(PKG_INSTALL_DIR)/include/boost/* \
489 $(1)/usr/include/boost/ \
490 # copies _all_ header files - independent of <--with-library>-argument above
492 $(INSTALL_DIR) $(1)/usr/lib
493 # copies all cmake files, compiled archive and shared object files
494 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
498 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
499 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
502 define Package/boost-test/install
503 $(if $(CONFIG_boost-static-libs),true,
504 $(INSTALL_DIR) $(1)/usr/lib
505 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_{unit_test_framework,prg_exec_monitor}*.so* $(1)/usr/lib/
509 $(eval $(call HostBuild))
511 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildPackage,boost-$(lib))))
512 $(eval $(call BuildPackage,boost-test))
513 $(eval $(call BuildPackage,boost-libs))
514 $(eval $(call BuildPackage,boost))