cpython: fbbf9c187662 (original) (raw)
Mercurial > cpython
changeset 75704:fbbf9c187662
- Issue #14324: Fix configure tests for cross builds. when using gcc, use a compilation test for the cross build check for long long format. [#14324]
Matthias Klose doko@ubuntu.com | |
---|---|
date | Thu, 15 Mar 2012 19:31:06 +0100 |
parents | 52597f888e7a |
children | 29ee48f843ec |
files | Misc/NEWS configure configure.ac |
diffstat | 3 files changed, 49 insertions(+), 2 deletions(-)[+] [-] Misc/NEWS 2 configure 31 configure.ac 18 |
line wrap: on
line diff
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -111,6 +111,8 @@ Build
- Issue #14321: Do not run pgen during the build if files are up to date. +- Issue #14324: Fix configure tests for cross builds. + Extension Modules -----------------
--- a/configure +++ b/configure @@ -13805,7 +13805,36 @@ then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then :
- 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
#include <stdio.h>[](#l2.15)
#include <stddef.h>[](#l2.16)
char *buffer;[](#l2.22)
sprintf(buffer, "%lld", (long long)123);[](#l2.23)
sprintf(buffer, "%lld", (long long)-123);[](#l2.24)
sprintf(buffer, "%llu", (unsigned long long)123);[](#l2.25)
- ;
- 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. */
--- 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="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>[](#l3.13)
#include <stddef.h>[](#l3.14)
]], [[[](#l3.15)
char *buffer;[](#l3.16)
sprintf(buffer, "%lld", (long long)123);[](#l3.17)
sprintf(buffer, "%lld", (long long)-123);[](#l3.18)
sprintf(buffer, "%llu", (unsigned long long)123);[](#l3.19)
]])],[](#l3.20)
ac_cv_have_long_long_format=yes[](#l3.21)
- )
- CFLAGS=$save_CFLAGS
- fi]) ) AC_MSG_RESULT($ac_cv_have_long_long_format) fi