From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZr8V-0003Mz-7Q for qemu-devel@nongnu.org; Tue, 26 Jan 2010 14:31:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZr8Q-0003Jx-BP for qemu-devel@nongnu.org; Tue, 26 Jan 2010 14:31:38 -0500 Received: from [199.232.76.173] (port=35313 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZr8Q-0003Jp-5a for qemu-devel@nongnu.org; Tue, 26 Jan 2010 14:31:34 -0500 Received: from mail-pw0-f43.google.com ([209.85.160.43]:37329) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZr8P-0001bt-Ot for qemu-devel@nongnu.org; Tue, 26 Jan 2010 14:31:33 -0500 Received: by pwj11 with SMTP id 11so3505252pwj.2 for ; Tue, 26 Jan 2010 11:31:32 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20100126160147.GA3460@redhat.com> From: Blue Swirl Date: Tue, 26 Jan 2010 21:31:12 +0200 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCHv2] configure: verify stdio.h Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= Cc: qemu-devel@nongnu.org 2010/1/26 M=C3=A5ns Rullg=C3=A5rd : > "Michael S. Tsirkin" writes: > >> Verify that stdio.h supports %lld %zd. >> Some migw variants don't unless requested explicitly (see >> http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg00= 417.html) >> ), detect them early. >> >> Signed-off-by: Michael S. Tsirkin >> Acked-by: Juan Quintela >> >> --- >> >> changes from v1: >> =C2=A0 =C2=A0 =C2=A0 removed leftover chunk >> >> =C2=A0configure | =C2=A0 20 ++++++++++++++++++++ >> =C2=A01 files changed, 20 insertions(+), 0 deletions(-) >> >> diff --git a/configure b/configure >> index 5631bbb..6ba06d6 100755 >> --- a/configure >> +++ b/configure >> @@ -123,6 +123,26 @@ else >> =C2=A0 =C2=A0 =C2=A0exit 1 >> =C2=A0fi >> >> +# Check that stdio.h compiler is sane: some >> +# mingw variants do not support %z %l that we rely on >> +cat > $TMPC <> +#include >> +#include >> +size_t z =3D 1; >> +long long ll =3D 2; >> +int main(void) { >> + =C2=A0printf("z=3D%zd;ll=3D%lld;\n", z, ll); >> + =C2=A0return 0; >> +} >> +EOF >> + >> +if compile_prog && ($TMPE | grep "z=3D1;ll=3D2;" > /dev/null); then >> + =C2=A0: C compiler works ok >> +else >> + =C2=A0 =C2=A0echo "ERROR: \"$cc\" does not have a working stdio.h" >> + =C2=A0 =C2=A0exit 1 >> +fi >> + >> =C2=A0check_define() { >> =C2=A0cat > $TMPC <> =C2=A0#if !defined($1) > > This makes cross-compiling impossible. =C2=A0Is that really desirable? I'd rather drop %ll and %z.