summaryrefslogtreecommitdiffstats
path: root/patches/Python-3.0rc2/generic/Python-3.0rc2-printf_zd.diff
blob: 089210d0290ee6131d8fdb7a8614c823d3fd6f72 (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
---
 configure.in |   22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

Index: Python-3.0rc2/configure.in
===================================================================
--- Python-3.0rc2.orig/configure.in
+++ Python-3.0rc2/configure.in
@@ -3580,7 +3580,7 @@ else
 fi
 
 AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include <stdio.h>
+AC_RUN_IFELSE([#include <stdio.h>
 #include <stddef.h>
 #include <string.h>
 
@@ -3613,10 +3613,22 @@ int main()
 	return 1;
 
     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_CACHE_VAL(ac_cv_py_format_size_t, ac_cv_py_format_size_t="z")
+  AC_MSG_RESULT(yes)
+],[
+  AC_CACHE_VAL(ac_cv_py_format_size_t, ac_cv_py_format_size_t="")
+  AC_MSG_RESULT(no)
+],[
+  AC_CACHE_VAL(ac_cv_py_format_size_t, ac_cv_py_format_size_t=undef)
+  AC_MSG_RESULT([crosscompiling, ac_cv_py_format_size_t=$ac_cv_py_format_size_t])
+]
+)
+if test "$ac_cv_py_format_size_t" = "undef"; then
+  AC_MSG_ERROR([please specify ac_cv_py_format_size_t])
+fi
+AC_DEFINE_UNQUOTED(PY_FORMAT_SIZE_T, "$ac_cv_py_format_size_t", [Define to printf format modifier for Py_ssize_t])
 
 AC_CHECK_TYPE(socklen_t,,
   AC_DEFINE(socklen_t,int,