summaryrefslogtreecommitdiff
path: root/util/crossgcc
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-06-15 12:36:53 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-06-17 03:10:46 +0200
commit93a9630be388e642abad00e4a90f508bf7446741 (patch)
tree87fa9b0adcfca55a109b304e0fdbb8461a6a4071 /util/crossgcc
parentdb6dd817a2875bea010368c588182ae4e5741f63 (diff)
downloadcoreboot-93a9630be388e642abad00e4a90f508bf7446741.tar.xz
buildgcc: Clarify required user action
When required tools are missing, try to give the user more detailed information on how to solve the problem. Change-Id: Ifa21c1af38a036a7d4f5a786041a87a7d45f4ec5 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10555 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/crossgcc')
-rwxr-xr-xutil/crossgcc/buildgcc14
1 files changed, 13 insertions, 1 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 552a6a2002..0c6193d517 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -107,6 +107,18 @@ normalize_dirs()
perl -pi -e "s,/lib64,/lib," $DESTDIR$TARGETDIR/lib/*.la
}
+please_install()
+{
+ test -r /etc/os-release && source /etc/os-release
+ case "$ID_LIKE" in
+ debian) solution="sudo apt-get install $1" ;;
+ suse) solution="sudo zypper install $1" ;;
+ *) solution="using your OS packaging system" ;;
+ esac
+
+ printf "${RED}ERROR:${red} Missing tool: Please install \'$1\' utility. (eg $solution)${NC}\n" >&2
+}
+
searchtool()
{
# $1 short name
@@ -157,7 +169,7 @@ searchtool()
fi
fi
fi
- printf "${RED}ERROR:${red} Missing tool: Please install $1 (eg using your OS packaging system)${NC}\n" >&2
+ please_install $1
[ -z "$3" ] && exit 1
false
}