summaryrefslogtreecommitdiffstats
path: root/patches/Python-2.6.2/0004--configure.in-printf-format-zd.patch
blob: 5b2d5533c2bd0dc54ae12e35f4227d3b5d5a8cd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 44a7b5cd5bca0d11b785d917a842d6436f6ad19f Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Thu, 23 Apr 2009 08:49:08 +0200
Subject: [PATCH] [configure.in] printf format %zd

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 configure.in |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/configure.in b/configure.in
index 0af62ae..b86ee74 100644
--- a/configure.in
+++ b/configure.in
@@ -3700,7 +3700,8 @@ else
 fi
 
 AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include <stdio.h>
+AC_CACHE_VAL([ac_cv_py_format_size_t],[
+  AC_RUN_IFELSE([#include <stdio.h>
 #include <stddef.h>
 #include <string.h>
 
@@ -3734,9 +3735,23 @@ int main()
 
     return 0;
 }],
-[AC_MSG_RESULT(yes)
- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
- AC_MSG_RESULT(no))
+  [ac_cv_py_format_size_t=yes],
+  [ac_cv_py_format_size_t=no],
+  [ac_cv_py_format_size_t=cross],
+)])
+
+case "${ac_cv_py_format_size_t}" in
+yes)
+  AC_MSG_RESULT([yes])
+  AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])
+  ;;
+no)
+  AC_MSG_RESULT([no])
+  ;;
+*)
+  AC_MSG_ERROR([cross compiling - please ac_cv_py_format_size_t to yes (for working %zd printf() format support) or no])
+  ;;
+esac
 
 AC_CHECK_TYPE(socklen_t,,
   AC_DEFINE(socklen_t,int,
-- 
1.5.6.3