cross_tools: allow specifying a custom sysroot path

* Use with --sysroot /path/to/sysroot; useful for CI
  environments and cross-building.

Change-Id: I27a93a5d209cd5324591587e85fce9b47c18172d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5318
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Jessica Hamilton 2021-07-21 01:28:04 +00:00 committed by Adrien Destugues
parent 8a30322767
commit e9e00b80c0
2 changed files with 15 additions and 2 deletions

View File

@ -161,7 +161,7 @@ binutilsObjDir="$objDir/binutils"
gccObjDir="$objDir/gcc"
gdbObjDir="$objDir/gdb"
stdcxxObjDir="$objDir/stdcxx"
sysrootDir="$installDir/sysroot"
sysrootDir=${HAIKU_USE_SYSROOT:-"$installDir/sysroot"}
tmpIncludeDir="$sysrootDir/boot/system/develop/headers"
tmpLibDir="$sysrootDir/boot/system/develop/lib"
@ -279,7 +279,11 @@ mv "$installDir/$haikuMachine/lib/libstdc++.a" \
"$installDir/$haikuMachine/lib/libstdc++-static.a"
# remove the sysroot dir
rm -rf "$sysrootDir"
if [ -n "$HAIKU_USE_SYSROOT" ]; then
rm -rf "$sysrootDir"/boot/system/*
else
rm -rf "$sysrootDir"
fi
# remove the objects dir
rm -rf "$objDir"

9
configure vendored
View File

@ -67,6 +67,9 @@ options:
on to the make building the build tools.
--no-downloads Do not download anything. Useful when trying to
bootstrap and build Haiku from source only.
--sysroot The location of the cross-compiler sysroot,
primarily for CI environments or cross-compilers
used outside of the Haiku build system.
--target-arch <arch> Haiku only: Specify the target architecture to
build for. Must be one of the architectures of the
host system. The installed build tools for that
@ -688,6 +691,11 @@ supportedTargetArchs="
#
while [ $# -gt 0 ] ; do
case "$1" in
--sysroot)
assertparam "$1" $#
crossToolsSysroot=$2
shift 2
;;
--bootstrap)
assertparams "$1" 3 $#
HOST_HAIKU_PORTER="`absolute_path $2`"
@ -1006,6 +1014,7 @@ else
HAIKU_USE_GCC_GRAPHITE_$targetArch` \
HAIKU_USE_GCC_PIPE=$HAIKU_USE_GCC_PIPE \
HAIKU_USE_GDB="$gdbSources" \
HAIKU_USE_SYSROOT="$crossToolsSysroot" \
"$script" $scriptArgs "$sourceDir" "$buildCrossTools" \
"$crossToolsDir" $buildCrossToolsJobs || exit 1
else