2 # Copyright (C) 2015-2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 # Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
10 # Dude, this "boost" is really one of the most crude stuff I ported yet.
14 include $(TOPDIR
)/rules.mk
15 include $(INCLUDE_DIR
)/nls.mk
16 include $(INCLUDE_DIR
)/target.mk
20 PKG_SOURCE_VERSION
:=1_65_0
23 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
).
tar.bz2
24 PKG_SOURCE_URL
:=https
://sourceforge.net
/projects
/boost
/files
/boost
/$(PKG_VERSION
)
25 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
26 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
)
27 PKG_HASH
:=ea26712742e2fb079c2a566a31f3266973b76e38222b9f88b387e3c8b2f9902c
28 PKG_LICENSE
:=Boost Software License
<http
://www.boost.org
/users
/license.html
>
29 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
34 include $(INCLUDE_DIR
)/package.mk
35 include $(INCLUDE_DIR
)/host-build.mk
38 define Package
/boost
/Default
41 TITLE
:=Boost C
++ source library
42 URL
:=http
://www.boost.org
43 DEPENDS
:=+libstdcpp
+libpthread
+librt
46 define Package
/boost
/description
47 This package provides the Boost v1.65 libraries.
48 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
50 -----------------------------------------------------------------------------
52 | In order to build
all of the Boost Libraries
, it is necessary |
53 | to use
, at least
, GCC version
5 (C
++14 support
) and
, it is necessary to |
54 | compile the kernel with Full Language Support. |
55 | Without these requirerements
, the following libs will not be available
: |
57 |
- Boost.Coroutine2 |
59 -----------------------------------------------------------------------------
61 This package provides the following run-time libraries
:
66 - coroutine
(Deprecated
- use Coroutine2
)
67 - - coroutine2
(Requires GCC v5 and up
)
71 - fiber
(Requires GCC v5 and up
)
75 - locale
(Requires kernel being compiled with full language support
)
83 - serialization and wserialization
85 - stackstrace
(new in
1.65.0)
92 There are many more header-only libraries supported by Boost.
93 See more at http
://www.boost.org
/doc
/libs
/1_65_0
/
96 PKG_BUILD_DEPENDS
:=boost
/host PACKAGE_python
:python PACKAGE_python3
:python3
100 define Package
/boost-libs
101 $(call Package
/boost
/Default
)
103 DEPENDS
+= $(BOOST_DEPENDS
)
107 define Package
/boost-libs
/description
108 This meta package contains only dependencies to the other libraries from
109 the boost libraries collection.
112 # Create a meta-package of dependent libraries (for ALL)
113 define Package
/boost-libs
/install
117 define Package
/boost
/install
122 $(call Package
/boost
/Default
)
126 define Package
/boost
/config
127 menu
"Select Boost Options"
128 depends on PACKAGE_boost
129 comment
"Boost compilation options."
132 prompt
"Compile Boost libraries."
133 default boost-static-and-shared-libs
135 Choose which version to compile.
137 - Only Shared libs will be compiled.
139 - Only Static libs will be compiled.
141 - Both Static and Shared libs will be compiled.
143 config boost-shared-libs
146 config boost-static-libs
149 config boost-static-and-shared-libs
154 prompt
"Selects Boost Runtime linkage."
155 default boost-runtime-shared
157 Choose which C and C
++ runtimes to use
:
158 -> Use Shared runtimes.
159 -> Use Static runtimes.
160 - Not available if Shared libs are to be built.
161 -> Use both runtimes.
162 - Not available if Shared libs are to be built.
163 - Two separate versions of Boost are built
, linking each to a different runtime.
164 - This option requires
"Use tagged names" option to be active.
166 config boost-runtime-shared
169 config boost-runtime-static
170 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
173 config boost-runtime-static-and-shared
174 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
179 prompt
"Select a Variant."
180 default boost-variant-release
182 Chooses which boost variant should be selected
:
183 -> Release
: Optimizes Boost for release.
184 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
186 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
188 - Profiling
: On
; Debug Symbols
: On.
190 config boost-variant-release
193 config boost-variant-debug
196 config boost-variant-profile
200 config boost-use-name-tags
201 bool
"Use tagged names."
203 Add name
tags the lib files
, to diferentiate each library version
:
204 "-mt" for multi-threading.
206 "-s" for runtime static link
".
207 Might break compatibility with libraries that expect boost libs with default names.
210 config boost-single-thread
211 depends on @boost-use-name-tags
212 bool "Single thread Support.
"
214 Compile Boost libraries in single-thread mode.
217 config boost-build-type-complete
218 depends on @boost-use-name-tags
219 bool "Complete Boost Build.
"
221 Builds both release and debug libs. It will take much longer to compile.
225 menu "Select Boost libraries
"
226 depends on PACKAGE_boost
229 config boost-libs-all
230 bool "Include
all Boost libraries.
"
232 select PACKAGE_boost-libs
233 select boost-test-pkg
234 select boost-coroutine2
235 select boost-graph-parallel
237 config boost-test-pkg
238 bool "Boost
test package.
"
240 select PACKAGE_boost-test
242 config boost-coroutine2
243 depends on !@GCC_VERSION_4_8
244 bool "Boost couroutine2 support.
"
245 select PACKAGE_boost-coroutine
248 config boost-graph-parallel
249 bool "Boost parallel graph support.
"
250 select PACKAGE_boost-graph
253 $(foreach lib,$(BOOST_LIBS), \
254 config PACKAGE_boost-$(lib)
255 prompt "Boost
$(lib
) library.
"
257 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
258 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)
265 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
267 define Package/boost-test
268 $(call Package/boost/Default)
271 DEPENDS+=+boost-system +boost-timer
274 define Build/Configure
278 # 2: dependencies on other boost libraries (short name)
279 # 3: dependencies on other packages
280 # 4: conditional/inward dependencies
281 define DefineBoostLibrary
283 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
284 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
288 define Package/boost-$(1)
289 $(call Package/boost/Default)
291 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
295 define Package/boost-$(1)/description
296 This package contains the Boost $(1) library.
300 $(eval $(call DefineBoostLibrary,atomic,system,))
301 $(eval $(call DefineBoostLibrary,chrono,system,))
302 $(eval $(call DefineBoostLibrary,container,,))
303 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
304 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
305 $(eval $(call DefineBoostLibrary,date_time,,))
306 #$(eval $(call DefineBoostLibrary,exception,,))
307 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,))
308 $(eval $(call DefineBoostLibrary,filesystem,system,))
309 $(eval $(call DefineBoostLibrary,graph,regex,))
310 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma))
311 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
312 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
313 $(eval $(call DefineBoostLibrary,math,,))
314 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
315 $(eval $(call DefineBoostLibrary,program_options,,))
316 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
317 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
318 $(eval $(call DefineBoostLibrary,random,system,))
319 $(eval $(call DefineBoostLibrary,regex,,))
320 $(eval $(call DefineBoostLibrary,serialization,,))
321 $(eval $(call DefineBoostLibrary,wserialization,serialization,))
322 $(eval $(call DefineBoostLibrary,signals,,))
323 $(eval $(call DefineBoostLibrary,stacktrace,,))
324 $(eval $(call DefineBoostLibrary,system,,))
325 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
326 $(eval $(call DefineBoostLibrary,timer,chrono))
327 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
328 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
332 # b2 does not provide a configure-script nor a Makefile
333 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
336 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
337 TARGET_LDFLAGS += -pthread -lrt
340 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
341 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.6/) \
342 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
344 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
346 ifneq ($(findstring mips,$(ARCH)),)
348 ifneq ($(findstring 64,$(ARCH)),)
351 else ifneq ($(findstring arm,$(ARCH)),)
353 else ifeq ($(ARCH),aarch64)
362 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
363 ( cd $(PKG_BUILD_DIR) ; \
364 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(EXTRA_CXXFLAGS
)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > tools/build/src/user-config.jam ; \
365 $(if $(CONFIG_PACKAGE_boost-python3), \
366 echo "using python
: 3.6 : : $(STAGING_DIR
)/usr
/include/python3.6
/ : $(STAGING_DIR
)/usr
/lib
/libpython3.6.so
;" >> \
367 tools/build/src/user-config.jam; \
369 $(if $(CONFIG_PACKAGE_boost-python), \
370 echo "using python
: 2.7 : : $(STAGING_DIR
)/usr
/include/python2.7
/ : $(STAGING_DIR
)/usr
/lib
/libpython2.7.so
;" >> \
371 tools/build/src/user-config.jam; \
375 --ignore-site-config \
376 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
377 --disable-long-double \
378 $(if $(CONFIG_boost-variant-release), variant=release,) \
379 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
380 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
381 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
382 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
383 $(if $(CONFIG_boost-shared-libs),link=shared,) \
384 $(if $(CONFIG_boost-static-libs),link=static,) \
385 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
386 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
387 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
388 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
389 $(if $(CONFIG_boost-single-thread),threading=single,) \
392 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
393 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
394 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
395 $(foreach lib,$(BOOST_LIBS), \
396 $(if $(findstring python,$(lib)), \
397 $(if $(CONFIG_PACKAGE_boost-python),python=2.7,--without-python), \
398 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
400 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
401 boost.locale.iconv=off) \
403 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
404 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
408 --ignore-site-config \
409 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
410 --disable-long-double \
411 $(if $(CONFIG_boost-variant-release), variant=release,) \
412 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
413 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
414 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
415 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
416 $(if $(CONFIG_boost-shared-libs),link=shared,) \
417 $(if $(CONFIG_boost-static-libs),link=static,) \
418 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
419 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
420 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
421 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
422 $(if $(CONFIG_boost-single-thread),threading=single,) \
424 $(if $(CONFIG_PACKAGE_boost-python3),--with-python python=3.6,) \
429 define Build/InstallDev
431 $(1)/usr/include/boost/
434 $(PKG_INSTALL_DIR)/include/boost/* \
435 $(1)/usr/include/boost/ \
436 # copies _all_ header files - independent of <--with-library>-argument above
438 $(INSTALL_DIR) $(1)/usr/lib
439 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
440 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
445 $(STAGING_DIR_HOSTPKG)/bin
448 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
449 $(STAGING_DIR_HOSTPKG)/bin/
452 define Package/boost/Default/install
457 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2).so*' -exec $(CP) {} $(1)/usr/lib/ \;
459 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)_*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
462 define Package/boost-test/install
467 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
470 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
473 define BuildBoostLibrary
474 define Package/boost-$(1)/install
475 $(call Package/boost/Default/install,$$(1),$(1))
478 $$(eval $$(call BuildPackage,boost-$(1)))
481 $(eval $(call HostBuild))
483 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
484 $(eval $(call BuildPackage,boost-test))
485 $(eval $(call BuildPackage,boost-libs))
486 $(eval $(call BuildPackage,boost))