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_72_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
:=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722
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
35 include $(INCLUDE_DIR
)/nls.mk
37 define Package
/boost
/Default
40 TITLE
:=Boost C
++ source library
41 URL
:=https
://www.boost.org
42 DEPENDS
:=+libstdcpp
+libpthread
+librt
45 define Package
/boost
/description
46 This package provides the Boost v1.72
.0 libraries.
47 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
49 This package provides the following run-time libraries
:
55 - coroutine and coroutine2
(Coroutine is deprecated
- use Coroutine2
)
63 - locale
(Requires kernel being compiled with full language support
)
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_72_0
/
82 PKG_BUILD_DEPENDS
:=boost
/host PACKAGE_python3
:python3
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 locale,$(lib)),depends on BUILD_NLS,)\
285 $(if $(findstring python3,$(lib)),depends on PACKAGE_python3,)\
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
306 # 2: dependencies on other boost libraries (short name)
307 # 3: dependencies on other packages
308 # 4: conditional/inward dependencies
309 define DefineBoostLibrary
311 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
312 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
316 define Package/boost-$(1)
317 $(call Package/boost/Default)
319 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
323 define Package/boost-$(1)/description
324 This package contains the Boost $(1) library.
328 $(eval $(call DefineBoostLibrary,atomic,system))
329 $(eval $(call DefineBoostLibrary,chrono,system))
330 $(eval $(call DefineBoostLibrary,container))
331 $(eval $(call DefineBoostLibrary,context,chrono system,,!boost-context-exclude))
332 $(eval $(call DefineBoostLibrary,contract,system))
333 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
334 $(eval $(call DefineBoostLibrary,date_time))
335 #$(eval $(call DefineBoostLibrary,exception,,))
336 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
337 $(eval $(call DefineBoostLibrary,filesystem,system))
338 $(eval $(call DefineBoostLibrary,graph,regex))
339 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2 +zstd))
340 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
341 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
342 $(eval $(call DefineBoostLibrary,math))
343 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
344 $(eval $(call DefineBoostLibrary,program_options))
345 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
346 $(eval $(call DefineBoostLibrary,random,system))
347 $(eval $(call DefineBoostLibrary,regex))
348 $(eval $(call DefineBoostLibrary,serialization))
349 $(eval $(call DefineBoostLibrary,wserialization,serialization))
350 $(eval $(call DefineBoostLibrary,stacktrace))
351 $(eval $(call DefineBoostLibrary,system))
352 $(eval $(call DefineBoostLibrary,thread,system chrono atomic))
353 $(eval $(call DefineBoostLibrary,timer,chrono))
354 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
355 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
357 include $(INCLUDE_DIR)/host-build.mk
360 # b2 does not provide a configure-script nor a Makefile
361 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
363 ( cd $(HOST_BUILD_DIR) ; \
364 ./bootstrap.sh --prefix=$(STAGING_DIR_HOSTPKG) \
365 --with-libraries=context,filesystem,program_options,regex,system ;\
366 ./b2 --ignore-site-config install )
369 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
370 TARGET_LDFLAGS += -pthread -lrt
373 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
375 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17)
377 ifneq ($(findstring mips,$(ARCH)),)
379 ifneq ($(findstring 64,$(ARCH)),)
382 else ifneq ($(findstring arm,$(ARCH)),)
384 else ifeq ($(ARCH),aarch64)
393 $(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),))
394 ( cd $(PKG_BUILD_DIR) ; \
395 echo "using gcc
: $(GCC_VERSION
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > \
396 tools/build/src/user-config.jam ; \
399 --ignore-site-config \
400 --toolset=gcc abi=$(BOOST_ABI) \
401 --disable-long-double \
402 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
403 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
404 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
405 $(if $(CONFIG_boost-variant-release), variant=release,) \
406 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
407 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
408 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
409 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
410 $(if $(CONFIG_boost-shared-libs),link=shared,) \
411 $(if $(CONFIG_boost-static-libs),link=static,) \
412 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
413 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
414 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
415 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
416 $(if $(CONFIG_boost-single-thread),threading=single,) \
419 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
420 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
422 $(foreach lib,$(BOOST_LIBS), \
423 $(if $(findstring python3,$(lib)),, \
424 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
425 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
429 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
430 boost.locale.iconv=off) \
432 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
433 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
435 $(if $(CONFIG_PACKAGE_boost-python3), \
436 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
)\" ;" > \
437 tools/build/src/user-config.jam ; \
438 echo "using python
: $(BOOST_PYTHON3_VER
) : : $(STAGING_DIR
)/usr
/include/python
$(BOOST_PYTHON3_VER
)/ : $(STAGING_DIR
)/usr
/lib
/libpython
$(BOOST_PYTHON3_VER
).so
;" >> \
439 tools/build/src/user-config.jam; \
442 --ignore-site-config \
443 --toolset=gcc abi=$(BOOST_ABI) \
444 --disable-long-double \
445 $(if $(CONFIG_boost-variant-release), variant=release,) \
446 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
447 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
448 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
449 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
450 $(if $(CONFIG_boost-shared-libs),link=shared,) \
451 $(if $(CONFIG_boost-static-libs),link=static,) \
452 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
453 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
454 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
455 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
456 $(if $(CONFIG_boost-single-thread),threading=single,) \
464 define Build/InstallDev
466 $(1)/usr/include/boost/
469 $(PKG_INSTALL_DIR)/include/boost/* \
470 $(1)/usr/include/boost/ \
471 # copies _all_ header files - independent of <--with-library>-argument above
473 $(INSTALL_DIR) $(1)/usr/lib
474 # copies all cmake files, compiled archive and shared object files
475 $(CP) -v $(PKG_INSTALL_DIR)/lib/{*.{a,so*},cmake} $(1)/usr/lib/ || :
479 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
480 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
483 define Package/boost/Default/install
484 $(INSTALL_DIR) $(1)/usr/lib
485 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
488 define Package/boost-test/install
489 $(INSTALL_DIR) $(1)/usr/lib
490 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* $(1)/usr/lib/
491 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* $(1)/usr/lib/
494 define BuildBoostLibrary
495 define Package/boost-$(1)/install
496 $(call Package/boost/Default/install,$$(1),$(1))
499 $$(eval $$(call BuildPackage,boost-$(1)))
502 $(eval $(call HostBuild))
504 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
505 $(eval $(call BuildPackage,boost-test))
506 $(eval $(call BuildPackage,boost-libs))
507 $(eval $(call BuildPackage,boost))