1config BR2_PACKAGE_ZLIB_FORCE_LIBZLIB
2	bool
3
4config BR2_PACKAGE_ZLIB_NG_ARCH_SUPPORTS
5	bool
6	default y if BR2_arm
7	default y if BR2_aarch64
8	default y if BR2_i386
9	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
10	default y if BR2_riscv
11	default y if BR2_s390x
12	default y if BR2_x86_64
13
14config BR2_PACKAGE_ZLIB
15	bool "zlib support"
16	help
17	  Select the desired Zlib library provider.
18
19if BR2_PACKAGE_ZLIB
20
21choice
22	prompt "zlib variant"
23	default BR2_PACKAGE_LIBZLIB
24	help
25	  Select the desired Zlib library provider.
26
27config BR2_PACKAGE_LIBZLIB
28	bool "zlib"
29	select BR2_PACKAGE_HAS_ZLIB
30	help
31	  Standard (de)compression library. Used by things like
32	  gzip and libpng.
33
34	  http://www.zlib.net
35
36config BR2_PACKAGE_ZLIB_NG
37	bool "zlib-ng"
38	depends on BR2_PACKAGE_ZLIB_NG_ARCH_SUPPORTS
39	depends on !BR2_PACKAGE_ZLIB_FORCE_LIBZLIB
40	select BR2_PACKAGE_HAS_ZLIB
41	help
42	  Zlib replacement with optimizations for
43	  "next generation" systems.
44
45	  https://github.com/zlib-ng/zlib-ng
46
47endchoice
48
49config BR2_PACKAGE_HAS_ZLIB
50	bool
51
52config BR2_PACKAGE_PROVIDES_ZLIB
53	string
54	default "libzlib" if BR2_PACKAGE_LIBZLIB
55	default "zlib-ng" if BR2_PACKAGE_ZLIB_NG
56
57endif
58
59# ensure libzlib is used for the host variant
60config BR2_PACKAGE_PROVIDES_HOST_ZLIB
61	string
62	default "host-libzlib"
63