Test if compiler works instead of checking if binary exists.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1909 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
pbrook 2006-05-08 00:51:44 +00:00
parent 699e4642a9
commit 064aae138b

13
configure vendored
View File

@ -293,9 +293,16 @@ cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}" ar="${cross_prefix}${ar}"
strip="${cross_prefix}${strip}" strip="${cross_prefix}${strip}"
if [ ! -x "`which $cc`" ] ; then # check that the C compiler works.
echo "Compiler $cc could not be found" cat > $TMPC <<EOF
exit int main(void) {}
EOF
if $cc -c -o $TMPO $TMPC 2>/dev/null ; then
: C compiler works ok
else
echo "ERROR: \"$cc\" either does not exist or does not work"
exit 1
fi fi
if test "$mingw32" = "yes" ; then if test "$mingw32" = "yes" ; then