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_81_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
:=71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa
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
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.81
.0 libraries.
46 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
48 This package provides the following run-time libraries
:
54 - coroutine and coroutine2
(Coroutine is deprecated
- use Coroutine2
)
71 - serialization and wserialization
80 There are many more header-only libraries supported by Boost.
81 See more at http
://www.boost.org
/doc
/libs
/1_81_0
/
84 PKG_BUILD_DEPENDS
:=boost
/host
86 include ..
/..
/lang
/python
/python3-version.mk
87 BOOST_PYTHON3_VER
=$(PYTHON3_VERSION
)
91 define Package
/boost-libs
92 $(call Package
/boost
/Default
)
94 DEPENDS
+= $(BOOST_DEPENDS
)
98 define Package
/boost-libs
/description
99 This meta package contains only dependencies to the other libraries from
100 the boost libraries collection.
103 # Create a meta-package of dependent libraries (for ALL)
104 define Package
/boost-libs
/install
108 define Package
/boost
/install
113 $(call Package
/boost
/Default
)
117 define Package
/boost
/config
118 # Invisible config dependency
119 config boost-context-exclude
121 default y if
(TARGET_arc770 || TARGET_archs38
)
124 config boost-coroutine-exclude
126 default y if boost-context-exclude
129 config boost-fiber-exclude
131 default y if boost-coroutine-exclude
134 menu
"Select Boost Options"
135 depends on PACKAGE_boost
136 comment
"Boost compilation options."
139 prompt
"Compile Visibility."
140 default boost-compile-visibility-hidden
142 Choose Boost symbols compilation visibility.
144 - a.k.a.
"default" in gcc documentation. Global symbols are considered public
,
145 they are exported from shared libraries and can be redefined by another
146 shared library or executable.
148 - a.k.a.
"symbolic". Protected symbols are exported from shared libraries but
149 cannot be redefined by another shared library or executable. This mode is
150 not supported on some platforms
, for example OS X.
152 - Hidden symbols are not exported from shared libraries and cannot be
153 redefined by a different shared library or executable loaded in a process.
154 In this mode
, public symbols have to be explicitly marked in the source code
155 to be exported from shared libraries. This is the recommended mode.
157 config boost-compile-visibility-global
160 config boost-compile-visibility-protected
163 config boost-compile-visibility-hidden
168 prompt
"Compile Boost libraries."
169 default boost-static-and-shared-libs
171 Choose which version to compile.
173 - Only Shared libs will be compiled.
175 - Only Static libs will be compiled.
177 - Both Static and Shared libs will be compiled.
179 config boost-shared-libs
182 config boost-static-libs
185 config boost-static-and-shared-libs
190 prompt
"Selects Boost Runtime linkage."
191 default boost-runtime-shared
193 Choose which C and C
++ runtimes to use
:
194 -> Use Shared runtimes.
195 -> Use Static runtimes.
196 - Not available if Shared libs are to be built.
197 -> Use both runtimes.
198 - Not available if Shared libs are to be built.
199 - Two separate versions of Boost are built
, linking each to a different runtime.
200 - This option requires
"Use tagged names" option to be active.
202 config boost-runtime-shared
205 config boost-runtime-static
206 depends on
(!boost-shared-libs
&& !boost-static-and-shared-libs
)
209 config boost-runtime-static-and-shared
210 depends on
(boost-use-name-tags
&& !boost-shared-libs
&& !boost-static-and-shared-libs
)
215 prompt
"Select a Variant."
216 default boost-variant-release
218 Chooses which boost variant should be selected
:
219 -> Release
: Optimizes Boost for release.
220 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
222 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
224 - Profiling
: On
; Debug Symbols
: On.
226 config boost-variant-release
229 config boost-variant-debug
232 config boost-variant-profile
236 config boost-use-name-tags
237 bool
"Use tagged names."
239 Add name
tags the lib files
, to diferentiate each library version
:
240 "-mt" for multi-threading.
242 "-s" for runtime static link
".
243 Might break compatibility with libraries that expect boost libs with default names.
246 config boost-single-thread
247 depends on boost-use-name-tags
248 bool "Single thread Support.
"
250 Compile Boost libraries in single-thread mode.
253 config boost-build-type-complete
254 depends on boost-use-name-tags
255 bool "Complete Boost Build.
"
257 Builds both release and debug libs. It will take much longer to compile.
261 menu "Select Boost libraries
"
262 depends on PACKAGE_boost
265 config boost-libs-all
266 bool "Include
all Boost libraries.
"
268 select PACKAGE_boost-libs
269 select boost-test-pkg
270 select boost-graph-parallel
272 config boost-test-pkg
273 bool "Boost
test package.
"
275 select PACKAGE_boost-test
277 config boost-graph-parallel
278 bool "Boost parallel graph support.
"
279 select PACKAGE_boost-graph
282 $(foreach lib,$(BOOST_LIBS),
283 config PACKAGE_boost-$(lib)
284 prompt "Boost
$(lib
) $(if
$(findstring python3
,$(lib
)),$(paren_left
)v
$(BOOST_PYTHON3_VER
)$(paren_right
) ,)library.
"
286 $(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
287 $(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
288 $(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
293 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
295 define Package/boost-test
296 $(call Package/boost/Default)
299 DEPENDS+=+boost-system +boost-timer
302 define Build/Configure
305 define Package/boost/Default/install
306 $(INSTALL_DIR) $(1)/usr/lib
307 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
311 # 2: dependencies on other boost libraries (short name)
312 # 3: dependencies on other packages
313 # 4: conditional/inward dependencies
314 # 5: dependencies compiled only when this package has been selected
315 define DefineBoostLibrary
316 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
317 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
321 define Package/boost-$(1)
322 $(call Package/boost/Default)
324 DEPENDS+= $(foreach lib,$(2),+boost-$(lib)) $(3) $(if $(4),@$(4),) $(patsubst %,+PACKAGE_boost-$(1):%,$(5))
328 define Package/boost-$(1)/description
329 This package contains the Boost $(1) library.
332 define Package/boost-$(1)/install
333 $(if $(CONFIG_boost-static-libs),true,$(call Package/boost/Default/install,$$(1),$(1)))
337 $(eval $(call DefineBoostLibrary,atomic,system))
338 $(eval $(call DefineBoostLibrary,chrono,system))
339 $(eval $(call DefineBoostLibrary,container))
340 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
341 $(eval $(call DefineBoostLibrary,contract,system))
342 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
343 $(eval $(call DefineBoostLibrary,date_time))
344 #$(eval $(call DefineBoostLibrary,exception,,))
345 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
346 $(eval $(call DefineBoostLibrary,filesystem,system atomic))
347 $(eval $(call DefineBoostLibrary,graph,regex))
348 $(eval $(call DefineBoostLibrary,iostreams,,,,zlib liblzma libbz2 libzstd))
349 $(eval $(call DefineBoostLibrary,json,container))
350 $(eval $(call DefineBoostLibrary,locale,system chrono thread,,,icu))
351 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
352 $(eval $(call DefineBoostLibrary,math))
353 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
354 $(eval $(call DefineBoostLibrary,nowide))
355 $(eval $(call DefineBoostLibrary,program_options))
356 $(eval $(call DefineBoostLibrary,python3,,,,python3-base))
357 $(eval $(call DefineBoostLibrary,random,system))
358 $(eval $(call DefineBoostLibrary,regex,,,,icu))
359 $(eval $(call DefineBoostLibrary,serialization))
360 $(eval $(call DefineBoostLibrary,wserialization,serialization))
361 $(eval $(call DefineBoostLibrary,stacktrace))
362 $(eval $(call DefineBoostLibrary,system))
363 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
364 $(eval $(call DefineBoostLibrary,timer,chrono))
365 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
366 $(eval $(call DefineBoostLibrary,url))
367 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
369 include $(INCLUDE_DIR)/host-build.mk
372 # b2 does not provide a configure-script nor a Makefile
373 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
375 ( cd $(HOST_BUILD_DIR) ; \
376 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
377 --with-libraries=context,filesystem,program_options,regex,system ;\
378 ./b2 --ignore-site-config install )
381 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
382 TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--gc-sections,--as-needed,--print-gc-sections
385 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto
387 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_10),-std=gnu++20,$(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17))
389 ifneq ($(findstring mips,$(ARCH)),)
391 ifneq ($(findstring 64,$(ARCH)),)
394 else ifneq ($(findstring arm,$(ARCH)),)
396 else ifeq ($(ARCH),aarch64)
405 $(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),))
406 ( cd $(PKG_BUILD_DIR) ; \
407 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
408 tools/build/src/user-config.jam ; \
411 --ignore-site-config \
412 --toolset=gcc abi=$(BOOST_ABI) \
413 --disable-long-double \
414 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
415 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
416 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
417 $(if $(CONFIG_boost-variant-release), variant=release,) \
418 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
419 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
420 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
421 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
422 $(if $(CONFIG_boost-shared-libs),link=shared,) \
423 $(if $(CONFIG_boost-static-libs),link=static,) \
424 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
425 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
426 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
427 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
428 $(if $(CONFIG_boost-single-thread),threading=single,) \
431 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
432 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
434 $(foreach lib,$(BOOST_LIBS), \
435 $(if $(findstring python3,$(lib)),, \
436 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
437 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
441 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.std=off boost.locale.posix=off) \
443 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
444 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
446 $(if $(CONFIG_PACKAGE_boost-python3), \
447 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
)\" ;" > \
448 tools/build/src/user-config.jam ; \
449 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
450 tools/build/src/user-config.jam; \
453 --ignore-site-config \
454 --toolset=gcc abi=$(BOOST_ABI) \
455 --disable-long-double \
456 $(if $(CONFIG_boost-variant-release), variant=release,) \
457 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
458 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
459 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
460 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
461 $(if $(CONFIG_boost-shared-libs),link=shared,) \
462 $(if $(CONFIG_boost-static-libs),link=static,) \
463 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
464 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
465 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
466 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
467 $(if $(CONFIG_boost-single-thread),threading=single,) \
475 define Build/InstallDev
477 $(1)/usr/include/boost/
480 $(PKG_INSTALL_DIR)/include/boost/* \
481 $(1)/usr/include/boost/ \
482 # copies _all_ header files - independent of <--with-library>-argument above
484 $(INSTALL_DIR) $(1)/usr/lib
485 # copies all cmake files, compiled archive and shared object files
486 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
490 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
491 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
494 define Package/boost-test/install
495 $(if $(CONFIG_boost-static-libs),true,
496 $(INSTALL_DIR) $(1)/usr/lib
497 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_{unit_test_framework,prg_exec_monitor}*.so* $(1)/usr/lib/
501 $(eval $(call HostBuild))
503 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildPackage,boost-$(lib))))
504 $(eval $(call BuildPackage,boost-test))
505 $(eval $(call BuildPackage,boost-libs))
506 $(eval $(call BuildPackage,boost))