From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FcthW-0004PU-7v for qemu-devel@nongnu.org; Sun, 07 May 2006 20:34:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FcthU-0004Nq-T6 for qemu-devel@nongnu.org; Sun, 07 May 2006 20:34:13 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FcthU-0004Nk-K3 for qemu-devel@nongnu.org; Sun, 07 May 2006 20:34:12 -0400 Received: from [128.8.10.163] (helo=po1.wam.umd.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FctiD-00074c-8b for qemu-devel@nongnu.org; Sun, 07 May 2006 20:34:57 -0400 Received: from jbrown.mylinuxbox.org (jma-box.student.umd.edu [129.2.253.219]) by po1.wam.umd.edu (8.12.11.20060308/8.12.10) with ESMTP id k480YBdW028084 for ; Sun, 7 May 2006 20:34:11 -0400 (EDT) Date: Sun, 7 May 2006 20:34:11 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] -cc checking wrong Message-ID: <20060508003411.GB15033@jbrown.mylinuxbox.org> References: <87aca2qjj9.fsf@Janik.cz> <87d5eppicn.fsf@Janik.cz> <20060508001855.GA15033@jbrown.mylinuxbox.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GZVR6ND4mMseVXL/" Content-Disposition: inline In-Reply-To: <20060508001855.GA15033@jbrown.mylinuxbox.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="configure.patch" --- 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 --GZVR6ND4mMseVXL/--