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