Martin Roth (martinroth@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12852
-gerrit
commit 7c57767419097079900a29175533b6619d0f2f59 Author: Martin Roth martinroth@google.com Date: Wed Jan 6 13:54:32 2016 -0700
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 --- util/crossgcc/buildgcc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 31db9cb..5628a3a 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 }
@@ -644,7 +648,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