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_76_0
16 PKG_RELEASE
:=$(AUTORELEASE
)
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
:=f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41
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.76
.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
79 There are many more header-only libraries supported by Boost.
80 See more at http
://www.boost.org
/doc
/libs
/1_76_0
/
83 PKG_BUILD_DEPENDS
:=boost
/host
85 include ..
/..
/lang
/python
/python3-version.mk
86 BOOST_PYTHON3_VER
=$(PYTHON3_VERSION
)
90 define Package
/boost-libs
91 $(call Package
/boost
/Default
)
93 DEPENDS
+= $(BOOST_DEPENDS
)
97 define Package
/boost-libs
/description
98 This meta package contains only dependencies to the other libraries from
99 the boost libraries collection.
102 # Create a meta-package of dependent libraries (for ALL)
103 define Package
/boost-libs
/install
107 define Package
/boost
/install
112 $(call Package
/boost
/Default
)
116 define Package
/boost
/config
117 # Invisible config dependency
118 config boost-context-exclude
120 default y if
(TARGET_arc770 || TARGET_archs38
)
123 config boost-coroutine-exclude
125 default y if boost-context-exclude
128 config boost-fiber-exclude
130 default y if boost-coroutine-exclude
133 menu
"Select Boost Options"
134 depends on PACKAGE_boost
135 comment
"Boost compilation options."
138 prompt
"Compile Visibility."
139 default boost-compile-visibility-hidden
141 Choose Boost symbols compilation visibility.
143 - a.k.a.
"default" in gcc documentation. Global symbols are considered public
,
144 they are exported from shared libraries and can be redefined by another
145 shared library or executable.
147 - a.k.a.
"symbolic". Protected symbols are exported from shared libraries but
148 cannot be redefined by another shared library or executable. This mode is
149 not supported on some platforms
, for example OS X.
151 - Hidden symbols are not exported from shared libraries and cannot be
152 redefined by a different shared library or executable loaded in a process.
153 In this mode
, public symbols have to be explicitly marked in the source code
154 to be exported from shared libraries. This is the recommended mode.
156 config boost-compile-visibility-global
159 config boost-compile-visibility-protected
162 config boost-compile-visibility-hidden
167 prompt
"Compile Boost libraries."
168 default boost-static-and-shared-libs
170 Choose which version to compile.
172 - Only Shared libs will be compiled.
174 - Only Static libs will be compiled.
176 - Both Static and Shared libs will be compiled.
178 config boost-shared-libs
181 config boost-static-libs
184 config boost-static-and-shared-libs
189 prompt
"Selects Boost Runtime linkage."
190 default boost-runtime-shared
192 Choose which C and C
++ runtimes to use
:
193 -> Use Shared runtimes.
194 -> Use Static runtimes.
195 - Not available if Shared libs are to be built.
196 -> Use both runtimes.
197 - Not available if Shared libs are to be built.
198 - Two separate versions of Boost are built
, linking each to a different runtime.
199 - This option requires
"Use tagged names" option to be active.
201 config boost-runtime-shared
204 config boost-runtime-static
205 depends on
(!boost-shared-libs
&& !boost-static-and-shared-libs
)
208 config boost-runtime-static-and-shared
209 depends on
(boost-use-name-tags
&& !boost-shared-libs
&& !boost-static-and-shared-libs
)
214 prompt
"Select a Variant."
215 default boost-variant-release
217 Chooses which boost variant should be selected
:
218 -> Release
: Optimizes Boost for release.
219 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
221 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
223 - Profiling
: On
; Debug Symbols
: On.
225 config boost-variant-release
228 config boost-variant-debug
231 config boost-variant-profile
235 config boost-use-name-tags
236 bool
"Use tagged names."
238 Add name
tags the lib files
, to diferentiate each library version
:
239 "-mt" for multi-threading.
241 "-s" for runtime static link
".
242 Might break compatibility with libraries that expect boost libs with default names.
245 config boost-single-thread
246 depends on boost-use-name-tags
247 bool "Single thread Support.
"
249 Compile Boost libraries in single-thread mode.
252 config boost-build-type-complete
253 depends on boost-use-name-tags
254 bool "Complete Boost Build.
"
256 Builds both release and debug libs. It will take much longer to compile.
260 menu "Select Boost libraries
"
261 depends on PACKAGE_boost
264 config boost-libs-all
265 bool "Include
all Boost libraries.
"
267 select PACKAGE_boost-libs
268 select boost-test-pkg
269 select boost-graph-parallel
271 config boost-test-pkg
272 bool "Boost
test package.
"
274 select PACKAGE_boost-test
276 config boost-graph-parallel
277 bool "Boost parallel graph support.
"
278 select PACKAGE_boost-graph
281 $(foreach lib,$(BOOST_LIBS),
282 config PACKAGE_boost-$(lib)
283 prompt "Boost
$(lib
) $(if
$(findstring python3
,$(lib
)),$(paren_left
)v
$(BOOST_PYTHON3_VER
)$(paren_right
) ,)library.
"
285 $(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
286 $(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
287 $(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
292 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
294 define Package/boost-test
295 $(call Package/boost/Default)
298 DEPENDS+=+boost-system +boost-timer
301 define Build/Configure
304 define Package/boost/Default/install
305 $(INSTALL_DIR) $(1)/usr/lib
306 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
310 # 2: dependencies on other boost libraries (short name)
311 # 3: dependencies on other packages
312 # 4: conditional/inward dependencies
313 # 5: dependencies compiled only when this package has been selected
314 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),) $(patsubst %,+PACKAGE_boost-$(1):%,$(5))
327 define Package/boost-$(1)/description
328 This package contains the Boost $(1) library.
331 define Package/boost-$(1)/install
332 $(if $(CONFIG_boost-static-libs),true,$(call Package/boost/Default/install,$$(1),$(1)))
336 $(eval $(call DefineBoostLibrary,atomic,system))
337 $(eval $(call DefineBoostLibrary,chrono,system))
338 $(eval $(call DefineBoostLibrary,container))
339 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
340 $(eval $(call DefineBoostLibrary,contract,system))
341 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
342 $(eval $(call DefineBoostLibrary,date_time))
343 #$(eval $(call DefineBoostLibrary,exception,,))
344 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
345 $(eval $(call DefineBoostLibrary,filesystem,system))
346 $(eval $(call DefineBoostLibrary,graph,regex))
347 $(eval $(call DefineBoostLibrary,iostreams,,,,zlib liblzma libbz2 libzstd))
348 $(eval $(call DefineBoostLibrary,json,container))
349 $(eval $(call DefineBoostLibrary,locale,system chrono thread,,,icu))
350 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
351 $(eval $(call DefineBoostLibrary,math))
352 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
353 $(eval $(call DefineBoostLibrary,nowide))
354 $(eval $(call DefineBoostLibrary,program_options))
355 $(eval $(call DefineBoostLibrary,python3,,,,python3-base))
356 $(eval $(call DefineBoostLibrary,random,system))
357 $(eval $(call DefineBoostLibrary,regex,,,,icu))
358 $(eval $(call DefineBoostLibrary,serialization))
359 $(eval $(call DefineBoostLibrary,wserialization,serialization))
360 $(eval $(call DefineBoostLibrary,stacktrace))
361 $(eval $(call DefineBoostLibrary,system))
362 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
363 $(eval $(call DefineBoostLibrary,timer,chrono))
364 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
365 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
367 include $(INCLUDE_DIR)/host-build.mk
370 # b2 does not provide a configure-script nor a Makefile
371 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
373 ( cd $(HOST_BUILD_DIR) ; \
374 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
375 --with-libraries=context,filesystem,program_options,regex,system ;\
376 ./b2 --ignore-site-config install )
379 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
380 TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--gc-sections,--as-needed,--print-gc-sections
383 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto
385 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_10),-std=gnu++20,$(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17))
387 ifneq ($(findstring mips,$(ARCH)),)
389 ifneq ($(findstring 64,$(ARCH)),)
392 else ifneq ($(findstring arm,$(ARCH)),)
394 else ifeq ($(ARCH),aarch64)
403 $(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),))
404 ( cd $(PKG_BUILD_DIR) ; \
405 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
406 tools/build/src/user-config.jam ; \
409 --ignore-site-config \
410 --toolset=gcc abi=$(BOOST_ABI) \
411 --disable-long-double \
412 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
413 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
414 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
415 $(if $(CONFIG_boost-variant-release), variant=release,) \
416 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
417 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
418 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
419 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
420 $(if $(CONFIG_boost-shared-libs),link=shared,) \
421 $(if $(CONFIG_boost-static-libs),link=static,) \
422 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
423 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
424 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
425 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
426 $(if $(CONFIG_boost-single-thread),threading=single,) \
429 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
430 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
432 $(foreach lib,$(BOOST_LIBS), \
433 $(if $(findstring python3,$(lib)),, \
434 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
435 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
439 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.std=off boost.locale.posix=off) \
441 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
442 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
444 $(if $(CONFIG_PACKAGE_boost-python3), \
445 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
)\" ;" > \
446 tools/build/src/user-config.jam ; \
447 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
448 tools/build/src/user-config.jam; \
451 --ignore-site-config \
452 --toolset=gcc abi=$(BOOST_ABI) \
453 --disable-long-double \
454 $(if $(CONFIG_boost-variant-release), variant=release,) \
455 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
456 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
457 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
458 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
459 $(if $(CONFIG_boost-shared-libs),link=shared,) \
460 $(if $(CONFIG_boost-static-libs),link=static,) \
461 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
462 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
463 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
464 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
465 $(if $(CONFIG_boost-single-thread),threading=single,) \
473 define Build/InstallDev
475 $(1)/usr/include/boost/
478 $(PKG_INSTALL_DIR)/include/boost/* \
479 $(1)/usr/include/boost/ \
480 # copies _all_ header files - independent of <--with-library>-argument above
482 $(INSTALL_DIR) $(1)/usr/lib
483 # copies all cmake files, compiled archive and shared object files
484 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
488 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
489 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
492 define Package/boost-test/install
493 $(if $(CONFIG_boost-static-libs),true,
494 $(INSTALL_DIR) $(1)/usr/lib
495 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_{unit_test_framework,prg_exec_monitor}*.so* $(1)/usr/lib/
499 $(eval $(call HostBuild))
501 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildPackage,boost-$(lib))))
502 $(eval $(call BuildPackage,boost-test))
503 $(eval $(call BuildPackage,boost-libs))
504 $(eval $(call BuildPackage,boost))