From f2c15f513622a24eb14f309921d52c6052b28f99 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 11 Jun 2015 21:07:31 +0200 Subject: 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 Reviewed-on: http://review.coreboot.org/10518 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/crossgcc/buildgcc | 9 +++++++-- 1 file 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" -- cgit v1.2.3