usbmuxd: Update to latest git
[feed/packages.git] / libs / boost / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 #
7 # Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
8 # Dude, this "boost" is really one of the most crude stuff I ported yet.
9 #
10
11 include $(TOPDIR)/rules.mk
12
13 PKG_NAME:=boost
14 PKG_VERSION:=1.69.0
15 PKG_SOURCE_VERSION:=1_69_0
16 PKG_RELEASE:=2
17
18 PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
19 PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_NAME)/$(PKG_VERSION) https://dl.bintray.com/boostorg/release/$(PKG_VERSION)/source/
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
21 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
22 PKG_HASH:=8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406
23 PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
24 PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
25
26 PKG_BUILD_PARALLEL:=1
27 PKG_USE_MIPS16:=0
28
29 include $(INCLUDE_DIR)/package.mk
30 include $(INCLUDE_DIR)/nls.mk
31
32 define Package/boost/Default
33 SECTION:=libs
34 CATEGORY:=Libraries
35 TITLE:=Boost C++ source library
36 URL:=http://www.boost.org
37 DEPENDS:=+libstdcpp +libpthread +librt
38 endef
39
40 define Package/boost/description
41 This package provides the Boost v1.69.0 libraries.
42 Boost is a set of free, peer-reviewed, portable C++ source libraries.
43
44 -----------------------------------------------------------------------------
45 | Warning |
46 | In order to build all of the Boost Libraries, it is necessary |
47 | to use, at least, GCC version 5 (C++14 support) and, it is necessary to |
48 | compile the kernel with Full Language Support. |
49 | Without these requirerements, the following libs will not be available: |
50 | - Boost.Locale |
51 | - Boost.Coroutine2 (header-only library - requires C++11) |
52 | - Boost.Fiber (requires C++14) |
53 -----------------------------------------------------------------------------
54
55 This package provides the following run-time libraries:
56 - atomic
57 - chrono
58 - container
59 - context
60 - contract
61 - coroutine (Deprecated - use Coroutine2)
62 - - coroutine2 (Requires GCC v5 and up)
63 - date_time
64 - exception
65 - filesystem
66 - fiber (Requires GCC v5 and up)
67 - graph
68 - - graph-parallel
69 - iostreams
70 - locale (Requires kernel being compiled with full language support)
71 - log
72 - math
73 - program_options
74 - python
75 - python3
76 - random
77 - regex
78 - serialization and wserialization
79 - stackstrace
80 - system
81 - thread
82 - timer
83 - type_erasure
84 - wave
85
86 There are many more header-only libraries supported by Boost.
87 See more at http://www.boost.org/doc/libs/1_69_0/
88 endef
89
90 PKG_BUILD_DEPENDS:=boost/host PACKAGE_python:python PACKAGE_python3:python3
91
92 include ../../lang/python/python-version.mk
93 BOOST_PYTHON_VER=$(PYTHON_VERSION)
94
95 include ../../lang/python/python3-version.mk
96 BOOST_PYTHON3_VER=$(PYTHON3_VERSION)
97
98 BOOST_LIBS =
99
100 define Package/boost-libs
101 $(call Package/boost/Default)
102 TITLE+= (all libs)
103 DEPENDS+= $(BOOST_DEPENDS)
104 HIDDEN:=1
105 endef
106
107 define Package/boost-libs/description
108 This meta package contains only dependencies to the other libraries from
109 the boost libraries collection.
110 endef
111
112 # Create a meta-package of dependent libraries (for ALL)
113 define Package/boost-libs/install
114 true
115 endef
116
117 define Package/boost/install
118 true
119 endef
120
121 define Package/boost
122 $(call Package/boost/Default)
123 TITLE+= packages
124 endef
125
126 define Package/boost/config
127 menu "Select Boost Options"
128 depends on PACKAGE_boost
129 comment "Boost compilation options."
130
131 choice
132 prompt "Compile Visibility."
133 default boost-compile-visibility-hidden
134 help
135 Choose Boost symbols compilation visibility.
136 -> Global:
137 - a.k.a. "default" in gcc documentation. Global symbols are considered public,
138 they are exported from shared libraries and can be redefined by another
139 shared library or executable.
140 -> Protected:
141 - a.k.a. "symbolic". Protected symbols are exported from shared libraries but
142 cannot be redefined by another shared library or executable. This mode is
143 not supported on some platforms, for example OS X.
144 -> Hidden:
145 - Hidden symbols are not exported from shared libraries and cannot be
146 redefined by a different shared library or executable loaded in a process.
147 In this mode, public symbols have to be explicitly marked in the source code
148 to be exported from shared libraries. This is the recommended mode.
149
150 config boost-compile-visibility-global
151 bool "Global"
152
153 config boost-compile-visibility-protected
154 bool "Protected"
155
156 config boost-compile-visibility-hidden
157 bool "Hidden"
158 endchoice
159
160 choice
161 prompt "Compile Boost libraries."
162 default boost-static-and-shared-libs
163 help
164 Choose which version to compile.
165 -> Shared:
166 - Only Shared libs will be compiled.
167 -> Static:
168 - Only Static libs will be compiled.
169 -> Both:
170 - Both Static and Shared libs will be compiled.
171
172 config boost-shared-libs
173 bool "Shared"
174
175 config boost-static-libs
176 bool "Static"
177
178 config boost-static-and-shared-libs
179 bool "Both"
180 endchoice
181
182 choice
183 prompt "Selects Boost Runtime linkage."
184 default boost-runtime-shared
185 help
186 Choose which C and C++ runtimes to use:
187 -> Use Shared runtimes.
188 -> Use Static runtimes.
189 - Not available if Shared libs are to be built.
190 -> Use both runtimes.
191 - Not available if Shared libs are to be built.
192 - Two separate versions of Boost are built, linking each to a different runtime.
193 - This option requires "Use tagged names" option to be active.
194
195 config boost-runtime-shared
196 bool "Shared"
197
198 config boost-runtime-static
199 depends on @(!boost-shared-libs&&!boost-static-and-shared-libs)
200 bool "Static"
201
202 config boost-runtime-static-and-shared
203 depends on @(boost-use-name-tags&&!boost-shared-libs&&!boost-static-and-shared-libs)
204 bool "Both"
205 endchoice
206
207 choice
208 prompt "Select a Variant."
209 default boost-variant-release
210 help
211 Chooses which boost variant should be selected:
212 -> Release: Optimizes Boost for release.
213 - Optimization: Speed; Debug Symbols: Off; Inlining: Full; Runtime Debugging: Off.
214 -> Debug:
215 - Optimization: Off; Debug Symbols: On; Inlining: Off; Runtime Debugging: On.
216 -> Profile:
217 - Profiling: On; Debug Symbols: On.
218
219 config boost-variant-release
220 bool "Release"
221
222 config boost-variant-debug
223 bool "Debug"
224
225 config boost-variant-profile
226 bool "Profile"
227 endchoice
228
229 config boost-use-name-tags
230 bool "Use tagged names."
231 help
232 Add name tags the lib files, to diferentiate each library version:
233 "-mt" for multi-threading.
234 "-d" for debugging.
235 "-s" for runtime static link".
236 Might break compatibility with libraries that expect boost libs with default names.
237 default n
238
239 config boost-single-thread
240 depends on @boost-use-name-tags
241 bool "Single thread Support."
242 help
243 Compile Boost libraries in single-thread mode.
244 default n
245
246 config boost-build-type-complete
247 depends on @boost-use-name-tags
248 bool "Complete Boost Build."
249 help
250 Builds both release and debug libs. It will take much longer to compile.
251 default n
252 endmenu
253
254 menu "Select Boost libraries"
255 depends on PACKAGE_boost
256 comment "Libraries"
257
258 config boost-libs-all
259 bool "Include all Boost libraries."
260 default m if ALL
261 select PACKAGE_boost-libs
262 select boost-test-pkg
263 select boost-coroutine2
264 select boost-graph-parallel
265
266 # Invisible config dependency
267 config boost-fiber-exclude
268 bool
269 default y if (CPU_TYPE=mips32 || CPU_TYPE=mips64)
270
271 config boost-test-pkg
272 bool "Boost test package."
273 default m if ALL
274 select PACKAGE_boost-test
275
276 config boost-coroutine2
277 depends on !@GCC_VERSION_4_8
278 bool "Boost couroutine2 support."
279 select PACKAGE_boost-coroutine
280 default n
281
282 config boost-graph-parallel
283 bool "Boost parallel graph support."
284 select PACKAGE_boost-graph
285 default n
286
287 $(foreach lib,$(BOOST_LIBS), \
288 config PACKAGE_boost-$(lib)
289 prompt "Boost $(lib) $(if $(findstring python,$(lib)),$(paren_left)v$(if $(findstring 3,$(lib)),$(BOOST_PYTHON3_VER),$(BOOST_PYTHON_VER))$(paren_right) ,)library."
290 default m if ALL
291 $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
292 $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)\
293 $(if $(findstring fiber,$(lib)),depends on (CPU_TYPE!=mips32 && CPU_TYPE!=mips64),)
294 )
295 endmenu
296
297 endef
298
299 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
300
301 define Package/boost-test
302 $(call Package/boost/Default)
303 TITLE+= (test)
304 HIDDEN:=1
305 DEPENDS+=+boost-system +boost-timer
306 endef
307
308 define Build/Configure
309 endef
310
311 # 1: short name
312 # 2: dependencies on other boost libraries (short name)
313 # 3: dependencies on other packages
314 # 4: conditional/inward dependencies
315 define DefineBoostLibrary
316
317 BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
318 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
319
320 BOOST_LIBS+= $(1)
321
322 define Package/boost-$(1)
323 $(call Package/boost/Default)
324 TITLE+= ($(1))
325 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
326 HIDDEN:=1
327 endef
328
329 define Package/boost-$(1)/description
330 This package contains the Boost $(1) library.
331 endef
332 endef
333
334 $(eval $(call DefineBoostLibrary,atomic,system,))
335 $(eval $(call DefineBoostLibrary,chrono,system,))
336 $(eval $(call DefineBoostLibrary,container,,))
337 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
338 $(eval $(call DefineBoostLibrary,contract,system,))
339 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
340 $(eval $(call DefineBoostLibrary,date_time,,))
341 #$(eval $(call DefineBoostLibrary,exception,,))
342 $(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
343 $(eval $(call DefineBoostLibrary,filesystem,system,))
344 $(eval $(call DefineBoostLibrary,graph,regex,))
345 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2))
346 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
347 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
348 $(eval $(call DefineBoostLibrary,math,,))
349 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
350 $(eval $(call DefineBoostLibrary,program_options,,))
351 $(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
352 $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
353 $(eval $(call DefineBoostLibrary,random,system,))
354 $(eval $(call DefineBoostLibrary,regex,,))
355 $(eval $(call DefineBoostLibrary,serialization,,))
356 $(eval $(call DefineBoostLibrary,wserialization,serialization,))
357 $(eval $(call DefineBoostLibrary,stacktrace,,))
358 $(eval $(call DefineBoostLibrary,system,,))
359 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
360 $(eval $(call DefineBoostLibrary,timer,chrono))
361 $(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
362 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
363
364 include $(INCLUDE_DIR)/host-build.mk
365
366 define Host/Compile
367 # b2 does not provide a configure-script nor a Makefile
368 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
369 endef
370
371 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
372 TARGET_LDFLAGS += -pthread -lrt
373
374 TARGET_CFLAGS += \
375 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
376
377 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
378
379 ifneq ($(findstring mips,$(ARCH)),)
380 BOOST_ABI = o32
381 ifneq ($(findstring 64,$(ARCH)),)
382 BOOST_ABI = o64
383 endif
384 else ifneq ($(findstring arm,$(ARCH)),)
385 BOOST_ABI = aapcs
386 else ifeq ($(ARCH),aarch64)
387 BOOST_ABI = aapcs
388 else
389 BOOST_ABI = sysv
390 endif
391
392 comma := ,
393
394 define Build/Compile
395 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CONFIG_CPU_TYPE) $(if $(CONFIG_CPU_SUBTYPE),and cpu subtype $(CONFIG_CPU_SUBTYPE),))
396 ( cd $(PKG_BUILD_DIR) ; \
397 echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > \
398 tools/build/src/user-config.jam ; \
399 b2 \
400 $(CONFIGURE_ARGS) \
401 --ignore-site-config \
402 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
403 --disable-long-double \
404 $(if $(CONFIG_boost-compile-visibility-global), visibility=global,) \
405 $(if $(CONFIG_boost-compile-visibility-protected), visibility=protected,) \
406 $(if $(CONFIG_boost-compile-visibility-hidden), visibility=hidden,) \
407 $(if $(CONFIG_boost-variant-release), variant=release,) \
408 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
409 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
410 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
411 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
412 $(if $(CONFIG_boost-shared-libs),link=shared,) \
413 $(if $(CONFIG_boost-static-libs),link=static,) \
414 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
415 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
416 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
417 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
418 $(if $(CONFIG_boost-single-thread),threading=single,) \
419 threading=multi \
420 --without-mpi \
421 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
422 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
423 --without-python \
424 $(foreach lib,$(BOOST_LIBS), \
425 $(if $(findstring python,$(lib)),, \
426 $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
427 $(if $(findstring wserialization,$(lib)),,--without-$(lib)) \
428 ) \
429 ) \
430 ) \
431 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
432 boost.locale.iconv=off) \
433 \
434 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
435 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
436 install ;\
437 $(if $(CONFIG_PACKAGE_boost-python), \
438 echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/python$(BOOST_PYTHON_VER)/ \" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > \
439 tools/build/src/user-config.jam ; \
440 echo "using python : $(BOOST_PYTHON_VER) : : $(STAGING_DIR)/usr/include/python$(BOOST_PYTHON_VER)/ : $(STAGING_DIR)/usr/lib/libpython$(BOOST_PYTHON_VER).so ;" >> \
441 tools/build/src/user-config.jam; \
442 b2 -a \
443 $(CONFIGURE_ARGS) \
444 --ignore-site-config \
445 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
446 --disable-long-double \
447 $(if $(CONFIG_boost-variant-release), variant=release,) \
448 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
449 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
450 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
451 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
452 $(if $(CONFIG_boost-shared-libs),link=shared,) \
453 $(if $(CONFIG_boost-static-libs),link=static,) \
454 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
455 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
456 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
457 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
458 $(if $(CONFIG_boost-single-thread),threading=single,) \
459 threading=multi \
460 --with-python \
461 install ;\
462 ,) \
463 $(if $(CONFIG_PACKAGE_boost-python3), \
464 echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/python$(BOOST_PYTHON3_VER)/ \" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > \
465 tools/build/src/user-config.jam ; \
466 echo "using python : $(BOOST_PYTHON3_VER) : : $(STAGING_DIR)/usr/include/python$(BOOST_PYTHON3_VER)/ : $(STAGING_DIR)/usr/lib/libpython$(BOOST_PYTHON3_VER).so ;" >> \
467 tools/build/src/user-config.jam; \
468 b2 -a \
469 $(CONFIGURE_ARGS) \
470 --ignore-site-config \
471 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
472 --disable-long-double \
473 $(if $(CONFIG_boost-variant-release), variant=release,) \
474 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
475 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
476 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
477 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
478 $(if $(CONFIG_boost-shared-libs),link=shared,) \
479 $(if $(CONFIG_boost-static-libs),link=static,) \
480 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
481 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
482 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
483 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
484 $(if $(CONFIG_boost-single-thread),threading=single,) \
485 threading=multi \
486 --with-python \
487 install ;\
488 ,) \
489 )
490 endef
491
492 define Build/InstallDev
493 $(INSTALL_DIR) \
494 $(1)/usr/include/boost/
495
496 $(CP) \
497 $(PKG_INSTALL_DIR)/include/boost/* \
498 $(1)/usr/include/boost/ \
499 # copies _all_ header files - independent of <--with-library>-argument above
500
501 $(INSTALL_DIR) $(1)/usr/lib
502 # copies all compiled archive and shared object files
503 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.{a,so*} $(1)/usr/lib/ || :
504 endef
505
506 define Host/Install
507 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
508 $(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 $(STAGING_DIR_HOSTPKG)/bin/
509 endef
510
511 define Package/boost/Default/install
512 $(INSTALL_DIR) $(1)/usr/lib
513 $(if $(findstring python,$(2)), $(if $(findstring 3,$(2)), \
514 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_python3*.so* $(1)/usr/lib/ , \
515 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_python2*.so* $(1)/usr/lib/ ), \
516 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/ )
517 endef
518
519 define Package/boost-test/install
520 $(INSTALL_DIR) $(1)/usr/lib
521 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* $(1)/usr/lib/
522 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* $(1)/usr/lib/
523 endef
524
525 define BuildBoostLibrary
526 define Package/boost-$(1)/install
527 $(call Package/boost/Default/install,$$(1),$(1))
528 endef
529
530 $$(eval $$(call BuildPackage,boost-$(1)))
531 endef
532
533 $(eval $(call HostBuild))
534
535 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
536 $(eval $(call BuildPackage,boost-test))
537 $(eval $(call BuildPackage,boost-libs))
538 $(eval $(call BuildPackage,boost))