2 # Copyright (C) 2015 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
22 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_VERSION
).
tar.gz
23 PKG_SOURCE_URL
:=@SF
/boost
24 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)_
$(PKG_VERSION
)
25 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)_
$(PKG_VERSION
)
26 PKG_MD5SUM
:=874805ba2e2ee415b1877ef3297bf8ad
27 PKG_LICENSE
:=Boost Software License
<http
://www.boost.org
/users
/license.html
>
28 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
30 PKG_BUILD_DEPENDS
+= boost
/host
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
/Default
50 define Package
/boost
/description
51 This package provides the Boost v1.61 libraries.
52 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
53 This package provides the following run-time libraries
:
59 - - coroutine2
(requires GCC v5 and up
)
66 - locale
(requires kernel being compiled with full language support
)
80 There are many more header-only libraries supported by Boost.
81 See more at http
://www.boost.org
/doc
/libs
/1_61_0
/
86 define Package
/boost-libs
87 $(call Package
/boost
/Default
)
89 DEPENDS
+= $(BOOST_DEPENDS
)
93 define Package
/boost-libs
/description
94 $(call Package
/boost
/description
/Default
)
96 This meta package contains only dependencies to the other libraries from
97 the boost libraries collection.
100 # Create a meta-package of dependent libraries (for ALL)
101 define Package
/boost-libs
/install
105 define Package
/boost
/install
111 $(call Package
/boost
/Default
)
113 DEPENDS
:=+ALL
:boost-libs
+ALL
:boost-test
116 define Package
/boost
/config
117 menu
"Select Boost Options"
118 depends on PACKAGE_boost
119 comment
"Boost compilation options."
122 prompt
"Compile Boost libraries."
123 default boost-static-and-shared-libs
125 Choose which version to compile.
127 - Only Shared libs will be compiled.
129 - Only Static libs will be compiled.
131 - Both Static and Shared libs will be compiled.
133 config boost-shared-libs
136 config boost-static-libs
139 config boost-static-and-shared-libs
144 prompt
"Selects Boost Runtime linkage."
145 default boost-runtime-shared
147 Choose which C and C
++ runtimes to use
:
148 -> Use Shared runtimes.
149 -> Use Static runtimes.
150 - Not available if Shared libs are to be built.
151 -> Use both runtimes.
152 - Not available if Shared libs are to be built.
153 - Two separate versions of Boost are built
, linking each to a different runtime.
154 - This option requires
"Use tagged names" option to be active.
156 config boost-runtime-shared
159 config boost-runtime-static
160 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
163 config boost-runtime-static-and-shared
164 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
169 prompt
"Select a Variant."
170 default boost-variant-release
172 Chooses which boost variant should be selected
:
173 -> Release
: Optimizes Boost for release.
174 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
176 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
178 - Profiling
: On
; Debug Symbols
: On.
180 config boost-variant-release
183 config boost-variant-debug
186 config boost-variant-profile
190 config boost-use-name-tags
191 bool
"Use tagged names."
193 Add name
tags the lib files
, to diferentiate each library version
:
194 "-mt" for multi-threading.
196 "-s" for runtime static link
".
197 Might break compatibility with libraries that expect boost libs with default names.
200 config boost-single-thread
201 depends on @boost-use-name-tags
202 bool "Single thread Support.
"
204 Compile Boost libraries in single-thread mode.
207 config boost-build-type-complete
208 depends on @boost-use-name-tags
209 bool "Complete Boost Build.
"
211 Builds both release and debug libs. It will take much longer to compile.
215 menu "Select Boost libraries
"
216 depends on PACKAGE_boost
219 config boost-libs-all
220 bool "Include
all Boost libraries.
"
221 select PACKAGE_boost-libs
223 config boost-test-pkg
224 bool "Boost
test package.
"
225 select PACKAGE_boost-test
227 config boost-coroutine2
228 depends on @GCC_VERSION_5
229 bool "Boost couroutine2 support.
"
230 select PACKAGE_boost-coroutine
233 config boost-graph-parallel
234 bool "Boost parallel graph support.
"
235 select PACKAGE_boost-graph
238 $(foreach lib,$(BOOST_LIBS), \
239 config PACKAGE_boost-$(lib)
240 prompt "Boost
$(lib
) library.
"
246 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
248 define Package/boost-test
249 $(call Package/boost/Default)
252 DEPENDS+=+boost-system +boost-timer
255 define Build/Configure
259 # 2: dependencies on other boost libraries (short name)
260 # 3: dependencies on other packages
261 define DefineBoostLibrary
263 BOOST_DEPENDS+= +boost-$(1)
266 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
268 define Package/boost-$(1)
269 $(call Package/boost/Default)
271 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3)
275 define Package/boost-$(1)/description
276 $(call Package/boost/description/Default)
278 This package contains the Boost $(1) library.
283 $(eval $(call DefineBoostLibrary,atomic,system,))
284 $(eval $(call DefineBoostLibrary,chrono,system,))
285 $(eval $(call DefineBoostLibrary,container,,))
286 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
287 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
288 $(eval $(call DefineBoostLibrary,date_time,,))
289 #$(eval $(call DefineBoostLibrary,exception,,))
290 $(eval $(call DefineBoostLibrary,filesystem,system,))
291 $(eval $(call DefineBoostLibrary,graph,regex,))
292 $(eval $(call DefineBoostLibrary,iostreams,,+PACKAGE_boost-iostreams:zlib))
293 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS) @BUILD_NLS))
294 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
295 $(eval $(call DefineBoostLibrary,math,,))
296 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
297 $(eval $(call DefineBoostLibrary,program_options,,))
298 $(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python))
299 $(eval $(call DefineBoostLibrary,python3,,+PACKAGE_boost-python3:python3))
300 $(eval $(call DefineBoostLibrary,random,system,))
301 $(eval $(call DefineBoostLibrary,regex,,))
302 $(eval $(call DefineBoostLibrary,serialization,,))
303 $(eval $(call DefineBoostLibrary,signals,,))
304 $(eval $(call DefineBoostLibrary,system,,))
305 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
306 $(eval $(call DefineBoostLibrary,timer,chrono))
307 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
311 # b2 does not provide a configure-script nor a Makefile
312 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
315 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
316 TARGET_LDFLAGS += -pthread -lrt
319 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
320 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
321 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
323 ifneq ($(findstring mips,$(ARCH)),)
325 ifneq ($(findstring 64,$(ARCH)),)
328 else ifneq ($(findstring arm,$(ARCH)),)
330 else ifeq ($(ARCH),aarch64)
339 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
340 ( cd $(PKG_BUILD_DIR) ; \
341 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 ; \
342 $(if $(CONFIG_PACKAGE_boost-python3), \
343 echo "using python
: 3.5 : $(STAGING_DIR_ROOT
)/usr
/bin
/python3
: $(STAGING_DIR
)/usr
/include/python3.5
/ ;" >> \
344 tools/build/src/user-config.jam; \
346 $(if $(CONFIG_PACKAGE_boost-python), \
347 echo "using python
: 2.7 : $(STAGING_DIR_ROOT
)/usr
/bin
/python
: $(STAGING_DIR
)/usr
/include/python2.7
/ ;" >> \
348 tools/build/src/user-config.jam; \
352 --ignore-site-config \
353 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
354 --disable-long-double \
355 $(if $(CONFIG_boost-variant-release), variant=release,) \
356 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
357 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
358 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
359 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
360 $(if $(CONFIG_boost-shared-libs),link=shared,) \
361 $(if $(CONFIG_boost-static-libs),link=static,) \
362 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
363 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
364 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
365 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
366 $(if $(CONFIG_boost-single-thread),threading=single,) \
369 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
370 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
371 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
372 $(foreach lib,$(BOOST_LIBS), \
373 $(if $(findstring python,$(lib)), \
374 $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
375 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
377 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
378 boost.locale.iconv=off) \
380 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
381 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
386 define Build/InstallDev
388 $(1)/usr/include/boost/
391 $(PKG_INSTALL_DIR)/include/boost/* \
392 $(1)/usr/include/boost/ \
393 # copies _all_ header files - independent of <--with-library>-argument above
395 $(INSTALL_DIR) $(1)/usr/lib
396 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
397 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
402 $(STAGING_DIR)/host/bin
405 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
406 $(STAGING_DIR)/host/bin/
409 define Package/boost/Default/install
414 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
417 define Package/boost-test/install
422 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
425 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
428 define BuildBoostLibrary
429 define Package/boost-$(1)/install
430 $(call Package/boost/Default/install,$$(1),$(1))
433 $$(eval $$(call BuildPackage,boost-$(1)))
436 $(eval $(call HostBuild))
438 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
439 $(eval $(call BuildPackage,boost-test))
440 $(eval $(call BuildPackage,boost-libs))
441 $(eval $(call BuildPackage,boost))