diff options
author | Bruno Haible <bruno@clisp.org> | 2011-06-03 10:43:03 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-06-07 23:39:47 +0200 |
commit | 07763e499718396e57c771954e112f464c0618bd (patch) | |
tree | 4f2b8ceb979b64371692ffd48ea5f06a8b30495d /gettext-runtime | |
parent | 3cf31977d683ba9be2e023269a924bf6430df797 (diff) | |
download | external_gettext-07763e499718396e57c771954e112f464c0618bd.zip external_gettext-07763e499718396e57c771954e112f464c0618bd.tar.gz external_gettext-07763e499718396e57c771954e112f464c0618bd.tar.bz2 |
Update from gnulib.
Diffstat (limited to 'gettext-runtime')
-rw-r--r-- | gettext-runtime/m4/ChangeLog | 20 | ||||
-rw-r--r-- | gettext-runtime/m4/longlong.m4 | 83 |
2 files changed, 65 insertions, 38 deletions
diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index e042c65..b304873 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,3 +1,23 @@ +2011-02-18 Eric Blake <eblake@redhat.com> + + longlong: skip, rather than fail, on cross-compilation + * longlong.m4 (AC_TYPE_LONG_LONG_INT): Avoid aborting configure + when cross-compiling; regression from 2011-02-16. + +2011-02-16 Paul Eggert <eggert@cs.ucla.edu> + + longlong: tune, particularly for common case of c99 + * longlong.m4 (AC_TYPE_LONG_LONG_INT): Don't bother compiling + or running anything if c99, or if unsigned long long int does not + work. In either case, we know the answer without further tests. + Do not compile _AC_TYPE_LONG_LONG_SNIPPET twice. Instead, compile + it at most once, and use its results for both long long int and + unsigned long long int. This is more likely to be efficient in + the common case where the program wants to check for both long + long int and unsigned long long int. + (AC_TYPE_UNSIGNED_LONG_LONG_INT): Don't bother compiling if c99, + since the answer is already known. + 2010-12-04 Bruno Haible <bruno@clisp.org> Put more information about failed tests into the test return codes. diff --git a/gettext-runtime/m4/longlong.m4 b/gettext-runtime/m4/longlong.m4 index cca3c1a..aed816c 100644 --- a/gettext-runtime/m4/longlong.m4 +++ b/gettext-runtime/m4/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 14 -dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc. +# longlong.m4 serial 16 +dnl Copyright (C) 1999-2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. -# This fixes a bug in Autoconf 2.61, but can be removed once we -# assume 2.62 everywhere. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be @@ -16,35 +16,39 @@ dnl From Paul Eggert. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], - [AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. - dnl If cross compiling, assume the bug isn't important, since - dnl nobody cross compiles for this platform as far as we know. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include <limits.h> - @%:@ifndef LLONG_MAX - @%:@ define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - @%:@ define LLONG_MAX (HALF - 1 + HALF) - @%:@endif]], - [[long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0;]])], - [ac_cv_type_long_long_int=yes], - [ac_cv_type_long_long_int=no], - [ac_cv_type_long_long_int=yes])], - [ac_cv_type_long_long_int=no])]) + [ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug is not important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include <limits.h> + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [], + [ac_cv_type_long_long_int=no], + [:]) + fi + fi]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) @@ -52,8 +56,8 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], ]) # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. -# This fixes a bug in Autoconf 2.61, but can be removed once we -# assume 2.62 everywhere. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT @@ -64,10 +68,13 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], - [AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [ac_cv_type_unsigned_long_long_int=yes], - [ac_cv_type_unsigned_long_long_int=no])]) + [ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [], + [ac_cv_type_unsigned_long_long_int=no]) + fi]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) |