summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-07-26 01:45:32 +0200
committerBruno Haible <bruno@clisp.org>2020-07-26 01:49:25 +0200
commit6f8fd6411e022200c743d8e500fcc0bae91f1d76 (patch)
tree7afbf1128133b4d3425640c9b6db3062e9df374d /m4
parente6c7f8be2fe11e72c3fff2503be9ab3f798b787a (diff)
downloadgnulib-6f8fd6411e022200c743d8e500fcc0bae91f1d76.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/mktime.m435
-rw-r--r--m4/multiarch.m467
-rw-r--r--m4/parse-datetime.m416
-rw-r--r--m4/size_max.m46
4 files changed, 66 insertions, 58 deletions
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index c00843f0f4..8d9b827fe2 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -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
])
])
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 3c2034c5e0..69b43df3aa 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -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
diff --git a/m4/parse-datetime.m4 b/m4/parse-datetime.m4
index 3bb487f9be..d9fc06684c 100644
--- a/m4/parse-datetime.m4
+++ b/m4/parse-datetime.m4
@@ -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.])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index 5240d799c0..6ebb93f210 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -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.