boot/loader: Add Zstd support.
This commit is contained in:
@@ -335,6 +335,7 @@ for platform in [ MultiBootSubDirSetup ] {
|
|||||||
|
|
||||||
# needed by tarfs, packagefs, and video_splash.cpp
|
# needed by tarfs, packagefs, and video_splash.cpp
|
||||||
boot_zlib.a
|
boot_zlib.a
|
||||||
|
boot_zstd.a
|
||||||
]
|
]
|
||||||
# libroot functions needed by the stage2 boot loader
|
# libroot functions needed by the stage2 boot loader
|
||||||
boot_libroot_$(platform:G=).o
|
boot_libroot_$(platform:G=).o
|
||||||
|
|||||||
@@ -16,6 +16,19 @@ local zlibSources =
|
|||||||
zutil.c
|
zutil.c
|
||||||
;
|
;
|
||||||
|
|
||||||
|
local zstdSourceDirectory = [ BuildFeatureAttribute zstd : sources : path ] ;
|
||||||
|
UseHeaders [ FDirName $(zstdSourceDirectory) lib ] ;
|
||||||
|
UseHeaders [ FDirName $(zstdSourceDirectory) lib common ] ;
|
||||||
|
|
||||||
|
local zstdCommonSources =
|
||||||
|
error_private.c
|
||||||
|
entropy_common.c fse_decompress.c zstd_common.c
|
||||||
|
xxhash.c
|
||||||
|
;
|
||||||
|
local zstdDecSources =
|
||||||
|
huf_decompress.c zstd_ddict.c zstd_decompress.c zstd_decompress_block.c
|
||||||
|
;
|
||||||
|
|
||||||
local platform ;
|
local platform ;
|
||||||
for platform in [ MultiBootSubDirSetup ] {
|
for platform in [ MultiBootSubDirSetup ] {
|
||||||
on $(platform) {
|
on $(platform) {
|
||||||
@@ -30,5 +43,20 @@ for platform in [ MultiBootSubDirSetup ] {
|
|||||||
BootStaticLibrary [ MultiBootGristFiles boot_zlib ] :
|
BootStaticLibrary [ MultiBootGristFiles boot_zlib ] :
|
||||||
$(zlibSources)
|
$(zlibSources)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
# zstd
|
||||||
|
LOCATE on [ FGristFiles $(zstdCommonSources) ] =
|
||||||
|
[ FDirName $(zstdSourceDirectory) lib common ] ;
|
||||||
|
LOCATE on [ FGristFiles $(zstdDecSources) ] =
|
||||||
|
[ FDirName $(zstdSourceDirectory) lib decompress ] ;
|
||||||
|
|
||||||
|
# tune build for smaller size
|
||||||
|
DEFINES += HUF_FORCE_DECOMPRESS_X1 ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT ;
|
||||||
|
|
||||||
|
BootStaticLibrary [ MultiBootGristFiles boot_zstd ] :
|
||||||
|
$(zstdCommonSources) $(zstdDecSources)
|
||||||
|
;
|
||||||
|
Depends [ FGristFiles $(zstdCommonSources) $(zstdDecSources) ]
|
||||||
|
: [ BuildFeatureAttribute zstd : sources ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ SubDir HAIKU_TOP src system boot loader file_systems packagefs ;
|
|||||||
|
|
||||||
UsePrivateHeaders kernel shared storage support ;
|
UsePrivateHeaders kernel shared storage support ;
|
||||||
UseBuildFeatureHeaders zlib ;
|
UseBuildFeatureHeaders zlib ;
|
||||||
|
UseBuildFeatureHeaders zstd ;
|
||||||
|
|
||||||
DEFINES += _BOOT_MODE ;
|
DEFINES += _BOOT_MODE ZSTD_ENABLED ;
|
||||||
|
|
||||||
local kernelC++Header = [ FDirName $(HAIKU_TOP) headers private kernel util
|
local kernelC++Header = [ FDirName $(HAIKU_TOP) headers private kernel util
|
||||||
kernel_cpp.h ] ;
|
kernel_cpp.h ] ;
|
||||||
@@ -44,9 +45,12 @@ for platform in [ MultiBootSubDirSetup ] {
|
|||||||
# support kit
|
# support kit
|
||||||
CompressionAlgorithm.cpp
|
CompressionAlgorithm.cpp
|
||||||
ZlibCompressionAlgorithm.cpp
|
ZlibCompressionAlgorithm.cpp
|
||||||
|
ZstdCompressionAlgorithm.cpp
|
||||||
;
|
;
|
||||||
|
|
||||||
Includes [ FGristFiles ZlibCompressionAlgorithm.cpp ]
|
Includes [ FGristFiles ZlibCompressionAlgorithm.cpp ]
|
||||||
: [ BuildFeatureAttribute zlib : headers ] ;
|
: [ BuildFeatureAttribute zlib : headers ] ;
|
||||||
|
Includes [ FGristFiles ZstdCompressionAlgorithm.cpp ]
|
||||||
|
: [ BuildFeatureAttribute zstd : headers ] ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user