autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.68-38-g


From: Paul Eggert
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.68-38-gcdef0d2
Date: Wed, 16 Feb 2011 09:29:56 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=cdef0d2dad57f92301cb4baf782f8c24b01d5f1d

The branch, master has been updated
       via  cdef0d2dad57f92301cb4baf782f8c24b01d5f1d (commit)
      from  e5fb1ec281e5bcd37d686bb7ce4994a7b4fee65d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cdef0d2dad57f92301cb4baf782f8c24b01d5f1d
Author: Paul Eggert <address@hidden>
Date:   Wed Feb 16 01:29:40 2011 -0800

    autoconf: tune long long tests, particularly for c99
    
    This change is imported from gnulib.
    * lib/autoconf/types.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.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |   16 ++++++++++
 lib/autoconf/types.m4 |   74 ++++++++++++++++++++++++++----------------------
 2 files changed, 56 insertions(+), 34 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fbfbc53..79b9058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-02-16  Paul Eggert  <address@hidden>
+
+       autoconf: tune long long tests, particularly for c99
+
+       This change is imported from gnulib.
+       * lib/autoconf/types.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.
+
 2011-02-15  Eric Blake  <address@hidden>
 
        doc: fix debug advice typo
diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4
index 6583cb0..166aeb5 100644
--- a/lib/autoconf/types.m4
+++ b/lib/autoconf/types.m4
@@ -500,37 +500,40 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 # ---------------------
 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(
-            address@hidden:@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(
+              address@hidden:@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,
+    AC_DEFINE([HAVE_LONG_LONG_INT], [1],
       [Define to 1 if the system has the type `long long int'.])
   fi
 ])
@@ -542,12 +545,15 @@ 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,
+    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
       [Define to 1 if the system has the type `unsigned long long int'.])
   fi
 ])


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]