diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2015-06-11 21:07:31 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-06-12 02:31:37 +0200 |
commit | f2c15f513622a24eb14f309921d52c6052b28f99 (patch) | |
tree | 4a2e385b94e8e5379d7f64efe854a07c68ef6b8f | |
parent | 1f38d7986828fb58ced4a30bb17accb03943e798 (diff) |
buildgcc: replace [[ ... == ... ]] with something more portable
using grep is an extra process invocation, but it's not a bashism.
Also match precisely, so AGCC doesn't trigger on GCC (we don't have collisions
right now, but we won't have to deal with them in the future)
Change-Id: I242833c350b7f1e6a6793f288c1aae0b50d57a26
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10518
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rwxr-xr-x | util/crossgcc/buildgcc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 3bee6dc725..0979074985 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -238,6 +238,11 @@ fn_exists() type $1 2>/dev/null | grep -q 'is a function' } +is_package_enabled() +{ + echo "$PACKAGES" |grep -q "\<$1\>" +} + build() { package=$1 @@ -248,7 +253,7 @@ build() { mkdir -p ${BUILDDIR} - [[ "$PACKAGES" == *$package* ]] && \ + is_package_enabled "$package" && \ if [ -f ${BUILDDIR}/.success ]; then printf "Skipping $package as it is already built\n" else @@ -569,7 +574,7 @@ fi # Set up host compiler and flags needed for various OSes CC=cc -if [[ "$PACKAGES" == *GCC* ]]; then +if is_package_enabled "GCC"; then if [ $UNAME = "Darwin" ]; then #GCC_OPTIONS="$GCC_OPTIONS --enable-threads=posix" |