From 16c915ec1826dcef2e58ecc055a3f5dfcefb235a Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 2 Feb 2016 22:54:48 +0000 Subject: [PATCH] configure: allow for compiler toolchain override (with warnings) The current configure script unfortunately does not allow one to use another toolchain than the one hardwire in the script. Although this is good to ensure working builds, it can be burden when one wants to either test other compilers, does not want to have to multiple redundant compilers or when the compiler install script fails for unknown reasons (MIPS I'm looking at you). The syntax is simple, for example: /path/to/configure --compiler-prefix arm-none-eabi- Also 'make reconf' will properly keep the prefix. Change-Id: I5ee3bc61afa10193586ddd3aef694a8ac08854e2 --- tools/configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/configure b/tools/configure index ec8350212a..efad8a7c46 100755 --- a/tools/configure +++ b/tools/configure @@ -51,6 +51,12 @@ input() { prefixtools () { prefix="$1" + if [ -n "$ARG_COMPILER_PREFIX" ]; then + echo "WARNING: asked to override target toolchain $1 with $ARG_COMPILER_PREFIX" + echo "WARNING: overriding the toolchain means you are running an untested configuration" + echo "WARNING: you build might be broken because of that" + prefix="$ARG_COMPILER_PREFIX" + fi CC=${prefix}gcc CPP=${prefix}cpp WINDRES=${prefix}windres @@ -1229,6 +1235,7 @@ help() { behavior of falling back to them if no native thread support was found. --prefix Target installation directory + --compiler-prefix Override compiler prefix (inherently dangerous) --help Shows this message (must not be used with other options) EOF @@ -1271,6 +1278,7 @@ for arg in "$@"; do --no-sdl-threads) ARG_THREAD_SUPPORT=0;; --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;; + --compiler-prefix=*) ARG_COMPILER_PREFIX=`echo "$arg" | cut -d = -f 2`;; --help) help;; *) err=1; echo "[ERROR] Option '$arg' unsupported";; esac