To get the AROS cross-compiler to be portable between machines, I forced everything to be within "/usr/local/amiga" (actually two folders within that), to roughly match how the Amiga OS3 & OS4 cross-compilers do it. I also ensured they contained no references to the original path they were built on, since that could reference the user/etc that did it.
To achieve all that I did the following below, which is presented as a script - and while it could probably be executed as one, it has no error handling, so instead I copied & pasted a few lines at a time:
# Prepare base directories. NOTE: You can skip this part, if you are re-running this for some reason.
sudo mkdir -p /usr/local/amiga
# enter sudo password!
sudo chown $USER:$USER /usr/local/amiga
sudo mkdir /AROS
sudo chown $USER:$USER /AROS
# Specify the working directory & the AROS source code folder it contains:
clear
cd THE_FOLDER_THAT_CONTAINS_THE_EXTRACTED_AROS_SOURCES_FOLDER
#AROS_source="AROS-20190520-source" # GCC v4.6.4
AROS_source="AROS-20190416-2-source" # GCC v6.5.0
# Create two fake folders used to hide the full path of the working directory:
AROS_base="$(pwd)"
mkdir $AROS_base/build
# These work fine, but the executables still contain references to the non-/AROS path (mainly the build directory):
#ln -s $AROS_base/build /AROS/build
#ln -s $AROS_base/$AROS_source /AROS/source
# While these work best:
mkdir /AROS/build; sudo mount --bind $AROS_base/build /AROS/build
# enter sudo password!
mkdir /AROS/source; sudo mount --bind $AROS_base/$AROS_source /AROS/source
# Prepare the two destination folders that contain the binaries & AROS compiler sysroot:
cd /AROS/build
mkdir -p /usr/local/amiga/bin_aros
mkdir -p /usr/local/amiga/i386-aros; mkdir -p "bin/linux-i386/AROS"; ln -s /usr/local/amiga/i386-aros "bin/linux-i386/AROS/Development"
# Configure GCC's make scripts:
/AROS/source/configure --target=linux-i386 --with-aros-toolchain-install=/usr/local/amiga/bin_aros --prefix=/usr/local/amiga/bin_aros
# Not necessary: --enable-debug
# Fix where the AROS sysroot is expected:
Search="$(pwd)/bin/linux-i386/AROS/Development" ; Replace="/usr/local/amiga/i386-aros"
sed -i "s/${Search//\//\\\/}/${Replace//\//\\\/}/g" bin/linux-i386/gen/config/conf.cmake
sed -i "s/\$(AROSDIR)\/\$(AROS_DIR_DEVELOPER)/${Replace//\//\\\/}/g" config/make.cfg
sed -i "s/\$(AROSDIR)\/\$(AROS_DIR_DEVELOPMENT)/${Replace//\//\\\/}/g" config/make.cfg
sed -i "s/\$(AROSDIR)\/\$(AROS_DIR_INCLUDE)/${Replace//\//\\\/}\/include/g" config/make.cfg
sed -i "s/\$(AROSDIR)\/\$(AROS_DIR_LIB)/${Replace//\//\\\/}\/lib/g" config/make.cfg
# This is only needed for "AROS-20190520-source", to fix MPC_REPOSITORY, but won't cause problems for others:
(while [ ! -f "tools/crosstools/mmakefile" ]; do sleep 1; done; sleep 1; grep "www.multiprecision.org/mpc/download" tools/crosstools/mmakefile >/dev/null && sed -i 's/MPC_REPOSITORY :=/MPC_REPOSITORY := https:\/\/ftp.gnu.org\/gnu\/mpc\n#MPC_REPOSITORY :=/g' tools/crosstools/mmakefile && sed -i 's/ISL_REPOSITORY := ftp:/ISL_REPOSITORY := https:/g' tools/crosstools/mmakefile) &
# Run make:
time make
# Or for "AROS-20190416-2-source" this WOULD faster, but for me GCC fails as it's missing "libm.a":
#time make -s crosstools
# Clean-up unneeded files in the destination
rm -r /usr/local/amiga/i386-aros/{bin,etc,Debug,man,S}
rm /usr/local/amiga/i386-aros/*.info
# Clean-up any mount points:
cd $AROS_base
sudo umount /AROS/build /AROS/source ; rmdir /AROS/build /AROS/source
# enter sudo password!
# Clean-up other stuff
rm /AROS/build /AROS/source #2>/dev/null
rm -fr $AROS_base/build
# Check result:
/usr/local/amiga/bin_aros/i386-aros-g++ -v 2>&1 | sed "s/ /\n/g" | grep / | cat
# Optionally make executables accessible from /usr/local/amiga/bin
cd /usr/local/amiga
mkdir -p bin
find bin_aros/ -maxdepth 1 -type f -iname "[a-z]*" | xargs -n1 basename | xargs -I {} ln -s /usr/local/amiga/bin_aros/{} bin/{}
# Very optionally create a distributable archive (assuming /usr/local/amiga/bin/ only contains executables for AROS & no other Amiga cross-compilers)
cd /usr/local/
tar --owner=root --group=root -cv -f $AROS_base/AROS_GCC.tar.gz --gzip amiga/bin_aros amiga/i386-aros amiga/bin
tar --owner=root --group=root -cv -f $AROS_base/AROS_GCC.tar.xz --xz amiga/bin_aros amiga/i386-aros amiga/bin
# Check archive contents
tar -tvf $AROS_base/AROS_GCC.tar.gz | less
At some point I may make the end result available for others to download (probably after more testing), but as its rather large even when Zipped (170-320MB), I'll have to be careful how I host it.