summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2012-03-15 18:31:06 (GMT)
committerMatthias Klose <doko@ubuntu.com>2012-03-15 18:31:06 (GMT)
commit3b739b149b4bdb85ed593b0d0a0c9d2790dbd988 (patch)
treeba7edeb1738a7b634e5f1c54a2968d29400566ee /configure.ac
parent93a0ef16c939581fb366897d2f07c395601f8ddf (diff)
downloadcpython-3b739b149b4bdb85ed593b0d0a0c9d2790dbd988.zip
cpython-3b739b149b4bdb85ed593b0d0a0c9d2790dbd988.tar.gz
cpython-3b739b149b4bdb85ed593b0d0a0c9d2790dbd988.tar.bz2
- Issue #14324: Fix configure tests for cross builds.
when using gcc, use a compilation test for the cross build check for long long format.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a38a5cc..2bcbedf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4128,7 +4128,23 @@ then
]]])],
[ac_cv_have_long_long_format=yes],
[ac_cv_have_long_long_format=no],
- [ac_cv_have_long_long_format=no])
+ [ac_cv_have_long_long_format="cross -- assuming no"
+ if test x$GCC = xyes; then
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -Werror -Wformat"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdio.h>
+ #include <stddef.h>
+ ]], [[
+ char *buffer;
+ sprintf(buffer, "%lld", (long long)123);
+ sprintf(buffer, "%lld", (long long)-123);
+ sprintf(buffer, "%llu", (unsigned long long)123);
+ ]])],
+ ac_cv_have_long_long_format=yes
+ )
+ CFLAGS=$save_CFLAGS
+ fi])
)
AC_MSG_RESULT($ac_cv_have_long_long_format)
fi