From: Yann E. MORIN Date: Thu, 13 Aug 2015 12:13:23 +0000 (+0200) Subject: toolchain/external: ensure gcc version is known X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23fde76859ddcbc6415f61ddfdd4ee14453eb758;p=buildroot.git toolchain/external: ensure gcc version is known Currently, when a preconfigured prebuilt toolchain forgets to specify its gcc version, the error message is a bit misleading, like: Incorrect selection of gcc version: expected .x, got 4.9.2 Add a an explicit check for the gcc version being set, that reports a better error message. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Signed-off-by: Thomas Petazzoni --- diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 7c70d35a3a..85a9407642 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -193,6 +193,10 @@ check_kernel_headers_version = \ # check_gcc_version = \ expected_version="$(strip $2)" ; \ + if [ -z "$${expected_version}" ]; then \ + printf "Internal error, gcc version unknown (no GCC_AT_LEAST_X_Y selected)\n"; \ + exit 1 ; \ + fi; \ real_version=`$(1) --version | sed -r -e '1!d; s/^[^)]+\) ([^[:space:]]+).*/\1/;'` ; \ if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \ printf "Incorrect selection of gcc version: expected %s.x, got %s\n" \