toolchain/external: ensure gcc version is known
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 13 Aug 2015 12:13:23 +0000 (14:13 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 18 Aug 2015 09:47:23 +0000 (11:47 +0200)
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" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
toolchain/helpers.mk

index 7c70d35a3af5a4171edf7a449fa21622bbf6640d..85a9407642aaac2024cfe08a67cf16da724d1ca7 100644 (file)
@@ -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" \