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 <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12852
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth
2016-01-06 13:54:32 -07:00
committed by Stefan Reinauer
parent 2ed0aa258f
commit e396317244

View File

@@ -114,6 +114,9 @@ please_install()
esac esac
printf "${RED}ERROR:${red} Missing tool: Please install \'$1\' utility. (eg $solution)${NC}\n" >&2 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() searchtool()
@@ -121,6 +124,7 @@ searchtool()
# $1 short name # $1 short name
# $2 search string # $2 search string
# $3 soft fail if set # $3 soft fail if set
# $4 alternative package to install on failure
# result: file name of that tool on stdout # result: file name of that tool on stdout
# or no output if nothing suitable was found # or no output if nothing suitable was found
search=GNU search=GNU
@@ -166,8 +170,8 @@ searchtool()
fi fi
fi fi
fi fi
please_install $1
[ -z "$3" ] && exit 1 [ -z "$3" ] && please_install $1 $4 && exit 1
false false
} }
@@ -643,7 +647,7 @@ searchtool bison > /dev/null
searchtool flex flex > /dev/null searchtool flex flex > /dev/null
searchtool g++ "Free Software Foundation" nofail > /dev/null || \ searchtool g++ "Free Software Foundation" nofail > /dev/null || \
searchtool clang "clang version" 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 wget > /dev/null
searchtool bzip2 "bzip2," > /dev/null searchtool bzip2 "bzip2," > /dev/null