build-all: Allow passing --host for cross compiling the tools

This commit is contained in:
Martin Storsjö committed 2023-04-26 19:18:24 +03:00
1 parent 06f44cda62
commit 8f3c096ef5
1 file changed
+8 -4
+8 -4
View File
@@ -19,6 +19,7 @@ set -e
LLVM_ARGS="" LLVM_ARGS=""
MINGW_ARGS="" MINGW_ARGS=""
CFGUARD_ARGS="--enable-cfguard" CFGUARD_ARGS="--enable-cfguard"
HOST_ARGS=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
@@ -57,6 +58,9 @@ while [ $# -gt 0 ]; do
--no-runtimes) --no-runtimes)
NO_RUNTIMES=1 NO_RUNTIMES=1
;; ;;
--host=*)
HOST_ARGS="$HOST_ARGS $1"
;;
*) *)
if [ -n "$PREFIX" ]; then if [ -n "$PREFIX" ]; then
echo Unrecognized parameter $1 echo Unrecognized parameter $1
@@ -79,15 +83,15 @@ for dep in git cmake; do
fi fi
done done
./build-llvm.sh $PREFIX $LLVM_ARGS ./build-llvm.sh $PREFIX $LLVM_ARGS $HOST_ARGS
if [ -z "$NO_LLDB" ] && [ -z "$NO_LLDB_MI" ]; then if [ -z "$NO_LLDB" ] && [ -z "$NO_LLDB_MI" ]; then
./build-lldb-mi.sh $PREFIX ./build-lldb-mi.sh $PREFIX $HOST_ARGS
fi fi
if [ -z "$FULL_LLVM" ]; then if [ -z "$FULL_LLVM" ]; then
./strip-llvm.sh $PREFIX ./strip-llvm.sh $PREFIX
fi fi
./install-wrappers.sh $PREFIX ./install-wrappers.sh $PREFIX $HOST_ARGS
./build-mingw-w64-tools.sh $PREFIX ./build-mingw-w64-tools.sh $PREFIX $HOST_ARGS
if [ -n "$NO_RUNTIMES" ]; then if [ -n "$NO_RUNTIMES" ]; then
exit 0 exit 0
fi fi