util/crossgcc/buildgcc: quote parameters that may have spaces
On certain versions of /bin/sh assigning variables with spaces
unquoted leads to failures. Therefore, quote variables that
are known to be passed in that have spaces.
Change-Id: I007c56c3bfb8183bb4b16cf0591f6aa508fd105d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14280
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 4641ae9..e2a30d8 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -191,7 +191,7 @@
# Run a compile check of the specified library option to see if it's installed
check_for_library() {
local LIBRARY_FLAGS=$1
- local LIBRARY_PACKAGES=$2
+ local LIBRARY_PACKAGES="$2"
local LIBTEST_FILE=.libtest
echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" > "${LIBTEST_FILE}.c"