qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCHv2] configure: verify stdio.h
@ 2010-01-26 16:01 Michael S. Tsirkin
  2010-01-26 18:12 ` [Qemu-devel] " Måns Rullgård
  2010-01-26 21:44 ` Stefan Weil
  0 siblings, 2 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2010-01-26 16:01 UTC (permalink / raw)
  To: weil, hpoussin, lcapitulino, Anthony Liguori, qemu-devel,
	berrange, Juan Quintela

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/msg00417.html)
), detect them early.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@trasno.org>

---

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)
-- 
1.6.6.144.g5c3af

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-01-28 17:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-26 16:01 [Qemu-devel] [PATCHv2] configure: verify stdio.h Michael S. Tsirkin
2010-01-26 18:12 ` [Qemu-devel] " Måns Rullgård
2010-01-26 19:31   ` Blue Swirl
2010-01-26 21:44 ` Stefan Weil
2010-01-27  9:13   ` Michael S. Tsirkin
2010-01-27 19:02     ` Stefan Weil
2010-01-27 19:12       ` Michael S. Tsirkin
2010-01-27 21:48         ` Måns Rullgård
2010-01-28 17:48       ` Michael S. Tsirkin

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