@@ -130,6 +130,7 @@ while [[ "$1" = -* ]]; do
;;
--cc)
cc="$arg"
+ cc_selected=yes
;;
--cflags)
cflags="$arg"
@@ -200,6 +201,10 @@ while [[ "$1" = -* ]]; do
esac
done
+if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then
+ cc="$cross_prefix$cc"
+fi
+
if [ -z "$efi" ] || [ "$efi" = "n" ]; then
[ "$efi_direct" = "y" ] && efi_direct=
fi
@@ -370,7 +375,7 @@ fi
cat << EOF > lib-test.c
__UINT32_TYPE__
EOF
-u32_long=$("$cross_prefix$cc" -E lib-test.c | grep -v '^#' | grep -q long && echo yes)
+u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes)
rm -f lib-test.c
# check if slash can be used for division
@@ -379,7 +384,7 @@ if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then
foo:
movl (8 / 2), %eax
EOF
- wa_divide=$("$cross_prefix$cc" -c lib-test.S >/dev/null 2>&1 || echo yes)
+ wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes)
rm -f lib-test.{o,S}
fi
@@ -442,7 +447,7 @@ ARCH=$arch
ARCH_NAME=$arch_name
ARCH_LIBDIR=$arch_libdir
PROCESSOR=$processor
-CC=$cross_prefix$cc
+CC=$cc
CFLAGS=$cflags
LD=$cross_prefix$ld
OBJCOPY=$cross_prefix$objcopy