From 491592688deedfd1ddbbf9506b32341d26c089a1 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 22 Oct 2021 19:33:25 -0500 Subject: [PATCH] system/boot: Fix build of bootloader without zstd build-package Change-Id: I39b52def6892f77f5b3b1c088b01459b689c80e2 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4648 Reviewed-by: Alex von Gluck IV Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/system/boot/Jamfile | 12 ++++++++---- .../boot/loader/file_systems/packagefs/Jamfile | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile index 59033a0f8d..de1b8f6b19 100644 --- a/src/system/boot/Jamfile +++ b/src/system/boot/Jamfile @@ -304,6 +304,12 @@ for platform in [ MultiBootSubDirSetup ] { local ldflags = $(HAIKU_BOOT_LDFLAGS) $(HAIKU_BOOT_$(platform:G=:U)_LDFLAGS) ; ldflags ?= $(TARGET_BOOT_LDFLAGS) ; + # needed by tarfs, packagefs, and video_splash.cpp + local supportLibs = [ FGrist boot_zlib.a ] ; + if [ FIsBuildFeatureEnabled zstd ] { + supportLibs += boot_zstd.a ; + } + # efi loader needs to be shared. if $(TARGET_BOOT_PLATFORM) = efi { ldflags += -shared ; @@ -332,11 +338,9 @@ for platform in [ MultiBootSubDirSetup ] { boot_loader.a # a second time, so undefined references in the file systems can be # resolved - - # needed by tarfs, packagefs, and video_splash.cpp - boot_zlib.a - boot_zstd.a + $(supportLibs) ] + # libroot functions needed by the stage2 boot loader boot_libroot_$(platform:G=).o diff --git a/src/system/boot/loader/file_systems/packagefs/Jamfile b/src/system/boot/loader/file_systems/packagefs/Jamfile index 8be9053bc7..033a2fa0df 100644 --- a/src/system/boot/loader/file_systems/packagefs/Jamfile +++ b/src/system/boot/loader/file_systems/packagefs/Jamfile @@ -4,7 +4,11 @@ UsePrivateHeaders kernel shared storage support ; UseBuildFeatureHeaders zlib ; UseBuildFeatureHeaders zstd ; -DEFINES += _BOOT_MODE ZSTD_ENABLED ; +DEFINES += _BOOT_MODE ; + +if [ FIsBuildFeatureEnabled zstd ] { + DEFINES += ZSTD_ENABLED ; +} local kernelC++Header = [ FDirName $(HAIKU_TOP) headers private kernel util kernel_cpp.h ] ;