From 7bd549882a616a5464c9a8ce18c3ad4568103091 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 19 Oct 2021 17:44:30 -0400 Subject: [PATCH] boot: Move boot_zlib build out of tarfs directory. It is also used by packagefs. Another library is coming in the next commit. --- src/system/boot/Jamfile | 1 + src/system/boot/libs/Jamfile | 34 +++++++++++++++++++ .../boot/loader/file_systems/tarfs/Jamfile | 32 ++--------------- 3 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 src/system/boot/libs/Jamfile diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile index 0469ae6cbe..fc4038b822 100644 --- a/src/system/boot/Jamfile +++ b/src/system/boot/Jamfile @@ -401,5 +401,6 @@ for platform in [ MultiBootSubDirSetup ] { } SubInclude HAIKU_TOP src system boot arch $(TARGET_KERNEL_ARCH_DIR) ; +SubInclude HAIKU_TOP src system boot libs ; SubInclude HAIKU_TOP src system boot loader ; SubInclude HAIKU_TOP src system boot platform ; diff --git a/src/system/boot/libs/Jamfile b/src/system/boot/libs/Jamfile new file mode 100644 index 0000000000..be99b6a9b8 --- /dev/null +++ b/src/system/boot/libs/Jamfile @@ -0,0 +1,34 @@ +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 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) + ; + } +} diff --git a/src/system/boot/loader/file_systems/tarfs/Jamfile b/src/system/boot/loader/file_systems/tarfs/Jamfile index e73602a3b9..6e79189c6d 100644 --- a/src/system/boot/loader/file_systems/tarfs/Jamfile +++ b/src/system/boot/loader/file_systems/tarfs/Jamfile @@ -3,47 +3,21 @@ SubDir HAIKU_TOP src system boot loader file_systems tarfs ; UsePrivateHeaders [ FDirName kernel disk_device_manager ] ; UsePrivateHeaders kernel shared storage ; -local zlibSourceDirectory = [ BuildFeatureAttribute zlib : sources : path ] ; -UseHeaders $(zlibSourceDirectory) ; -UseHeaders $(zlibSourceDirectory) : true ; +UseBuildFeatureHeaders zlib ; local defines = [ FDefines _BOOT_MODE ] ; SubDirCcFlags $(defines) ; SubDirC++Flags -fno-rtti $(defines) ; - -local zlibSources = - adler32.c - crc32.c - inffast.c - inflate.c - inftrees.c - uncompr.c - zutil.c - ; - local platform ; for platform in [ MultiBootSubDirSetup ] { on $(platform) { UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ; - LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ; - Depends [ FGristFiles $(zlibSources) ] - : [ BuildFeatureAttribute zlib : sources ] ; - - BootStaticLibrary [ MultiBootGristFiles boot_zlib ] : - $(zlibSources) - ; - - - Includes [ FGristFiles tarfs.cpp ] : [ BuildFeatureAttribute zlib : sources ] ; - # Strictly speaking it should be "headers", but the sources contain the - # headers as well and we have already added the sources directory to the - # header search path for the subdirectory. Should building boot_zlib be - # moved to its own directory, this should better be changes as well. - BootStaticLibrary [ MultiBootGristFiles boot_tarfs ] : tarfs.cpp ; + + Includes [ FGristFiles tarfs.cpp ] : [ BuildFeatureAttribute zlib : headers ] ; } }