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_84_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
:=cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454
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.84
.0 libraries.
46 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
48 This package provides the following run-time libraries
:
55 - coroutine and coroutine2
(Coroutine is deprecated
- use Coroutine2
)
72 - serialization and wserialization
81 There are many more header-only libraries supported by Boost.
82 See more at http
://www.boost.org
/doc
/libs
/1_84_0
/
85 PKG_BUILD_DEPENDS
:=boost
/host
87 include ..
/..
/lang
/python
/python3-version.mk
88 BOOST_PYTHON3_VER
=$(PYTHON3_VERSION
)
92 define Package
/boost-libs
93 $(call Package
/boost
/Default
)
95 DEPENDS
+= $(BOOST_DEPENDS
)
99 define Package
/boost-libs
/description
100 This meta package contains only dependencies to the other libraries from
101 the boost libraries collection.
104 # Create a meta-package of dependent libraries (for ALL)
105 define Package
/boost-libs
/install
109 define Package
/boost
/install
114 $(call Package
/boost
/Default
)
118 define Package
/boost
/config
119 # Invisible config dependency
120 config boost-context-exclude
122 default y if
(TARGET_arc770 || TARGET_archs38
)
125 config boost-coroutine-exclude
127 default y if boost-context-exclude
130 config boost-fiber-exclude
132 default y if boost-coroutine-exclude
135 menu
"Select Boost Options"
136 depends on PACKAGE_boost
137 comment
"Boost compilation options."
140 prompt
"Compile Visibility."
141 default boost-compile-visibility-hidden
143 Choose Boost symbols compilation visibility.
145 - a.k.a.
"default" in gcc documentation. Global symbols are considered public
,
146 they are exported from shared libraries and can be redefined by another
147 shared library or executable.
149 - a.k.a.
"symbolic". Protected symbols are exported from shared libraries but
150 cannot be redefined by another shared library or executable. This mode is
151 not supported on some platforms
, for example OS X.
153 - Hidden symbols are not exported from shared libraries and cannot be
154 redefined by a different shared library or executable loaded in a process.
155 In this mode
, public symbols have to be explicitly marked in the source code
156 to be exported from shared libraries. This is the recommended mode.
158 config boost-compile-visibility-global
161 config boost-compile-visibility-protected
164 config boost-compile-visibility-hidden
169 prompt
"Compile Boost libraries."
170 default boost-static-and-shared-libs
172 Choose which version to compile.
174 - Only Shared libs will be compiled.
176 - Only Static libs will be compiled.
178 - Both Static and Shared libs will be compiled.
180 config boost-shared-libs
183 config boost-static-libs
186 config boost-static-and-shared-libs
191 prompt
"Selects Boost Runtime linkage."
192 default boost-runtime-shared
194 Choose which C and C
++ runtimes to use
:
195 -> Use Shared runtimes.
196 -> Use Static runtimes.
197 - Not available if Shared libs are to be built.
198 -> Use both runtimes.
199 - Not available if Shared libs are to be built.
200 - Two separate versions of Boost are built
, linking each to a different runtime.
201 - This option requires
"Use tagged names" option to be active.
203 config boost-runtime-shared
206 config boost-runtime-static
207 depends on
(!boost-shared-libs
&& !boost-static-and-shared-libs
)
210 config boost-runtime-static-and-shared
211 depends on
(boost-use-name-tags
&& !boost-shared-libs
&& !boost-static-and-shared-libs
)
216 prompt
"Select a Variant."
217 default boost-variant-release
219 Chooses which boost variant should be selected
:
220 -> Release
: Optimizes Boost for release.
221 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
223 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
225 - Profiling
: On
; Debug Symbols
: On.
227 config boost-variant-release
230 config boost-variant-debug
233 config boost-variant-profile
237 config boost-use-name-tags
238 bool
"Use tagged names."
240 Add name
tags the lib files
, to diferentiate each library version
:
241 "-mt" for multi-threading.
243 "-s" for runtime static link
".
244 Might break compatibility with libraries that expect boost libs with default names.
247 config boost-single-thread
248 depends on boost-use-name-tags
249 bool "Single thread Support.
"
251 Compile Boost libraries in single-thread mode.
254 config boost-build-type-complete
255 depends on boost-use-name-tags
256 bool "Complete Boost Build.
"
258 Builds both release and debug libs. It will take much longer to compile.
262 menu "Select Boost libraries
"
263 depends on PACKAGE_boost
266 config boost-libs-all
267 bool "Include
all Boost libraries.
"
269 select PACKAGE_boost-libs
270 select boost-test-pkg
271 select boost-graph-parallel
273 config boost-test-pkg
274 bool "Boost
test package.
"
276 select PACKAGE_boost-test
278 config boost-graph-parallel
279 bool "Boost parallel graph support.
"
280 select PACKAGE_boost-graph
283 $(foreach lib,$(BOOST_LIBS),
284 config PACKAGE_boost-$(lib)
285 prompt "Boost
$(lib
) $(if
$(findstring python3
,$(lib
)),$(paren_left
)v
$(BOOST_PYTHON3_VER
)$(paren_right
) ,)library.
"
287 $(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
288 $(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
289 $(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
294 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
296 define Package/boost-test
297 $(call Package/boost/Default)
300 DEPENDS+=+boost-system +boost-timer
303 define Build/Configure
306 define Package/boost/Default/install
307 $(INSTALL_DIR) $(1)/usr/lib
308 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
312 # 2: dependencies on other boost libraries (short name)
313 # 3: dependencies on other packages
314 # 4: conditional/inward dependencies
315 # 5: dependencies compiled only when this package has been selected
316 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),) $(patsubst %,+PACKAGE_boost-$(1):%,$(5))
329 define Package/boost-$(1)/description
330 This package contains the Boost $(1) library.
333 define Package/boost-$(1)/install
334 $(if $(CONFIG_boost-static-libs),true,$(call Package/boost/Default/install,$$(1),$(1)))
338 $(eval $(call DefineBoostLibrary,atomic,system))
339 $(eval $(call DefineBoostLibrary,chrono,system))
340 $(eval $(call DefineBoostLibrary,cobalt,system container))
341 $(eval $(call DefineBoostLibrary,container))
342 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
343 $(eval $(call DefineBoostLibrary,contract,system))
344 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
345 $(eval $(call DefineBoostLibrary,date_time))
346 #$(eval $(call DefineBoostLibrary,exception,,))
347 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
348 $(eval $(call DefineBoostLibrary,filesystem,system atomic))
349 $(eval $(call DefineBoostLibrary,graph,regex))
350 $(eval $(call DefineBoostLibrary,iostreams,,,,zlib liblzma libbz2 libzstd))
351 $(eval $(call DefineBoostLibrary,json,container))
352 $(eval $(call DefineBoostLibrary,locale,system chrono thread,,,icu))
353 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
354 $(eval $(call DefineBoostLibrary,math))
355 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
356 $(eval $(call DefineBoostLibrary,nowide))
357 $(eval $(call DefineBoostLibrary,program_options))
358 $(eval $(call DefineBoostLibrary,python3,,,,python3-base))
359 $(eval $(call DefineBoostLibrary,random,system))
360 $(eval $(call DefineBoostLibrary,regex,,,,icu))
361 $(eval $(call DefineBoostLibrary,serialization))
362 $(eval $(call DefineBoostLibrary,wserialization,serialization))
363 $(eval $(call DefineBoostLibrary,stacktrace))
364 $(eval $(call DefineBoostLibrary,system))
365 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
366 $(eval $(call DefineBoostLibrary,timer,chrono))
367 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
368 $(eval $(call DefineBoostLibrary,url))
369 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
371 include $(INCLUDE_DIR)/host-build.mk
374 # b2 does not provide a configure-script nor a Makefile
375 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
377 ( cd $(HOST_BUILD_DIR) ; \
378 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
379 --with-libraries=context,filesystem,program_options,regex,system ;\
380 ./b2 --ignore-site-config install )
383 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
384 TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--as-needed,--print-gc-sections
387 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
389 ifeq ($(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION)))),11)
390 EXTRA_CXXFLAGS += -std=gnu++20
392 EXTRA_CXXFLAGS += -std=gnu++23
395 ifneq ($(findstring mips,$(ARCH)),)
397 ifneq ($(findstring 64,$(ARCH)),)
400 else ifneq ($(findstring arm,$(ARCH)),)
402 else ifeq ($(ARCH),aarch64)
411 $(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),))
412 ( cd $(PKG_BUILD_DIR) ; \
413 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
414 tools/build/src/user-config.jam ; \
417 --ignore-site-config \
418 --toolset=gcc abi=$(BOOST_ABI) \
419 --disable-long-double \
420 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
421 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
422 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
423 $(if $(CONFIG_boost-variant-release), variant=release,) \
424 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
425 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
426 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
427 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
428 $(if $(CONFIG_boost-shared-libs),link=shared,) \
429 $(if $(CONFIG_boost-static-libs),link=static,) \
430 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
431 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
432 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
433 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
434 $(if $(CONFIG_boost-single-thread),threading=single,) \
437 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
438 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
440 $(foreach lib,$(BOOST_LIBS), \
441 $(if $(findstring python3,$(lib)),, \
442 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
443 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
447 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.std=off boost.locale.posix=off) \
449 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
450 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
452 $(if $(CONFIG_PACKAGE_boost-python3), \
453 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
)\" ;" > \
454 tools/build/src/user-config.jam ; \
455 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
456 tools/build/src/user-config.jam; \
459 --ignore-site-config \
460 --toolset=gcc abi=$(BOOST_ABI) \
461 --disable-long-double \
462 $(if $(CONFIG_boost-variant-release), variant=release,) \
463 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
464 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
465 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
466 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
467 $(if $(CONFIG_boost-shared-libs),link=shared,) \
468 $(if $(CONFIG_boost-static-libs),link=static,) \
469 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
470 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
471 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
472 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
473 $(if $(CONFIG_boost-single-thread),threading=single,) \
481 define Build/InstallDev
483 $(1)/usr/include/boost/
486 $(PKG_INSTALL_DIR)/include/boost/* \
487 $(1)/usr/include/boost/ \
488 # copies _all_ header files - independent of <--with-library>-argument above
490 $(INSTALL_DIR) $(1)/usr/lib
491 # copies all cmake files, compiled archive and shared object files
492 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
496 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
497 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
500 define Package/boost-test/install
501 $(if $(CONFIG_boost-static-libs),true,
502 $(INSTALL_DIR) $(1)/usr/lib
503 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_{unit_test_framework,prg_exec_monitor}*.so* $(1)/usr/lib/
507 $(eval $(call HostBuild))
509 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildPackage,boost-$(lib))))
510 $(eval $(call BuildPackage,boost-test))
511 $(eval $(call BuildPackage,boost-libs))
512 $(eval $(call BuildPackage,boost))