1SubDir HAIKU_TOP src system boot libs ; 2 3local zlibSourceDirectory = [ BuildFeatureAttribute zlib : sources : path ] ; 4UseHeaders $(zlibSourceDirectory) ; 5UseHeaders $(zlibSourceDirectory) : true ; 6 7local zlibSources = 8 adler32.c 9 crc32.c 10 inffast.c 11 inflate.c 12 inftrees.c 13 uncompr.c 14 zutil.c 15 ; 16 17local zstdSourceDirectory = [ BuildFeatureAttribute zstd : sources : path ] ; 18UseHeaders [ FDirName $(zstdSourceDirectory) lib ] ; 19UseHeaders [ FDirName $(zstdSourceDirectory) lib common ] ; 20 21local zstdCommonSources = 22 error_private.c 23 entropy_common.c fse_decompress.c zstd_common.c 24 xxhash.c 25 ; 26local zstdDecSources = 27 huf_decompress.c zstd_ddict.c zstd_decompress.c zstd_decompress_block.c 28 ; 29 30local libFDTSourceDirectory = [ FDirName $(HAIKU_TOP) src libs libfdt ] ; 31 32local libFDTSources = 33 fdt.c 34 fdt_ro.c 35 fdt_rw.c 36 fdt_strerror.c 37 fdt_sw.c 38 fdt_wip.c 39 fdt_addresses.c 40 fdt_check.c 41 fdt_empty_tree.c 42 fdt_overlay.c 43 ; 44 45SubDirCcFlags -Wno-error=missing-prototypes -Wno-error=sign-compare -Wno-error=missing-braces ; 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