SubDir HAIKU_TOP src system boot libs ; local zlibSourceDirectory = [ BuildFeatureAttribute zlib : sources : path ] ; UseHeaders $(zlibSourceDirectory) ; UseHeaders $(zlibSourceDirectory) : true ; DEFINES += _BOOT_MODE ; local zlibSources = adler32.c crc32.c inffast.c inflate.c inftrees.c uncompr.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 ; for platform in [ MultiBootSubDirSetup ] { on $(platform) { # zlib UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ; LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ; Depends [ FGristFiles $(zlibSources) ] : [ BuildFeatureAttribute zlib : sources ] ; BootStaticLibrary [ MultiBootGristFiles boot_zlib ] : $(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 ] ; } }