From 68191643b8df48573cae3b9cd072a7845b18ee1c Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 2 Nov 2018 21:46:22 -0400 Subject: [PATCH] build: Add HAIKU_ABSOLUTE_TOP and use it to root BootArchive. Strictly POSIX-compliant shells (like dash) do not allow sourcing files in the present directory without "./". The script really should not know or care about what directory the passed files are in, so now we add a jam grist to make the passed paths absolute. Fixes the build on all systems where /bin/sh is dash or a similarly POSIX-compliant-no-extensions shell (i.e. virtually all Linux.) --- Jamrules | 4 ++++ build/jam/ImageRules | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Jamrules b/Jamrules index f6cd45ce9e..f2c414d1ec 100644 --- a/Jamrules +++ b/Jamrules @@ -31,6 +31,10 @@ HAIKU_DOWNLOAD_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) HAIKU_OPTIONAL_BUILD_PACKAGES_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) build_packages ] ; +# Absolutely rooted versions of some of the main directories +HAIKU_ABSOLUTE_TOP ?= [ FDirName $(PWD) $(HAIKU_TOP) ] ; +HAIKU_ABSOLUTE_OUTPUT_DIR ?= [ FDirName $(HAIKU_ABSOLUTE_TOP) generated ] ; + # Cache files for header scanning and jamfile caching HCACHEFILE = header_cache ; JCACHEFILE = jamfile_cache ; diff --git a/build/jam/ImageRules b/build/jam/ImageRules index bd1b1ce825..cbcfab7874 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -1383,7 +1383,8 @@ rule BuildNetBootArchive archive : scripts SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ; Depends $(archive) : $(mainScript) $(scripts) ; - BuildNetBootArchive1 $(archive) : $(mainScript) $(scripts) ; + BuildNetBootArchive1 $(archive) : $(mainScript) + $(scripts:R=$(HAIKU_ABSOLUTE_OUTPUT_DIR)) ; } actions BuildNetBootArchive1 @@ -1474,7 +1475,8 @@ rule BuildFloppyBootArchive archive : scripts SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ; Depends $(archive) : $(mainScript) $(scripts) ; - BuildFloppyBootArchive1 $(archive) : $(mainScript) $(scripts) ; + BuildFloppyBootArchive1 $(archive) : $(mainScript) + $(scripts:R=$(HAIKU_ABSOLUTE_OUTPUT_DIR)) ; } actions BuildFloppyBootArchive1