[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCHv2] configure: verify stdio.h
From: |
Måns Rullgård |
Subject: |
[Qemu-devel] Re: [PATCHv2] configure: verify stdio.h |
Date: |
Tue, 26 Jan 2010 18:12:57 +0000 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (Instant Classic, linux) |
"Michael S. Tsirkin" <address@hidden> writes:
> Verify that stdio.h supports %lld %zd.
> Some migw variants don't unless requested explicitly (see
> http://www.mail-archive.com/address@hidden/msg00417.html)
> ), detect them early.
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Acked-by: Juan Quintela <address@hidden>
>
> ---
>
> changes from v1:
> removed leftover chunk
>
> configure | 20 ++++++++++++++++++++
> 1 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
> exit 1
> fi
>
> +# Check that stdio.h compiler is sane: some
> +# mingw variants do not support %z %l that we rely on
> +cat > $TMPC <<EOF
> +#include <stddef.h>
> +#include <stdio.h>
> +size_t z = 1;
> +long long ll = 2;
> +int main(void) {
> + printf("z=%zd;ll=%lld;\n", z, ll);
> + return 0;
> +}
> +EOF
> +
> +if compile_prog && ($TMPE | grep "z=1;ll=2;" > /dev/null); then
> + : C compiler works ok
> +else
> + echo "ERROR: \"$cc\" does not have a working stdio.h"
> + exit 1
> +fi
> +
> check_define() {
> cat > $TMPC <<EOF
> #if !defined($1)
This makes cross-compiling impossible. Is that really desirable?
--
Måns Rullgård
address@hidden