2 # Copyright (C) 2015-2016 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_62_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_MD5SUM
:=36c96b0f6155c98404091d8ceb48319a28279ca0333fba1ad8611eb90afb2ca0
28 PKG_LICENSE
:=Boost Software License
<http
://www.boost.org
/users
/license.html
>
29 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
31 PKG_BUILD_DEPENDS
+= boost
/host
35 include $(INCLUDE_DIR
)/package.mk
36 include $(INCLUDE_DIR
)/host-build.mk
39 define Package
/boost
/Default
42 TITLE
:=Boost C
++ source library
43 URL
:=http
://www.boost.org
44 DEPENDS
:=+libstdcpp
+libpthread
+librt
47 define Package
/boost
/description
48 This package provides the Boost v1.62 libraries.
49 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
51 -----------------------------------------------------------------------------
53 | In order to build
all of the Boost Libraries
, it is necessary |
54 | to use
, at least
, GCC version
5 (C
++14 support
) and
, it is necessary to |
55 | compile the kernel with Full Language Support. |
56 | Without these requirerements
, the following libs will not be available
: |
58 |
- Boost.Coroutine2 |
60 -----------------------------------------------------------------------------
62 This package provides the following run-time libraries
:
67 - coroutine
(Deprecated
- use Coroutine2
)
68 - - coroutine2
(Requires GCC v5 and up
)
72 - fiber
(Requires GCC v5 and up
) - BROKEN
76 - locale
(Requires kernel being compiled with full language support
)
91 There are many more header-only libraries supported by Boost.
92 See more at http
://www.boost.org
/doc
/libs
/1_62_0
/
97 define Package
/boost-libs
98 $(call Package
/boost
/Default
)
100 DEPENDS
+= $(BOOST_DEPENDS
)
104 define Package
/boost-libs
/description
105 This meta package contains only dependencies to the other libraries from
106 the boost libraries collection.
109 # Create a meta-package of dependent libraries (for ALL)
110 define Package
/boost-libs
/install
114 define Package
/boost
/install
120 $(call Package
/boost
/Default
)
122 DEPENDS
:=+ALL
:boost-libs
+ALL
:boost-test
125 define Package
/boost
/config
126 menu
"Select Boost Options"
127 depends on PACKAGE_boost
128 comment
"Boost compilation options."
131 prompt
"Compile Boost libraries."
132 default boost-static-and-shared-libs
134 Choose which version to compile.
136 - Only Shared libs will be compiled.
138 - Only Static libs will be compiled.
140 - Both Static and Shared libs will be compiled.
142 config boost-shared-libs
145 config boost-static-libs
148 config boost-static-and-shared-libs
153 prompt
"Selects Boost Runtime linkage."
154 default boost-runtime-shared
156 Choose which C and C
++ runtimes to use
:
157 -> Use Shared runtimes.
158 -> Use Static runtimes.
159 - Not available if Shared libs are to be built.
160 -> Use both runtimes.
161 - Not available if Shared libs are to be built.
162 - Two separate versions of Boost are built
, linking each to a different runtime.
163 - This option requires
"Use tagged names" option to be active.
165 config boost-runtime-shared
168 config boost-runtime-static
169 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
172 config boost-runtime-static-and-shared
173 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
178 prompt
"Select a Variant."
179 default boost-variant-release
181 Chooses which boost variant should be selected
:
182 -> Release
: Optimizes Boost for release.
183 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
185 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
187 - Profiling
: On
; Debug Symbols
: On.
189 config boost-variant-release
192 config boost-variant-debug
195 config boost-variant-profile
199 config boost-use-name-tags
200 bool
"Use tagged names."
202 Add name
tags the lib files
, to diferentiate each library version
:
203 "-mt" for multi-threading.
205 "-s" for runtime static link
".
206 Might break compatibility with libraries that expect boost libs with default names.
209 config boost-single-thread
210 depends on @boost-use-name-tags
211 bool "Single thread Support.
"
213 Compile Boost libraries in single-thread mode.
216 config boost-build-type-complete
217 depends on @boost-use-name-tags
218 bool "Complete Boost Build.
"
220 Builds both release and debug libs. It will take much longer to compile.
224 menu "Select Boost libraries
"
225 depends on PACKAGE_boost
228 config boost-libs-all
229 bool "Include
all Boost libraries.
"
230 select PACKAGE_boost-libs
231 select boost-test-pkg
232 select boost-coroutine2
233 select boost-graph-parallel
235 config boost-test-pkg
236 bool "Boost
test package.
"
237 select PACKAGE_boost-test
239 config boost-coroutine2
240 depends on !@GCC_VERSION_4_8
241 bool "Boost couroutine2 support.
"
242 select PACKAGE_boost-coroutine
245 config boost-graph-parallel
246 bool "Boost parallel graph support.
"
247 select PACKAGE_boost-graph
250 $(foreach lib,$(BOOST_LIBS), \
251 config PACKAGE_boost-$(lib)
252 prompt "Boost
$(lib
) library.
"
253 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)
254 $(if $(findstring fiber,$(lib)),depends on BROKEN,)
260 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
262 define Package/boost-test
263 $(call Package/boost/Default)
266 DEPENDS+=+boost-system +boost-timer
269 define Build/Configure
273 # 2: dependencies on other boost libraries (short name)
274 # 3: dependencies on other packages
275 define DefineBoostLibrary
277 BOOST_DEPENDS+= +boost-$(1)
280 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
282 define Package/boost-$(1)
283 $(call Package/boost/Default)
285 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3)
289 define Package/boost-$(1)/description
290 This package contains the Boost $(1) library.
295 $(eval $(call DefineBoostLibrary,atomic,system,))
296 $(eval $(call DefineBoostLibrary,chrono,system,))
297 $(eval $(call DefineBoostLibrary,container,,))
298 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
299 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
300 $(eval $(call DefineBoostLibrary,date_time,,))
301 #$(eval $(call DefineBoostLibrary,exception,,))
302 $(eval $(call DefineBoostLibrary,fiber,coroutine,@BROKEN))
303 $(eval $(call DefineBoostLibrary,filesystem,system,))
304 $(eval $(call DefineBoostLibrary,graph,regex,))
305 $(eval $(call DefineBoostLibrary,iostreams,,+PACKAGE_boost-iostreams:zlib))
306 $(eval $(call DefineBoostLibrary,locale,system,@BUILD_NLS $(ICONV_DEPENDS)))
307 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
308 $(eval $(call DefineBoostLibrary,math,,))
309 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
310 $(eval $(call DefineBoostLibrary,program_options,,))
311 $(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python))
312 $(eval $(call DefineBoostLibrary,python3,,+PACKAGE_boost-python3:python3))
313 $(eval $(call DefineBoostLibrary,random,system,))
314 $(eval $(call DefineBoostLibrary,regex,,))
315 $(eval $(call DefineBoostLibrary,serialization,,))
316 $(eval $(call DefineBoostLibrary,signals,,))
317 $(eval $(call DefineBoostLibrary,system,,))
318 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
319 $(eval $(call DefineBoostLibrary,timer,chrono))
320 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
324 # b2 does not provide a configure-script nor a Makefile
325 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
328 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
329 TARGET_LDFLAGS += -pthread -lrt
332 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
333 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
334 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
336 ifneq ($(findstring mips,$(ARCH)),)
338 ifneq ($(findstring 64,$(ARCH)),)
341 else ifneq ($(findstring arm,$(ARCH)),)
343 else ifeq ($(ARCH),aarch64)
352 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
353 ( cd $(PKG_BUILD_DIR) ; \
354 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(if
$(CONFIG_boost-coroutine2
),-std
=c
++14,)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > tools/build/src/user-config.jam ; \
355 $(if $(CONFIG_PACKAGE_boost-python3), \
356 echo "using python
: 3.5 : $(STAGING_DIR_ROOT
)/usr
/bin
/python3
: $(STAGING_DIR
)/usr
/include/python3.5
/ ;" >> \
357 tools/build/src/user-config.jam; \
359 $(if $(CONFIG_PACKAGE_boost-python), \
360 echo "using python
: 2.7 : $(STAGING_DIR_ROOT
)/usr
/bin
/python
: $(STAGING_DIR
)/usr
/include/python2.7
/ ;" >> \
361 tools/build/src/user-config.jam; \
365 --ignore-site-config \
366 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
367 --disable-long-double \
368 $(if $(CONFIG_boost-variant-release), variant=release,) \
369 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
370 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
371 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
372 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
373 $(if $(CONFIG_boost-shared-libs),link=shared,) \
374 $(if $(CONFIG_boost-static-libs),link=static,) \
375 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
376 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
377 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
378 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
379 $(if $(CONFIG_boost-single-thread),threading=single,) \
382 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
383 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
384 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
385 $(foreach lib,$(BOOST_LIBS), \
386 $(if $(findstring python,$(lib)), \
387 $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
388 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
390 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
391 boost.locale.iconv=off) \
393 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
394 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
399 define Build/InstallDev
401 $(1)/usr/include/boost/
404 $(PKG_INSTALL_DIR)/include/boost/* \
405 $(1)/usr/include/boost/ \
406 # copies _all_ header files - independent of <--with-library>-argument above
408 $(INSTALL_DIR) $(1)/usr/lib
409 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
410 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
415 $(STAGING_DIR)/host/bin
418 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
419 $(STAGING_DIR)/host/bin/
422 define Package/boost/Default/install
427 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
430 define Package/boost-test/install
435 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
438 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
441 define BuildBoostLibrary
442 define Package/boost-$(1)/install
443 $(call Package/boost/Default/install,$$(1),$(1))
446 $$(eval $$(call BuildPackage,boost-$(1)))
449 $(eval $(call HostBuild))
451 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
452 $(eval $(call BuildPackage,boost-test))
453 $(eval $(call BuildPackage,boost-libs))
454 $(eval $(call BuildPackage,boost))