summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2012-03-15 19:31:06 +0100
committerMatthias Klose <doko@ubuntu.com>2012-03-15 19:31:06 +0100
commitb1b8ea6ea61e8264b9dc92b41f6565fdfca6a382 (patch)
tree67fe7a2ceca7ff33e032597ec88fcfc586b7e48d /configure
parent7d7ad8dbc07c24a663c62b9c19f21fc1ec1c9d5c (diff)
downloadcpython-b1b8ea6ea61e8264b9dc92b41f6565fdfca6a382.tar.gz
- 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')
-rwxr-xr-xconfigure31
1 files changed, 30 insertions, 1 deletions
diff --git a/configure b/configure
index a71e128cbf..8f5845dbfc 100755
--- a/configure
+++ b/configure
@@ -13805,7 +13805,36 @@ $as_echo_n "checking for %lld and %llu printf() format support... " >&6; }
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- 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"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <stddef.h>
+
+int
+main ()
+{
+
+ char *buffer;
+ sprintf(buffer, "%lld", (long long)123);
+ sprintf(buffer, "%lld", (long long)-123);
+ sprintf(buffer, "%llu", (unsigned long long)123);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_have_long_long_format=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$save_CFLAGS
+ fi
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */