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 47SubDirCcFlags -Wno-error=missing-prototypes ; 48 49local platform ; 50for platform in [ MultiBootSubDirSetup ] { 51 on $(platform) { 52 # zlib 53 UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ; 54 55 LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ; 56 57 Depends [ FGristFiles $(zlibSources) ] 58 : [ BuildFeatureAttribute zlib : sources ] ; 59 60 BootStaticLibrary [ MultiBootGristFiles boot_zlib ] : 61 $(zlibSources) 62 ; 63 64 # zstd 65 LOCATE on [ FGristFiles $(zstdCommonSources) ] = 66 [ FDirName $(zstdSourceDirectory) lib common ] ; 67 LOCATE on [ FGristFiles $(zstdDecSources) ] = 68 [ FDirName $(zstdSourceDirectory) lib decompress ] ; 69 70 # tune build for smaller size 71 DEFINES += HUF_FORCE_DECOMPRESS_X1 ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT ; 72 # prevent weak symbols 73 DEFINES += ZSTD_HAVE_WEAK_SYMBOLS=0 ; 74 75 BootStaticLibrary [ MultiBootGristFiles boot_zstd ] : 76 $(zstdCommonSources) $(zstdDecSources) 77 ; 78 Depends [ FGristFiles $(zstdCommonSources) $(zstdDecSources) ] 79 : [ BuildFeatureAttribute zstd : sources ] ; 80 81 # fdt 82 UseLibraryHeaders [ FDirName libfdt ] ; 83 84 BootStaticLibrary [ MultiBootGristFiles boot_fdt ] : 85 $(libFDTSources) ; 86 87 LOCATE on [ FGristFiles $(libFDTSources) ] = $(libFDTSourceDirectory) ; 88 } 89} 90