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_61_0
23 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_SOURCE_VERSION
).
tar.gz
24 PKG_SOURCE_URL
:=@SF
/boost
/$(PKG_NAME
)/$(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
:=874805ba2e2ee415b1877ef3297bf8ad
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.61 libraries.
49 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
50 This package provides the following run-time libraries
:
56 - - coroutine2
(requires GCC v5 and up
)
63 - locale
(requires kernel being compiled with full language support
)
77 There are many more header-only libraries supported by Boost.
78 See more at http
://www.boost.org
/doc
/libs
/1_61_0
/
83 define Package
/boost-libs
84 $(call Package
/boost
/Default
)
86 DEPENDS
+= $(BOOST_DEPENDS
)
90 define Package
/boost-libs
/description
91 This meta package contains only dependencies to the other libraries from
92 the boost libraries collection.
95 # Create a meta-package of dependent libraries (for ALL)
96 define Package
/boost-libs
/install
100 define Package
/boost
/install
106 $(call Package
/boost
/Default
)
108 DEPENDS
:=+ALL
:boost-libs
+ALL
:boost-test
111 define Package
/boost
/config
112 menu
"Select Boost Options"
113 depends on PACKAGE_boost
114 comment
"Boost compilation options."
117 prompt
"Compile Boost libraries."
118 default boost-static-and-shared-libs
120 Choose which version to compile.
122 - Only Shared libs will be compiled.
124 - Only Static libs will be compiled.
126 - Both Static and Shared libs will be compiled.
128 config boost-shared-libs
131 config boost-static-libs
134 config boost-static-and-shared-libs
139 prompt
"Selects Boost Runtime linkage."
140 default boost-runtime-shared
142 Choose which C and C
++ runtimes to use
:
143 -> Use Shared runtimes.
144 -> Use Static runtimes.
145 - Not available if Shared libs are to be built.
146 -> Use both runtimes.
147 - Not available if Shared libs are to be built.
148 - Two separate versions of Boost are built
, linking each to a different runtime.
149 - This option requires
"Use tagged names" option to be active.
151 config boost-runtime-shared
154 config boost-runtime-static
155 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
158 config boost-runtime-static-and-shared
159 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
164 prompt
"Select a Variant."
165 default boost-variant-release
167 Chooses which boost variant should be selected
:
168 -> Release
: Optimizes Boost for release.
169 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
171 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
173 - Profiling
: On
; Debug Symbols
: On.
175 config boost-variant-release
178 config boost-variant-debug
181 config boost-variant-profile
185 config boost-use-name-tags
186 bool
"Use tagged names."
188 Add name
tags the lib files
, to diferentiate each library version
:
189 "-mt" for multi-threading.
191 "-s" for runtime static link
".
192 Might break compatibility with libraries that expect boost libs with default names.
195 config boost-single-thread
196 depends on @boost-use-name-tags
197 bool "Single thread Support.
"
199 Compile Boost libraries in single-thread mode.
202 config boost-build-type-complete
203 depends on @boost-use-name-tags
204 bool "Complete Boost Build.
"
206 Builds both release and debug libs. It will take much longer to compile.
210 menu "Select Boost libraries
"
211 depends on PACKAGE_boost
214 config boost-libs-all
215 bool "Include
all Boost libraries.
"
216 select PACKAGE_boost-libs
218 config boost-test-pkg
219 bool "Boost
test package.
"
220 select PACKAGE_boost-test
222 config boost-coroutine2
223 depends on @(GCC_VERSION_5 || GCC_VERSION_6)
224 bool "Boost couroutine2 support.
"
225 select PACKAGE_boost-coroutine
228 config boost-graph-parallel
229 bool "Boost parallel graph support.
"
230 select PACKAGE_boost-graph
233 $(foreach lib,$(BOOST_LIBS), \
234 config PACKAGE_boost-$(lib)
235 prompt "Boost
$(lib
) library.
"
236 $(if $(findstring locale,$(lib)),depends on @BUILD_NLS,)
242 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
244 define Package/boost-test
245 $(call Package/boost/Default)
248 DEPENDS+=+boost-system +boost-timer
251 define Build/Configure
255 # 2: dependencies on other boost libraries (short name)
256 # 3: dependencies on other packages
257 define DefineBoostLibrary
259 BOOST_DEPENDS+= +boost-$(1)
262 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
264 define Package/boost-$(1)
265 $(call Package/boost/Default)
267 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3)
271 define Package/boost-$(1)/description
272 This package contains the Boost $(1) library.
277 $(eval $(call DefineBoostLibrary,atomic,system,))
278 $(eval $(call DefineBoostLibrary,chrono,system,))
279 $(eval $(call DefineBoostLibrary,container,,))
280 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
281 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
282 $(eval $(call DefineBoostLibrary,date_time,,))
283 #$(eval $(call DefineBoostLibrary,exception,,))
284 $(eval $(call DefineBoostLibrary,filesystem,system,))
285 $(eval $(call DefineBoostLibrary,graph,regex,))
286 $(eval $(call DefineBoostLibrary,iostreams,,+PACKAGE_boost-iostreams:zlib))
287 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS)))
288 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
289 $(eval $(call DefineBoostLibrary,math,,))
290 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
291 $(eval $(call DefineBoostLibrary,program_options,,))
292 $(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python))
293 $(eval $(call DefineBoostLibrary,python3,,+PACKAGE_boost-python3:python3))
294 $(eval $(call DefineBoostLibrary,random,system,))
295 $(eval $(call DefineBoostLibrary,regex,,))
296 $(eval $(call DefineBoostLibrary,serialization,,))
297 $(eval $(call DefineBoostLibrary,signals,,))
298 $(eval $(call DefineBoostLibrary,system,,))
299 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
300 $(eval $(call DefineBoostLibrary,timer,chrono))
301 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
305 # b2 does not provide a configure-script nor a Makefile
306 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
309 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
310 TARGET_LDFLAGS += -pthread -lrt
313 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
314 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
315 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
317 ifneq ($(findstring mips,$(ARCH)),)
319 ifneq ($(findstring 64,$(ARCH)),)
322 else ifneq ($(findstring arm,$(ARCH)),)
324 else ifeq ($(ARCH),aarch64)
333 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
334 ( cd $(PKG_BUILD_DIR) ; \
335 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 ; \
336 $(if $(CONFIG_PACKAGE_boost-python3), \
337 echo "using python
: 3.5 : $(STAGING_DIR_ROOT
)/usr
/bin
/python3
: $(STAGING_DIR
)/usr
/include/python3.5
/ ;" >> \
338 tools/build/src/user-config.jam; \
340 $(if $(CONFIG_PACKAGE_boost-python), \
341 echo "using python
: 2.7 : $(STAGING_DIR_ROOT
)/usr
/bin
/python
: $(STAGING_DIR
)/usr
/include/python2.7
/ ;" >> \
342 tools/build/src/user-config.jam; \
346 --ignore-site-config \
347 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
348 --disable-long-double \
349 $(if $(CONFIG_boost-variant-release), variant=release,) \
350 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
351 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
352 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
353 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
354 $(if $(CONFIG_boost-shared-libs),link=shared,) \
355 $(if $(CONFIG_boost-static-libs),link=static,) \
356 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
357 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
358 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
359 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
360 $(if $(CONFIG_boost-single-thread),threading=single,) \
363 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
364 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
365 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
366 $(foreach lib,$(BOOST_LIBS), \
367 $(if $(findstring python,$(lib)), \
368 $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
369 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
371 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
372 boost.locale.iconv=off) \
374 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
375 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
380 define Build/InstallDev
382 $(1)/usr/include/boost/
385 $(PKG_INSTALL_DIR)/include/boost/* \
386 $(1)/usr/include/boost/ \
387 # copies _all_ header files - independent of <--with-library>-argument above
389 $(INSTALL_DIR) $(1)/usr/lib
390 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
391 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
396 $(STAGING_DIR)/host/bin
399 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
400 $(STAGING_DIR)/host/bin/
403 define Package/boost/Default/install
408 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
411 define Package/boost-test/install
416 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
419 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
422 define BuildBoostLibrary
423 define Package/boost-$(1)/install
424 $(call Package/boost/Default/install,$$(1),$(1))
427 $$(eval $$(call BuildPackage,boost-$(1)))
430 $(eval $(call HostBuild))
432 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
433 $(eval $(call BuildPackage,boost-test))
434 $(eval $(call BuildPackage,boost-libs))
435 $(eval $(call BuildPackage,boost))