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 libFDTSourceDirectory = [ FDirName $(HAIKU_TOP) src libs libfdt ] ; 33 34local libFDTSources = 35 fdt.c 36 fdt_ro.c 37 fdt_rw.c 38 fdt_strerror.c 39 fdt_sw.c 40 fdt_wip.c 41 fdt_addresses.c 42 fdt_check.c 43 fdt_empty_tree.c 44 fdt_overlay.c 45 ; 46 47local platform ; 48for platform in [ MultiBootSubDirSetup ] { 49 on $(platform) { 50 # zlib 51 UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ; 52 53 LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ; 54 55 Depends [ FGristFiles $(zlibSources) ] 56 : [ BuildFeatureAttribute zlib : sources ] ; 57 58 BootStaticLibrary [ MultiBootGristFiles boot_zlib ] : 59 $(zlibSources) 60 ; 61 62 # zstd 63 LOCATE on [ FGristFiles $(zstdCommonSources) ] = 64 [ FDirName $(zstdSourceDirectory) lib common ] ; 65 LOCATE on [ FGristFiles $(zstdDecSources) ] = 66 [ FDirName $(zstdSourceDirectory) lib decompress ] ; 67 68 # tune build for smaller size 69 DEFINES += HUF_FORCE_DECOMPRESS_X1 ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT ; 70 # prevent weak symbols 71 DEFINES += ZSTD_HAVE_WEAK_SYMBOLS=0 ; 72 73 BootStaticLibrary [ MultiBootGristFiles boot_zstd ] : 74 $(zstdCommonSources) $(zstdDecSources) 75 ; 76 Depends [ FGristFiles $(zstdCommonSources) $(zstdDecSources) ] 77 : [ BuildFeatureAttribute zstd : sources ] ; 78 79 # fdt 80 UseLibraryHeaders [ FDirName libfdt ] ; 81 82 BootStaticLibrary [ MultiBootGristFiles boot_fdt ] : 83 $(libFDTSources) ; 84 85 LOCATE on [ FGristFiles $(libFDTSources) ] = $(libFDTSourceDirectory) ; 86 } 87} 88