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>
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 3bee6dc..0979074 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -238,6 +238,11 @@
 	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 @@
 
 	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 @@
 # 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"