summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-08 00:51:44 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-08 00:51:44 +0000
commit064aae138b1b26d326603c5c46763e6bde4bf5f2 (patch)
tree059ccb7abf936a0b3802dcb6510b80b91de40df2 /configure
parent699e4642a9df17591e7586c91921fc3d6b31616e (diff)
downloadhqemu-064aae138b1b26d326603c5c46763e6bde4bf5f2.zip
hqemu-064aae138b1b26d326603c5c46763e6bde4bf5f2.tar.gz
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
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure13
1 files changed, 10 insertions, 3 deletions
diff --git a/configure b/configure
index ae10b58..aae84af 100755
--- a/configure
+++ b/configure
@@ -293,9 +293,16 @@ cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}"
strip="${cross_prefix}${strip}"
-if [ ! -x "`which $cc`" ] ; then
- echo "Compiler $cc could not be found"
- exit
+# check that the C compiler works.
+cat > $TMPC <<EOF
+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
if test "$mingw32" = "yes" ; then
OpenPOWER on IntegriCloud