From: "Jim C. Brown" <jma5@umd.edu>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] -cc checking wrong
Date: Sun, 7 May 2006 20:34:11 -0400 [thread overview]
Message-ID: <20060508003411.GB15033@jbrown.mylinuxbox.org> (raw)
In-Reply-To: <20060508001855.GA15033@jbrown.mylinuxbox.org>
[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]
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.
[-- Attachment #2: configure.patch --]
[-- Type: text/plain, Size: 719 bytes --]
--- 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
next prev parent reply other threads:[~2006-05-08 0:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-01 7:41 [Qemu-devel] -cc checking wrong Pavel Janík
2006-05-07 22:46 ` Pavel Janík
2006-05-08 0:18 ` Jim C. Brown
2006-05-08 0:34 ` Jim C. Brown [this message]
2006-05-08 7:52 ` Pavel Janík
2006-05-08 15:12 ` Jim C. Brown
2006-05-08 18:53 ` Pavel Janík
2006-05-08 19:08 ` Jim C. Brown
2006-05-08 0:53 ` Paul Brook
2006-05-08 1:13 ` Jim C. Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060508003411.GB15033@jbrown.mylinuxbox.org \
--to=jma5@umd.edu \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).