From e396317244191df506bb2b566f91a518b639f213 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Wed, 6 Jan 2016 13:54:32 -0700 Subject: buildgcc: Don't request that optional tools be installed Previously, when we tested for g++ and two different versions of clang, if the earlier versions were not found, buildgcc would still request that they be installed. This obviously isn't needed, and isn't the desired outcome. Now, if one of the first tests fails, nothing gets printed. If all the tests fail, it tells you to install either g++ or clang. Change-Id: I71359f59c4c6bee3c3c55e4e6105f11e6ca51527 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/12852 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/crossgcc/buildgcc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 3c5b35a4e2..8e97439d84 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -114,6 +114,9 @@ please_install() esac printf "${RED}ERROR:${red} Missing tool: Please install \'$1\' utility. (eg $solution)${NC}\n" >&2 + if [ -n "$2" ]; then + printf "${RED}ERROR:${red} or install \'$2\' utility. (eg $solution)${NC}\n" >&2 + fi } searchtool() @@ -121,6 +124,7 @@ searchtool() # $1 short name # $2 search string # $3 soft fail if set + # $4 alternative package to install on failure # result: file name of that tool on stdout # or no output if nothing suitable was found search=GNU @@ -166,8 +170,8 @@ searchtool() fi fi fi - please_install $1 - [ -z "$3" ] && exit 1 + + [ -z "$3" ] && please_install $1 $4 && exit 1 false } @@ -643,7 +647,7 @@ searchtool bison > /dev/null searchtool flex flex > /dev/null searchtool g++ "Free Software Foundation" nofail > /dev/null || \ searchtool clang "clang version" nofail > /dev/null || \ -searchtool clang "LLVM" > /dev/null +searchtool clang "LLVM" "" "g++" > /dev/null searchtool wget > /dev/null searchtool bzip2 "bzip2," > /dev/null -- cgit v1.2.3