xref: /haiku/src/system/boot/libs/Jamfile (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
1SubDir HAIKU_TOP src system boot libs ;
2
3local zlibSourceDirectory = [ BuildFeatureAttribute zlib : sources : path ] ;
4UseHeaders $(zlibSourceDirectory) ;
5UseHeaders $(zlibSourceDirectory) : true ;
6
7DEFINES += _BOOT_MODE ;
8
9local zlibSources =
10	adler32.c
11	crc32.c
12	inffast.c
13	inflate.c
14	inftrees.c
15	uncompr.c
16	zutil.c
17	;
18
19local zstdSourceDirectory = [ BuildFeatureAttribute zstd : sources : path ] ;
20UseHeaders [ FDirName $(zstdSourceDirectory) lib ] ;
21UseHeaders [ FDirName $(zstdSourceDirectory) lib common ] ;
22
23local zstdCommonSources =
24	error_private.c
25	entropy_common.c fse_decompress.c zstd_common.c
26	xxhash.c
27	;
28local zstdDecSources =
29	huf_decompress.c zstd_ddict.c zstd_decompress.c zstd_decompress_block.c
30	;
31
32local platform ;
33for platform in [ MultiBootSubDirSetup ] {
34	on $(platform) {
35		# zlib
36		UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
37
38		LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ;
39
40		Depends [ FGristFiles $(zlibSources) ]
41			: [ BuildFeatureAttribute zlib : sources ] ;
42
43		BootStaticLibrary [ MultiBootGristFiles boot_zlib ] :
44			$(zlibSources)
45			;
46
47		# zstd
48		LOCATE on [ FGristFiles $(zstdCommonSources) ] =
49			[ FDirName $(zstdSourceDirectory) lib common ] ;
50		LOCATE on [ FGristFiles $(zstdDecSources) ] =
51			[ FDirName $(zstdSourceDirectory) lib decompress ] ;
52
53		# tune build for smaller size
54		DEFINES += HUF_FORCE_DECOMPRESS_X1 ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT ;
55
56		BootStaticLibrary [ MultiBootGristFiles boot_zstd ] :
57			$(zstdCommonSources) $(zstdDecSources)
58			;
59		Depends [ FGristFiles $(zstdCommonSources) $(zstdDecSources) ]
60			: [ BuildFeatureAttribute zstd : sources ] ;
61	}
62}
63