]> Savannah Git Hosting - gnulib.git/commitdiff
Small autoconf macro improvements.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Jul 2020 23:45:32 +0000 (01:45 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Jul 2020 23:49:25 +0000 (01:49 +0200)
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Make it possible for the user to
override the value of gl_cv_func_working_mktime.
* m4/multiarch.m4 (gl_MULTIARCH): Show a line "checking whether the
compiler produces multi-arch binaries..." in the configure output.
* m4/size_max.m4 (gl_SIZE_MAX): When not found, say "no".
* m4/parse-datetime.m4 (gl_C_COMPOUND_LITERALS): Improve indentation.

ChangeLog
m4/mktime.m4
m4/multiarch.m4
m4/parse-datetime.m4
m4/size_max.m4

index 8d8508941ad663dfe49561021d35d6836a647e4f..d81a1d7019080f872bb08f95b7c3dffc592e85b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-07-25  Bruno Haible  <bruno@clisp.org>
+
+       Small autoconf macro improvements.
+       * m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Make it possible for the user to
+       override the value of gl_cv_func_working_mktime.
+       * m4/multiarch.m4 (gl_MULTIARCH): Show a line "checking whether the
+       compiler produces multi-arch binaries..." in the configure output.
+       * m4/size_max.m4 (gl_SIZE_MAX): When not found, say "no".
+       * m4/parse-datetime.m4 (gl_C_COMPOUND_LITERALS): Improve indentation.
+
 2020-07-25  Bruno Haible  <bruno@clisp.org>
 
        doc: Update for NetBSD 7.1, 8.0, 9.0.
index c00843f0f4020982bb9ad0d0b4a1f1e051ac8593..8d9b827fe216fe09db69d665481044cc986796c1 100644 (file)
@@ -1,4 +1,4 @@
-# serial 31
+# serial 32
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -33,15 +33,15 @@ AC_DEFUN([gl_FUNC_MKTIME_WORKS],
   AC_CHECK_DECLS_ONCE([alarm])
   AC_CHECK_FUNCS_ONCE([tzset])
   AC_REQUIRE([gl_MULTIARCH])
-  if test $APPLE_UNIVERSAL_BUILD = 1; then
-    # A universal build on Apple Mac OS X platforms.
-    # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
-    # But we need a configuration result that is valid in both modes.
-    gl_cv_func_working_mktime=no
-  fi
   AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
-    [AC_RUN_IFELSE(
-       [AC_LANG_SOURCE(
+    [if test $APPLE_UNIVERSAL_BUILD = 1; then
+       # A universal build on Apple Mac OS X platforms.
+       # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+       # But we need a configuration result that is valid in both modes.
+       gl_cv_func_working_mktime="guessing no"
+     else
+       AC_RUN_IFELSE(
+         [AC_LANG_SOURCE(
 [[/* Test program from Paul Eggert and Tony Leneis.  */
 #include <limits.h>
 #include <stdlib.h>
@@ -242,14 +242,15 @@ main ()
     result |= 64;
   return result;
 }]])],
-       [gl_cv_func_working_mktime=yes],
-       [gl_cv_func_working_mktime=no],
-       [case "$host_os" in
-                  # Guess no on native Windows.
-          mingw*) gl_cv_func_working_mktime="guessing no" ;;
-          *)      gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
-        esac
-       ])
+         [gl_cv_func_working_mktime=yes],
+         [gl_cv_func_working_mktime=no],
+         [case "$host_os" in
+                    # Guess no on native Windows.
+            mingw*) gl_cv_func_working_mktime="guessing no" ;;
+            *)      gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
+          esac
+         ])
+     fi
     ])
 ])
 
