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_74_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
:=83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1
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.74
.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
)
70 - serialization and wserialization
78 There are many more header-only libraries supported by Boost.
79 See more at http
://www.boost.org
/doc
/libs
/1_74_0
/
82 PKG_BUILD_DEPENDS
:=boost
/host
84 include ..
/..
/lang
/python
/python3-version.mk
85 BOOST_PYTHON3_VER
=$(PYTHON3_VERSION
)
89 define Package
/boost-libs
90 $(call Package
/boost
/Default
)
92 DEPENDS
+= $(BOOST_DEPENDS
)
96 define Package
/boost-libs
/description
97 This meta package contains only dependencies to the other libraries from
98 the boost libraries collection.
101 # Create a meta-package of dependent libraries (for ALL)
102 define Package
/boost-libs
/install
106 define Package
/boost
/install
111 $(call Package
/boost
/Default
)
115 define Package
/boost
/config
116 # Invisible config dependency
117 config boost-context-exclude
119 default y if
(TARGET_arc770 || TARGET_archs38 || TARGET_octeon || TARGET_octeontx
)
122 config boost-coroutine-exclude
124 default y if boost-context-exclude
127 config boost-fiber-exclude
129 default y if boost-coroutine-exclude
132 menu
"Select Boost Options"
133 depends on PACKAGE_boost
134 comment
"Boost compilation options."
137 prompt
"Compile Visibility."
138 default boost-compile-visibility-hidden
140 Choose Boost symbols compilation visibility.
142 - a.k.a.
"default" in gcc documentation. Global symbols are considered public
,
143 they are exported from shared libraries and can be redefined by another
144 shared library or executable.
146 - a.k.a.
"symbolic". Protected symbols are exported from shared libraries but
147 cannot be redefined by another shared library or executable. This mode is
148 not supported on some platforms
, for example OS X.
150 - Hidden symbols are not exported from shared libraries and cannot be
151 redefined by a different shared library or executable loaded in a process.
152 In this mode
, public symbols have to be explicitly marked in the source code
153 to be exported from shared libraries. This is the recommended mode.
155 config boost-compile-visibility-global
158 config boost-compile-visibility-protected
161 config boost-compile-visibility-hidden
166 prompt
"Compile Boost libraries."
167 default boost-static-and-shared-libs
169 Choose which version to compile.
171 - Only Shared libs will be compiled.
173 - Only Static libs will be compiled.
175 - Both Static and Shared libs will be compiled.
177 config boost-shared-libs
180 config boost-static-libs
183 config boost-static-and-shared-libs
188 prompt
"Selects Boost Runtime linkage."
189 default boost-runtime-shared
191 Choose which C and C
++ runtimes to use
:
192 -> Use Shared runtimes.
193 -> Use Static runtimes.
194 - Not available if Shared libs are to be built.
195 -> Use both runtimes.
196 - Not available if Shared libs are to be built.
197 - Two separate versions of Boost are built
, linking each to a different runtime.
198 - This option requires
"Use tagged names" option to be active.
200 config boost-runtime-shared
203 config boost-runtime-static
204 depends on
(!boost-shared-libs
&& !boost-static-and-shared-libs
)
207 config boost-runtime-static-and-shared
208 depends on
(boost-use-name-tags
&& !boost-shared-libs
&& !boost-static-and-shared-libs
)
213 prompt
"Select a Variant."
214 default boost-variant-release
216 Chooses which boost variant should be selected
:
217 -> Release
: Optimizes Boost for release.
218 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
220 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
222 - Profiling
: On
; Debug Symbols
: On.
224 config boost-variant-release
227 config boost-variant-debug
230 config boost-variant-profile
234 config boost-use-name-tags
235 bool
"Use tagged names."
237 Add name
tags the lib files
, to diferentiate each library version
:
238 "-mt" for multi-threading.
240 "-s" for runtime static link
".
241 Might break compatibility with libraries that expect boost libs with default names.
244 config boost-single-thread
245 depends on boost-use-name-tags
246 bool "Single thread Support.
"
248 Compile Boost libraries in single-thread mode.
251 config boost-build-type-complete
252 depends on boost-use-name-tags
253 bool "Complete Boost Build.
"
255 Builds both release and debug libs. It will take much longer to compile.
259 menu "Select Boost libraries
"
260 depends on PACKAGE_boost
263 config boost-libs-all
264 bool "Include
all Boost libraries.
"
266 select PACKAGE_boost-libs
267 select boost-test-pkg
268 select boost-graph-parallel
270 config boost-test-pkg
271 bool "Boost
test package.
"
273 select PACKAGE_boost-test
275 config boost-graph-parallel
276 bool "Boost parallel graph support.
"
277 select PACKAGE_boost-graph
280 $(foreach lib,$(BOOST_LIBS),
281 config PACKAGE_boost-$(lib)
282 prompt "Boost
$(lib
) $(if
$(findstring python3
,$(lib
)),$(paren_left
)v
$(BOOST_PYTHON3_VER
)$(paren_right
) ,)library.
"
284 $(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
285 $(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
286 $(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
291 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
293 define Package/boost-test
294 $(call Package/boost/Default)
297 DEPENDS+=+boost-system +boost-timer
300 define Build/Configure
303 define Package/boost/Default/install
304 $(INSTALL_DIR) $(1)/usr/lib
305 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
309 # 2: dependencies on other boost libraries (short name)
310 # 3: dependencies on other packages
311 # 4: conditional/inward dependencies
312 # 5: dependencies compiled only when this package has been selected
313 define DefineBoostLibrary
314 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
315 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
319 define Package/boost-$(1)
320 $(call Package/boost/Default)
322 DEPENDS+= $(foreach lib,$(2),+boost-$(lib)) $(3) $(if $(4),@$(4),) $(patsubst %,+PACKAGE_boost-$(1):%,$(5))
326 define Package/boost-$(1)/description
327 This package contains the Boost $(1) library.
330 define Package/boost-$(1)/install
331 $(if $(CONFIG_boost-static-libs),true,$(call Package/boost/Default/install,$$(1),$(1)))
335 $(eval $(call DefineBoostLibrary,atomic,system))
336 $(eval $(call DefineBoostLibrary,chrono,system))
337 $(eval $(call DefineBoostLibrary,container))
338 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
339 $(eval $(call DefineBoostLibrary,contract,system))
340 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
341 $(eval $(call DefineBoostLibrary,date_time))
342 #$(eval $(call DefineBoostLibrary,exception,,))
343 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
344 $(eval $(call DefineBoostLibrary,filesystem,system))
345 $(eval $(call DefineBoostLibrary,graph,regex))
346 $(eval $(call DefineBoostLibrary,iostreams,,,,zlib liblzma libbz2 libzstd))
347 $(eval $(call DefineBoostLibrary,locale,system chrono thread,,,icu))
348 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
349 $(eval $(call DefineBoostLibrary,math))
350 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
351 $(eval $(call DefineBoostLibrary,nowide))
352 $(eval $(call DefineBoostLibrary,program_options))
353 $(eval $(call DefineBoostLibrary,python3,,,,python3-base))
354 $(eval $(call DefineBoostLibrary,random,system))
355 $(eval $(call DefineBoostLibrary,regex,,,,icu))
356 $(eval $(call DefineBoostLibrary,serialization))
357 $(eval $(call DefineBoostLibrary,wserialization,serialization))
358 $(eval $(call DefineBoostLibrary,stacktrace))
359 $(eval $(call DefineBoostLibrary,system))
360 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
361 $(eval $(call DefineBoostLibrary,timer,chrono))
362 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
363 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
365 include $(INCLUDE_DIR)/host-build.mk
368 # b2 does not provide a configure-script nor a Makefile
369 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
371 ( cd $(HOST_BUILD_DIR) ; \
372 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
373 --with-libraries=context,filesystem,program_options,regex,system ;\
374 ./b2 --ignore-site-config install )
377 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
378 TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--gc-sections,--as-needed,--print-gc-sections
381 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto
383 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_10),-std=gnu++20,$(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17))
385 ifneq ($(findstring mips,$(ARCH)),)
387 ifneq ($(findstring 64,$(ARCH)),)
390 else ifneq ($(findstring arm,$(ARCH)),)
392 else ifeq ($(ARCH),aarch64)
401 $(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),))
402 ( cd $(PKG_BUILD_DIR) ; \
403 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
404 tools/build/src/user-config.jam ; \
407 --ignore-site-config \
408 --toolset=gcc abi=$(BOOST_ABI) \
409 --disable-long-double \
410 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
411 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
412 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
413 $(if $(CONFIG_boost-variant-release), variant=release,) \
414 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
415 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
416 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
417 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
418 $(if $(CONFIG_boost-shared-libs),link=shared,) \
419 $(if $(CONFIG_boost-static-libs),link=static,) \
420 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
421 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
422 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
423 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
424 $(if $(CONFIG_boost-single-thread),threading=single,) \
427 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
428 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
430 $(foreach lib,$(BOOST_LIBS), \
431 $(if $(findstring python3,$(lib)),, \
432 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
433 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
437 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.std=off boost.locale.posix=off) \
439 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
440 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
442 $(if $(CONFIG_PACKAGE_boost-python3), \
443 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
)\" ;" > \
444 tools/build/src/user-config.jam ; \
445 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
446 tools/build/src/user-config.jam; \
449 --ignore-site-config \
450 --toolset=gcc abi=$(BOOST_ABI) \
451 --disable-long-double \
452 $(if $(CONFIG_boost-variant-release), variant=release,) \
453 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
454 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
455 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
456 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
457 $(if $(CONFIG_boost-shared-libs),link=shared,) \
458 $(if $(CONFIG_boost-static-libs),link=static,) \
459 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
460 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
461 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
462 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
463 $(if $(CONFIG_boost-single-thread),threading=single,) \
471 define Build/InstallDev
473 $(1)/usr/include/boost/
476 $(PKG_INSTALL_DIR)/include/boost/* \
477 $(1)/usr/include/boost/ \
478 # copies _all_ header files - independent of <--with-library>-argument above
480 $(INSTALL_DIR) $(1)/usr/lib
481 # copies all cmake files, compiled archive and shared object files
482 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
486 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
487 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
490 define Package/boost-test/install
491 $(if $(CONFIG_boost-static-libs),true,
492 $(INSTALL_DIR) $(1)/usr/lib
493 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_{unit_test_framework,prg_exec_monitor}*.so* $(1)/usr/lib/
497 $(eval $(call HostBuild))
499 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildPackage,boost-$(lib))))
500 $(eval $(call BuildPackage,boost-test))
501 $(eval $(call BuildPackage,boost-libs))
502 $(eval $(call BuildPackage,boost))