[haiku-commits] haiku: hrev56157 - build/scripts

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 5 Jun 2022 09:08:23 +0000 (UTC)

hrev56157 adds 1 changeset to branch 'master'
old head: 8a30322767fff0ffb3e56193015ac6898321807f
new head: e9e00b80c07ebad2f0a5b1e9365047044c762933
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=e9e00b80c07e+%5E8a30322767ff

----------------------------------------------------------------------------

e9e00b80c07e: 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@xxxxxxxxxxxx>
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

                         [ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev56157
Commit:      e9e00b80c07ebad2f0a5b1e9365047044c762933
URL:         https://git.haiku-os.org/haiku/commit/?id=e9e00b80c07e
Author:      Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date:        Wed Jul 21 01:28:04 2021 UTC
Committer:   Adrien Destugues <pulkomandy@xxxxxxxxx>
Commit-Date: Sun Jun  5 09:08:20 2022 UTC

----------------------------------------------------------------------------

2 files changed, 15 insertions(+), 2 deletions(-)
build/scripts/build_cross_tools_gcc4 | 8 ++++++--
configure                            | 9 +++++++++

----------------------------------------------------------------------------

diff --git a/build/scripts/build_cross_tools_gcc4 
b/build/scripts/build_cross_tools_gcc4
index 55bee36d50..bd48a63e2e 100755
--- a/build/scripts/build_cross_tools_gcc4
+++ b/build/scripts/build_cross_tools_gcc4
@@ -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"
diff --git a/configure b/configure
index 1de4f74286..fcabba206d 100755
--- a/configure
+++ b/configure
@@ -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


Other related posts:

  • » [haiku-commits] haiku: hrev56157 - build/scripts - Adrien Destugues