index 3c2034c5e00d74fce2bcdaab18a530d94b679deb..69b43df3aa19dd508847edbb0226b439b2a8d161 100644 (file)
@@ -1,4 +1,4 @@
-# multiarch.m4 serial 7
+# multiarch.m4 serial 8
 dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,37 +21,40 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN_ONCE([gl_MULTIARCH],
 [
   dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
-  gl_cv_c_multiarch=no
-  AC_COMPILE_IFELSE(
-    [AC_LANG_SOURCE(
-      [[#ifndef __APPLE_CC__
-         not a universal capable compiler
-        #endif
-        typedef int dummy;
-      ]])],
-    [
-     dnl Check for potential -arch flags.  It is not universal unless
-     dnl there are at least two -arch flags with different values.
-     arch=
-     prev=
-     for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
-       if test -n "$prev"; then
-         case $word in
-           i?86 | x86_64 | ppc | ppc64)
-             if test -z "$arch" || test "$arch" = "$word"; then
-               arch="$word"
-             else
-               gl_cv_c_multiarch=yes
-             fi
-             ;;
-         esac
-         prev=
-       else
-         if test "x$word" = "x-arch"; then
-           prev=arch
-         fi
-       fi
-     done
+  AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
+    [gl_cv_c_multiarch],
+    [gl_cv_c_multiarch=no
+     AC_COMPILE_IFELSE(
+       [AC_LANG_SOURCE(
+         [[#ifndef __APPLE_CC__
+            not a universal capable compiler
+           #endif
+           typedef int dummy;
+         ]])],
+       [
+        dnl Check for potential -arch flags.  It is not universal unless
+        dnl there are at least two -arch flags with different values.
+        arch=
+        prev=
+        for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+          if test -n "$prev"; then
+            case $word in
+              i?86 | x86_64 | ppc | ppc64)
+                if test -z "$arch" || test "$arch" = "$word"; then
+                  arch="$word"
+                else
+                  gl_cv_c_multiarch=yes
+                fi
+                ;;
+            esac
+            prev=
+          else
+            if test "x$word" = "x-arch"; then
+              prev=arch
+            fi
+          fi
+        done
+       ])
     ])
   if test $gl_cv_c_multiarch = yes; then
     APPLE_UNIVERSAL_BUILD=1
index 3bb487f9be5b15aed2a31e940cb28fe1b949609d..d9fc06684c50160fa447c3e92aff2d2cea4f785e 100644 (file)
@@ -1,4 +1,4 @@
-# parse-datetime.m4 serial 25
+# parse-datetime.m4 serial 26
 dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,11 +13,15 @@ dnl static variables (even though gcc supports this in pre-C99 mode).
 AC_DEFUN([gl_C_COMPOUND_LITERALS],
 [
   AC_CACHE_CHECK([for compound literals], [gl_cv_compound_literals],
-  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct s { int i, j; };]],
-      [[struct s t = (struct s) { 3, 4 };
-        if (t.i != 0) return 0;]])],
-    gl_cv_compound_literals=yes,
-    gl_cv_compound_literals=no)])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[struct s { int i, j; };]],
+          [[struct s t = (struct s) { 3, 4 };
+            if (t.i != 0) return 0;]])
+       ],
+       [gl_cv_compound_literals=yes],
+       [gl_cv_compound_literals=no])
+    ])
   if test $gl_cv_compound_literals = yes; then
     AC_DEFINE([HAVE_COMPOUND_LITERALS], [1],
       [Define if you have compound literals.])
index 5240d799c0d0bca942c9adbbff1a45513f561a98..6ebb93f210f37ca250923c4c296cf3f0ffefdc9f 100644 (file)
@@ -1,4 +1,4 @@
-# size_max.m4 serial 11
+# size_max.m4 serial 12
 dnl Copyright (C) 2003, 2005-2006, 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_SIZE_MAX],
   AC_CHECK_HEADERS([stdint.h])
   dnl First test whether the system already has SIZE_MAX.
   AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
-    gl_cv_size_max=
+    gl_cv_size_max=no
     AC_EGREP_CPP([Found it], [
 #include <limits.h>
 #if HAVE_STDINT_H
@@ -23,7 +23,7 @@ AC_DEFUN([gl_SIZE_MAX],
 Found it
 #endif
 ], [gl_cv_size_max=yes])
-    if test -z "$gl_cv_size_max"; then
+    if test $gl_cv_size_max != yes; then
       dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
       dnl than the type 'unsigned long'. Try hard to find a definition that can
       dnl be used in a preprocessor #if, i.e. doesn't contain a cast.