On Sun, May 07, 2006 at 08:18:55PM -0400, Jim C. Brown wrote:
> 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.

Slightly different patch.

The right thing to do might be to check if the first arg is ccache, and if
so check for both ccache and the 2nd compiler. Especially if ccache is the
only compiler that requires arguments be passed to it in --cc or CC=

This patch assumes the above.

> 
> > 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.

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
--- configure.orig      Sun May  7 20:14:23 2006
+++ configure   Sun May  7 20:33:49 2006
@@ -293,9 +293,29 @@
 ar="${cross_prefix}${ar}"
 strip="${cross_prefix}${strip}"
 
-if [ ! -x "`which $cc`" ] ; then
+# cc_head=`echo $cc | xargs printf 2> /dev/null`
+cc_head=`echo $cc | awk '{ printf $1 }'`
+cc_tail=`echo $cc | awk '{ printf $2 }'`
+
+if [ "$cc_head" = "ccache" ]; then
+
+if [ ! -x "`which $cc_head`" ] ; then
+    echo "ccache could not be found"
+    exit
+fi
+
+if [ ! -x "`which $cc_tail`" ] ; then
+    echo "Compiler $cc_tail could not be found"
+    exit
+fi
+
+else
+
+if [ ! -x "`which $cc_head`" ] ; then
     echo "Compiler $cc could not be found"
     exit
+fi
+
 fi
 
 if test "$mingw32" = "yes" ; then
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to