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
>
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.62 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
) - BROKEN
75 - locale
(Requires kernel being compiled with full language support
)
90 There are many more header-only libraries supported by Boost.
91 See more at http
://www.boost.org
/doc
/libs
/1_62_0
/
94 PKG_BUILD_DEPENDS
:=boost
/host
95 HOST_BUILD_DEPENDS
:=PACKAGE_python
:python
/host PACKAGE_python3
:python3
/host
99 define Package
/boost-libs
100 $(call Package
/boost
/Default
)
102 DEPENDS
+= $(BOOST_DEPENDS
)
106 define Package
/boost-libs
/description
107 This meta package contains only dependencies to the other libraries from
108 the boost libraries collection.
111 # Create a meta-package of dependent libraries (for ALL)
112 define Package
/boost-libs
/install
116 define Package
/boost
/install
121 $(call Package
/boost
/Default
)
123 DEPENDS
:=+ALL
:boost-libs
+ALL
:boost-test
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.
"
231 select PACKAGE_boost-libs
232 select boost-test-pkg
233 select boost-coroutine2
234 select boost-graph-parallel
236 config boost-test-pkg
237 bool "Boost
test package.
"
238 select PACKAGE_boost-test
240 config boost-coroutine2
241 depends on !@GCC_VERSION_4_8
242 bool "Boost couroutine2 support.
"
243 select PACKAGE_boost-coroutine
246 config boost-graph-parallel
247 bool "Boost parallel graph support.
"
248 select PACKAGE_boost-graph
251 $(foreach lib,$(BOOST_LIBS), \
252 config PACKAGE_boost-$(lib)
253 prompt "Boost
$(lib
) library.
"
255 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
256 $(if $(findstring fiber,$(lib)),depends on BROKEN,)\
257 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)
264 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
266 define Package/boost-test
267 $(call Package/boost/Default)
270 DEPENDS+=+boost-system +boost-timer
273 define Build/Configure
277 # 2: dependencies on other boost libraries (short name)
278 # 3: dependencies on other packages
279 # 4: conditional/inward dependencies
280 define DefineBoostLibrary
282 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
283 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
287 define Package/boost-$(1)
288 $(call Package/boost/Default)
290 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
294 define Package/boost-$(1)/description
295 This package contains the Boost $(1) library.
299 $(eval $(call DefineBoostLibrary,atomic,system,))
300 $(eval $(call DefineBoostLibrary,chrono,system,))
301 $(eval $(call DefineBoostLibrary,container,,))
302 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
303 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
304 $(eval $(call DefineBoostLibrary,date_time,,))
305 #$(eval $(call DefineBoostLibrary,exception,,))
306 $(eval $(call DefineBoostLibrary,fiber,coroutine,,BROKEN))
307 $(eval $(call DefineBoostLibrary,filesystem,system,))
308 $(eval $(call DefineBoostLibrary,graph,regex,))
309 $(eval $(call DefineBoostLibrary,iostreams,,+zlib))
310 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
311 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
312 $(eval $(call DefineBoostLibrary,math,,))
313 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
314 $(eval $(call DefineBoostLibrary,program_options,,))
315 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
316 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
317 $(eval $(call DefineBoostLibrary,random,system,))
318 $(eval $(call DefineBoostLibrary,regex,,))
319 $(eval $(call DefineBoostLibrary,serialization,,))
320 $(eval $(call DefineBoostLibrary,signals,,))
321 $(eval $(call DefineBoostLibrary,system,,))
322 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
323 $(eval $(call DefineBoostLibrary,timer,chrono))
324 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
328 # b2 does not provide a configure-script nor a Makefile
329 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
332 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
333 TARGET_LDFLAGS += -pthread -lrt
336 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
337 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
338 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
340 ifneq ($(findstring mips,$(ARCH)),)
342 ifneq ($(findstring 64,$(ARCH)),)
345 else ifneq ($(findstring arm,$(ARCH)),)
347 else ifeq ($(ARCH),aarch64)
356 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
357 ( cd $(PKG_BUILD_DIR) ; \
358 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 ; \
359 $(if $(CONFIG_PACKAGE_boost-python3), \
360 echo "using python
: 3.5 : $(STAGING_DIR_ROOT
)/usr
/bin
/python3
: $(STAGING_DIR
)/usr
/include/python3.5
/ ;" >> \
361 tools/build/src/user-config.jam; \
363 $(if $(CONFIG_PACKAGE_boost-python), \
364 echo "using python
: 2.7 : $(STAGING_DIR_ROOT
)/usr
/bin
/python
: $(STAGING_DIR
)/usr
/include/python2.7
/ ;" >> \
365 tools/build/src/user-config.jam; \
369 --ignore-site-config \
370 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
371 --disable-long-double \
372 $(if $(CONFIG_boost-variant-release), variant=release,) \
373 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
374 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
375 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
376 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
377 $(if $(CONFIG_boost-shared-libs),link=shared,) \
378 $(if $(CONFIG_boost-static-libs),link=static,) \
379 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
380 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
381 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
382 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
383 $(if $(CONFIG_boost-single-thread),threading=single,) \
386 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
387 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
388 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
389 $(foreach lib,$(BOOST_LIBS), \
390 $(if $(findstring python,$(lib)), \
391 $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
392 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
394 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
395 boost.locale.iconv=off) \
397 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
398 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
403 define Build/InstallDev
405 $(1)/usr/include/boost/
408 $(PKG_INSTALL_DIR)/include/boost/* \
409 $(1)/usr/include/boost/ \
410 # copies _all_ header files - independent of <--with-library>-argument above
412 $(INSTALL_DIR) $(1)/usr/lib
413 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
414 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
419 $(STAGING_DIR)/host/bin
422 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
423 $(STAGING_DIR)/host/bin/
426 define Package/boost/Default/install
431 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
434 define Package/boost-test/install
439 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
442 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
445 define BuildBoostLibrary
446 define Package/boost-$(1)/install
447 $(call Package/boost/Default/install,$$(1),$(1))
450 $$(eval $$(call BuildPackage,boost-$(1)))
453 $(eval $(call HostBuild))
455 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
456 $(eval $(call BuildPackage,boost-test))
457 $(eval $(call BuildPackage,boost-libs))
458 $(eval $(call BuildPackage,boost))