On Mon, May 08, 2006 at 12:46:24AM +0200, Pavel Jan?k wrote:
> configure contains:
> 
> if [ ! -x "`which $cc`" ] ; then
>     echo "Compiler $cc could not be found"
>     exit
> fi
> 
> You should check if the command compiles, not if it exists and is executable.

Patch attached. Simply tries to compile a dummy program.

> Two wrongs do not make a right.
>                   -- Linus Torvalds in linux-kernel

I find that quote very ironic ... ;)

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
--- configure.orig      Sun May  7 20:14:23 2006
+++ configure   Sun May  7 20:16:58 2006
@@ -293,8 +293,14 @@
 ar="${cross_prefix}${ar}"
 strip="${cross_prefix}${strip}"
 
-if [ ! -x "`which $cc`" ] ; then
-    echo "Compiler $cc could not be found"
+# check that gcc is able to compile
+cat > $TMPC <<EOF
+int main(void) {
+}
+EOF
+
+if $cc -o $TMPE $TMPC 2>/dev/null ; then
+    echo "Compiler $cc either does not exist or does not work"
     exit
 fi
 
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to