summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-01-06 13:54:32 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2016-01-07 22:59:02 +0100
commite396317244191df506bb2b566f91a518b639f213 (patch)
tree3a982969cb95f5c6aefa2b0296337a0816652ddb
parent2ed0aa258f4bcbf978998ccd3a76f7b1c2d3d031 (diff)
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>
-rwxr-xr-xutil/crossgcc/buildgcc10
1 files 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