1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Update Gnulib to v0.1-4379-g2ef5a9b4b

Also bump required autoconf version to 2.64, as required by Gnulib.
This commit is contained in:
Andy Wingo 2021-01-20 21:52:54 +01:00
parent 758b31994c
commit a91b95cca2
483 changed files with 26665 additions and 10031 deletions

View file

@ -1,43 +1,82 @@
# 00gnulib.m4 serial 3
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
# 00gnulib.m4 serial 8
dnl Copyright (C) 2009-2021 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.
dnl This file must be named something that sorts before all other
dnl gnulib-provided .m4 files. It is needed until such time as we can
dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
dnl m4_divert semantics.
dnl gnulib-provided .m4 files. It is needed until the clang fix has
dnl been included in Autoconf.
# Until autoconf 2.63, handling of the diversion stack required m4_init
# to be called first; but this does not happen with aclocal. Wrapping
# the entire execution in another layer of the diversion stack fixes this.
# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
# for whether it was FIFO or LIFO; in order to properly balance with
# m4_init, we need to undo our push just before anything wrapped within
# the m4_init body. The way to ensure this is to wrap both sides of
# m4_init with a one-shot macro that does the pop at the right time.
m4_ifndef([_m4_divert_diversion],
[m4_divert_push([KILL])
m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
m4_define([m4_init],
[gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
# AC_DEFUN_ONCE([NAME], VALUE)
# ----------------------------
# Define NAME to expand to VALUE on the first use (whether by direct
# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This
# definition is slower than the version in Autoconf 2.64, because it
# can only use interfaces that existed since 2.59; but it achieves the
# same effect. Quoting is necessary to avoid confusing Automake.
m4_version_prereq([2.63.263], [],
[m4_define([AC][_DEFUN_ONCE],
[AC][_DEFUN([$1],
[AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
[m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
# The following definitions arrange to use a compiler option
# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
# compiler is clang. Without it, clang implicitly declares "known"
# library functions in C mode, but not in C++ mode, which would cause
# Gnulib to omit a declaration and thus later produce an error in C++
# mode. As of clang 9.0, these "known" functions are identified through
# LIBBUILTIN invocations in the LLVM source file
# llvm/tools/clang/include/clang/Basic/Builtins.def.
# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
# to AC_REQUIRE anything: some configure.ac files have their first
# AC_CHECK_DECL executed conditionally. Therefore append the extra tests
# to AC_PROG_CC.
AC_DEFUN([gl_COMPILER_CLANG],
[
dnl AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([whether the compiler is clang],
[gl_cv_compiler_clang],
[dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
dnl not yet been invoked.
_AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#ifdef __clang__
barfbarf
#endif
]],[[]])
],
[gl_cv_compiler_clang=no],
[gl_cv_compiler_clang=yes])
])
])
AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
[
dnl AC_REQUIRE([AC_PROG_CC])
dnl AC_REQUIRE([gl_COMPILER_CLANG])
AC_CACHE_CHECK([for compiler option needed when checking for declarations],
[gl_cv_compiler_check_decl_option],
[if test $gl_cv_compiler_clang = yes; then
dnl Test whether the compiler supports the option
dnl '-Werror=implicit-function-declaration'.
save_ac_compile="$ac_compile"
ac_compile="$ac_compile -Werror=implicit-function-declaration"
dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
[gl_cv_compiler_check_decl_option=none])
ac_compile="$save_ac_compile"
else
gl_cv_compiler_check_decl_option=none
fi
])
if test "x$gl_cv_compiler_check_decl_option" != xnone; then
ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
else
ac_compile_for_check_decl="$ac_compile"
fi
])
dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
dnl in zzgnulib.m4 is inactive, use the original ac_compile.
m4_define([_AC_CHECK_DECL_BODY],
[ ac_save_ac_compile="$ac_compile"
if test -n "$ac_compile_for_check_decl"; then
ac_compile="$ac_compile_for_check_decl"
fi]
m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
])
# gl_00GNULIB
# -----------

22
m4/__inline.m4 Normal file
View file

@ -0,0 +1,22 @@
# Test for __inline keyword
dnl Copyright 2017-2021 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.
AC_DEFUN([gl___INLINE],
[
AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
[gl_cv_c___inline],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[typedef int foo_t;
static __inline foo_t foo (void) { return 0; }]],
[[return foo ();]])],
[gl_cv_c___inline=yes],
[gl_cv_c___inline=no])])
if test $gl_cv_c___inline = yes; then
AC_DEFINE([HAVE___INLINE], [1],
[Define to 1 if the compiler supports the keyword '__inline'.])
fi
])

View file

@ -1,5 +1,5 @@
# absolute-header.m4 serial 16
dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
# absolute-header.m4 serial 17
dnl Copyright (C) 2006-2021 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.
@ -22,23 +22,21 @@ dnl From Derek Price.
AC_DEFUN([gl_ABSOLUTE_HEADER],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PREPROC_REQUIRE()dnl
dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
dnl until we can assume autoconf 2.64 or newer.
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_absolute_header],
[gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
m4_defn([gl_absolute_header]),
[gl_absolute_header],
[AS_VAR_PUSHDEF([ac_header_exists],
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
if test AS_VAR_GET(ac_header_exists) = yes; then
if test AS_VAR_GET([ac_header_exists]) = yes; then
gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
fi
AS_VAR_POPDEF([ac_header_exists])dnl
])dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
["AS_VAR_GET(gl_absolute_header)"],
["AS_VAR_GET([gl_absolute_header])"],
[Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
AS_VAR_POPDEF([gl_absolute_header])dnl
])dnl

View file

@ -1,5 +1,5 @@
# accept4.m4 serial 2
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
# accept4.m4 serial 3
dnl Copyright (C) 2009-2021 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.
@ -11,8 +11,11 @@ AC_DEFUN([gl_FUNC_ACCEPT4],
dnl Persuade glibc <sys/socket.h> to declare accept4().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([accept4])
if test $ac_cv_func_accept4 != yes; then
AC_CHECK_DECLS([accept4], , , [[
#include <sys/types.h>
#include <sys/socket.h>
]])
if test $ac_cv_have_decl_accept4 != yes; then
HAVE_ACCEPT4=0
fi
])

View file

@ -1,5 +1,5 @@
# alloca.m4 serial 14
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 Free Software Foundation,
# alloca.m4 serial 20
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -37,19 +37,26 @@ AC_DEFUN([gl_FUNC_ALLOCA],
fi
AC_SUBST([ALLOCA_H])
AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
if test $ac_cv_working_alloca_h = yes; then
HAVE_ALLOCA_H=1
else
HAVE_ALLOCA_H=0
fi
AC_SUBST([HAVE_ALLOCA_H])
])
# Prerequisites of lib/alloca.c.
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
# This works around a bug in autoconf <= 2.68.
# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
m4_version_prereq([2.70], [], [
m4_version_prereq([2.69], [] ,[
# This is taken from the following Autoconf patch:
# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
# This works around a bug in autoconf <= 2.68 and has simplifications
# from 2.70. See:
# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
# _AC_LIBOBJ_ALLOCA
# -----------------
@ -65,26 +72,6 @@ AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
[AC_EGREP_CPP(webecray,
[#if defined CRAY && ! defined CRAY2
webecray
#else
wenotbecray
#endif
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
AC_CHECK_FUNC($ac_func,
[AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
[Define to one of '_getb67', 'GETB67',
'getb67' for Cray-2 and Cray-YMP
systems. This function is required for
'alloca.c' support on those systems.])
break])
done
fi
AC_CACHE_CHECK([stack direction for C alloca],
[ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
@ -115,7 +102,7 @@ AH_VERBATIM([STACK_DIRECTION],
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
@%:@undef STACK_DIRECTION])dnl
#undef STACK_DIRECTION])dnl
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])# _AC_LIBOBJ_ALLOCA
])

View file

@ -1,5 +1,5 @@
# arpa_inet_h.m4 serial 13
dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
# arpa_inet_h.m4 serial 14
dnl Copyright (C) 2006, 2008-2021 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.
@ -24,6 +24,8 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
AC_REQUIRE([gl_FEATURES_H])
gl_PREREQ_SYS_H_WS2TCPIP
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[

View file

@ -1,5 +1,5 @@
# autobuild.m4 serial 7
dnl Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc.
# autobuild.m4 serial 8
dnl Copyright (C) 2004, 2006-2021 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.
@ -27,7 +27,7 @@ AC_DEFUN([AB_INIT],
AC_MSG_NOTICE([autobuild hostname... $hostname])
fi
ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
m4_if([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
if test "$?" != 0; then

View file

@ -1,5 +1,5 @@
# btowc.m4 serial 10
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
# btowc.m4 serial 12
dnl Copyright (C) 2008-2021 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.
@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_BTOWC],
dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
dnl program below may lead to an endless loop. See
dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
AC_CHECK_FUNCS_ONCE([btowc])
@ -28,14 +28,6 @@ AC_DEFUN([gl_FUNC_BTOWC],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -50,6 +42,8 @@ changequote(,)dnl
case "$host_os" in
# Guess no on Cygwin.
cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
# Guess yes otherwise.
*) gl_cv_func_btowc_nul="guessing yes" ;;
esac
@ -65,24 +59,19 @@ changequote([,])dnl
dnl is present.
changequote(,)dnl
case "$host_os" in
# Guess no on IRIX.
irix*) gl_cv_func_btowc_eof="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_btowc_eof="guessing yes" ;;
# Guess no on IRIX.
irix*) gl_cv_func_btowc_eof="guessing no" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
# Guess yes otherwise.
*) gl_cv_func_btowc_eof="guessing yes" ;;
esac
changequote([,])dnl
if test $LOCALE_FR != none; then
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{

View file

@ -1,6 +1,6 @@
dnl Check for __builtin_expect.
dnl Copyright 2016-2017 Free Software Foundation, Inc.
dnl Copyright 2016-2021 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.

View file

@ -1,5 +1,5 @@
# byteswap.m4 serial 4
dnl Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2005, 2007, 2009-2021 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.

View file

@ -1,6 +1,6 @@
# canonicalize.m4 serial 28
# canonicalize.m4 serial 36
dnl Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -11,7 +11,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
if test $ac_cv_func_canonicalize_file_name = no; then
@ -35,8 +36,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
HAVE_REALPATH=0
else
case "$gl_cv_func_realpath_works" in
*yes) ;;
*) REPLACE_REALPATH=1 ;;
*yes) ;;
*) REPLACE_REALPATH=1 ;;
esac
fi
else
@ -56,7 +57,17 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([canonicalize_file_name getcwd readlink])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
dnl available through the linker option '-loldnames'.
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
mingw*) ;;
*) AC_CHECK_FUNCS([getcwd]) ;;
esac
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
AC_CHECK_HEADERS_ONCE([sys/param.h])
@ -70,6 +81,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
AC_CHECK_FUNCS_ONCE([realpath])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
rm -rf conftest.a conftest.d
touch conftest.a
mkdir conftest.d
AC_RUN_IFELSE([
@ -79,6 +91,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
#include <string.h>
]], [[
int result = 0;
/* This test fails on Solaris 10. */
{
char *name = realpath ("conftest.a", NULL);
if (!(name && *name == '/'))
@ -91,12 +104,14 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
result |= 2;
free (name);
}
/* This test fails on Mac OS X 10.13, OpenBSD 6.0. */
{
char *name = realpath ("conftest.a/", NULL);
if (name != NULL)
result |= 4;
free (name);
}
/* This test fails on AIX 7, Solaris 10. */
{
char *name1 = realpath (".", NULL);
char *name2 = realpath ("conftest.d//./..", NULL);
@ -105,25 +120,47 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
free (name1);
free (name2);
}
#ifdef __linux__
/* On Linux, // is the same as /. See also double-slash-root.m4.
realpath() should respect this.
This test fails on musl libc 1.2.2. */
{
char *name = realpath ("//", NULL);
if (! name || strcmp (name, "/"))
result |= 16;
free (name);
}
#endif
return result;
]])
],
[gl_cv_func_realpath_works=yes],
[gl_cv_func_realpath_works=no],
[case $? in
16) gl_cv_func_realpath_works=nearly ;;
*) gl_cv_func_realpath_works=no ;;
esac
],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_realpath_works="guessing no" ;;
# Guess 'nearly' on musl systems.
*-musl*) gl_cv_func_realpath_works="guessing nearly" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_realpath_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.a conftest.d
])
case "$gl_cv_func_realpath_works" in
*yes)
AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
can malloc memory, always gives an absolute path, and handles
trailing slash correctly.])
AC_DEFINE([FUNC_REALPATH_WORKS], [1],
[Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles leading slashes and a trailing slash correctly.])
;;
*nearly)
AC_DEFINE([FUNC_REALPATH_NEARLY_WORKS], [1],
[Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles a trailing slash correctly.])
;;
esac
])

View file

@ -1,5 +1,5 @@
# ceil.m4 serial 9
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
# ceil.m4 serial 15
dnl Copyright (C) 2007, 2009-2021 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.
@ -32,7 +32,7 @@ AC_DEFUN([gl_FUNC_CEIL],
static double dummy (double f) { return 0; }
int main (int argc, char *argv[])
{
double (*my_ceil) (double) = argc ? ceil : dummy;
double (* volatile my_ceil) (double) = argc ? ceil : dummy;
int result = 0;
/* Test whether ceil (-0.0) is -0.0. */
if (signbitd (minus_zerod) && !signbitd (my_ceil (minus_zerod)))
@ -46,10 +46,14 @@ int main (int argc, char *argv[])
[gl_cv_func_ceil_ieee=yes],
[gl_cv_func_ceil_ieee=no],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_ceil_ieee="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_ceil_ieee="guessing no" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_ceil_ieee="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_ceil_ieee="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_ceil_ieee="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_ceil_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
@ -79,8 +83,9 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
double (*funcptr) (double) = ceil;
double x;]],
[[x = ceil(x);]])],
[[x = funcptr(x) + ceil(x);]])],
[gl_cv_func_ceil_libm=])
if test "$gl_cv_func_ceil_libm" = "?"; then
save_LIBS="$LIBS"
@ -91,8 +96,9 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
double (*funcptr) (double) = ceil;
double x;]],
[[x = ceil(x);]])],
[[x = funcptr(x) + ceil(x);]])],
[gl_cv_func_ceil_libm="-lm"])
LIBS="$save_LIBS"
fi

View file

@ -1,5 +1,5 @@
# check-math-lib.m4 serial 4
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2007, 2009-2021 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.

View file

@ -1,5 +1,5 @@
# clock_time.m4 serial 10
dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2002-2006, 2009-2021 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.

View file

@ -1,5 +1,5 @@
# close.m4 serial 8
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
# close.m4 serial 9
dnl Copyright (C) 2008-2021 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,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_CLOSE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([gl_MSVC_INVAL])
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
REPLACE_CLOSE=1
fi
m4_ifdef([gl_MSVC_INVAL], [
AC_REQUIRE([gl_MSVC_INVAL])
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
REPLACE_CLOSE=1
fi
])
m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
gl_PREREQ_SYS_H_WINSOCK2
if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then

View file

@ -1,6 +1,6 @@
# codeset.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016 Free Software Foundation,
dnl Inc.
dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2021 Free Software
dnl 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.

View file

@ -1,55 +0,0 @@
# configmake.m4 serial 2
dnl Copyright (C) 2010-2017 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.
# gl_CONFIGMAKE_PREP
# ------------------
# Guarantee all of the standard directory variables, even when used with
# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
# and runstatedir in 1.14.1).
AC_DEFUN([gl_CONFIGMAKE_PREP],
[
dnl Technically, datadir should default to datarootdir. But if
dnl autoconf is too old to provide datarootdir, then reversing the
dnl definition is a reasonable compromise. Only AC_SUBST a variable
dnl if it was not already defined earlier by autoconf.
if test "x$datarootdir" = x; then
AC_SUBST([datarootdir], ['${datadir}'])
fi
dnl Copy the approach used in autoconf 2.60.
if test "x$docdir" = x; then
AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
fi
dnl The remaining variables missing from autoconf 2.59 are easier.
if test "x$htmldir" = x; then
AC_SUBST([htmldir], ['${docdir}'])
fi
if test "x$dvidir" = x; then
AC_SUBST([dvidir], ['${docdir}'])
fi
if test "x$pdfdir" = x; then
AC_SUBST([pdfdir], ['${docdir}'])
fi
if test "x$psdir" = x; then
AC_SUBST([psdir], ['${docdir}'])
fi
if test "x$lispdir" = x; then
AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
fi
if test "x$localedir" = x; then
AC_SUBST([localedir], ['${datarootdir}/locale'])
fi
dnl Added in autoconf 2.70
if test "x$runstatedir" = x; then
AC_SUBST([runstatedir], ['${localstatedir}/run'])
fi
dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
])

View file

@ -1,5 +1,5 @@
# copysign.m4 serial 1
dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2011-2021 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.

View file

@ -1,5 +1,5 @@
# dirent_h.m4 serial 16
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2008-2021 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.

View file

@ -1,8 +1,8 @@
# serial 24 -*- Autoconf -*-
# serial 26 -*- Autoconf -*-
dnl Find out how to get the file descriptor associated with an open DIR*.
# Copyright (C) 2001-2006, 2008-2017 Free Software Foundation, Inc.
# Copyright (C) 2001-2006, 2008-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -12,6 +12,7 @@ dnl From Jim Meyering
AC_DEFUN([gl_FUNC_DIRFD],
[
AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Persuade glibc <dirent.h> to declare dirfd().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@ -25,15 +26,15 @@ AC_DEFUN([gl_FUNC_DIRFD],
fi
AC_CACHE_CHECK([whether dirfd is a macro],
gl_cv_func_dirfd_macro,
[gl_cv_func_dirfd_macro],
[AC_EGREP_CPP([dirent_header_defines_dirfd], [
#include <sys/types.h>
#include <dirent.h>
#ifdef dirfd
dirent_header_defines_dirfd
#endif],
gl_cv_func_dirfd_macro=yes,
gl_cv_func_dirfd_macro=no)])
[gl_cv_func_dirfd_macro=yes],
[gl_cv_func_dirfd_macro=no])])
# Use the replacement if we have no function or macro with that name,
# or if OS/2 kLIBC whose dirfd() does not work.

View file

@ -1,19 +0,0 @@
#serial 10 -*- autoconf -*-
dnl Copyright (C) 2002-2006, 2009-2017 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.
AC_DEFUN([gl_DIRNAME],
[
AC_REQUIRE([gl_DIRNAME_LGPL])
])
AC_DEFUN([gl_DIRNAME_LGPL],
[
dnl Prerequisites of lib/dirname.h.
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
dnl lib/stripslash.c.
])

View file

@ -1,5 +1,5 @@
# double-slash-root.m4 serial 4 -*- Autoconf -*-
dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2006, 2008-2021 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.

View file

@ -1,5 +1,5 @@
#serial 25
dnl Copyright (C) 2002, 2005, 2007, 2009-2017 Free Software Foundation, Inc.
#serial 27
dnl Copyright (C) 2002, 2005, 2007, 2009-2021 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.
@ -8,107 +8,95 @@ AC_DEFUN([gl_FUNC_DUP2],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
AC_CHECK_FUNCS_ONCE([dup2])
if test $ac_cv_func_dup2 = no; then
HAVE_DUP2=0
fi
], [
AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
])
if test $HAVE_DUP2 = 1; then
AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/resource.h>
#include <unistd.h>
#ifndef RLIM_SAVED_CUR
# define RLIM_SAVED_CUR RLIM_INFINITY
#endif
#ifndef RLIM_SAVED_MAX
# define RLIM_SAVED_MAX RLIM_INFINITY
#endif
]],
[[int result = 0;
int bad_fd = INT_MAX;
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
&& 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
&& rlim.rlim_cur != RLIM_INFINITY
&& rlim.rlim_cur != RLIM_SAVED_MAX
&& rlim.rlim_cur != RLIM_SAVED_CUR)
bad_fd = rlim.rlim_cur;
#ifdef FD_CLOEXEC
if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
result |= 1;
#endif
if (dup2 (1, 1) != 1)
result |= 2;
#ifdef FD_CLOEXEC
if (fcntl (1, F_GETFD) != FD_CLOEXEC)
result |= 4;
#endif
close (0);
if (dup2 (0, 0) != -1)
result |= 8;
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (2, bad_fd) == -1 && errno != EBADF)
result |= 16;
/* Flush out some cygwin core dumps. */
if (dup2 (2, -1) != -1 || errno != EBADF)
result |= 32;
dup2 (2, 255);
dup2 (2, 256);
/* On OS/2 kLIBC, dup2() does not work on a directory fd. */
{
int fd = open (".", O_RDONLY);
if (fd == -1)
result |= 64;
else if (dup2 (fd, fd + 1) == -1)
result |= 128;
close (fd);
}
return result;]])
],
[gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
[case "$host_os" in
mingw*) # on this platform, dup2 always returns 0 for success
gl_cv_func_dup2_works="guessing no" ;;
cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
gl_cv_func_dup2_works="guessing no" ;;
aix* | freebsd*)
# on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
# not EBADF.
gl_cv_func_dup2_works="guessing no" ;;
haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
gl_cv_func_dup2_works="guessing no" ;;
*-android*) # implemented using dup3(), which fails if oldfd == newfd
gl_cv_func_dup2_works="guessing no" ;;
os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
gl_cv_func_dup2_works="guessing no" ;;
*) gl_cv_func_dup2_works="guessing yes" ;;
esac])
])
case "$gl_cv_func_dup2_works" in
*yes) ;;
*)
REPLACE_DUP2=1
AC_CHECK_FUNCS([setdtablesize])
;;
esac
fi
AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/resource.h>
#include <unistd.h>
]GL_MDA_DEFINES[
#ifndef RLIM_SAVED_CUR
# define RLIM_SAVED_CUR RLIM_INFINITY
#endif
#ifndef RLIM_SAVED_MAX
# define RLIM_SAVED_MAX RLIM_INFINITY
#endif
]],
[[int result = 0;
int bad_fd = INT_MAX;
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
&& 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
&& rlim.rlim_cur != RLIM_INFINITY
&& rlim.rlim_cur != RLIM_SAVED_MAX
&& rlim.rlim_cur != RLIM_SAVED_CUR)
bad_fd = rlim.rlim_cur;
#ifdef FD_CLOEXEC
if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
result |= 1;
#endif
if (dup2 (1, 1) != 1)
result |= 2;
#ifdef FD_CLOEXEC
if (fcntl (1, F_GETFD) != FD_CLOEXEC)
result |= 4;
#endif
close (0);
if (dup2 (0, 0) != -1)
result |= 8;
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (2, bad_fd) == -1 && errno != EBADF)
result |= 16;
/* Flush out some cygwin core dumps. */
if (dup2 (2, -1) != -1 || errno != EBADF)
result |= 32;
dup2 (2, 255);
dup2 (2, 256);
/* On OS/2 kLIBC, dup2() does not work on a directory fd. */
{
int fd = open (".", O_RDONLY);
if (fd == -1)
result |= 64;
else if (dup2 (fd, fd + 1) == -1)
result |= 128;
close (fd);
}
return result;]])
],
[gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
[case "$host_os" in
mingw*) # on this platform, dup2 always returns 0 for success
gl_cv_func_dup2_works="guessing no" ;;
cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
gl_cv_func_dup2_works="guessing no" ;;
aix* | freebsd*)
# on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
# not EBADF.
gl_cv_func_dup2_works="guessing no" ;;
haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
gl_cv_func_dup2_works="guessing no" ;;
*-android*) # implemented using dup3(), which fails if oldfd == newfd
gl_cv_func_dup2_works="guessing no" ;;
os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
gl_cv_func_dup2_works="guessing no" ;;
*) gl_cv_func_dup2_works="guessing yes" ;;
esac])
])
case "$gl_cv_func_dup2_works" in
*yes) ;;
*)
REPLACE_DUP2=1
AC_CHECK_FUNCS([setdtablesize])
;;
esac
dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
dnl to keep fchdir's bookkeeping up-to-date.
m4_ifdef([gl_FUNC_FCHDIR], [
gl_TEST_FCHDIR
if test $HAVE_FCHDIR = 0; then
if test $HAVE_DUP2 = 1; then
REPLACE_DUP2=1
fi
REPLACE_DUP2=1
fi
])
])

View file

@ -1,5 +1,5 @@
# duplocale.m4 serial 8
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
# duplocale.m4 serial 12
dnl Copyright (C) 2009-2021 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.
@ -8,36 +8,79 @@ AC_DEFUN([gl_FUNC_DUPLOCALE],
[
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
AC_CHECK_FUNCS_ONCE([duplocale])
if test $ac_cv_func_duplocale = yes; then
dnl Check against glibc bug where duplocale crashes.
dnl See <http://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
dnl Also, on AIX 7.1, duplocale(LC_GLOBAL_LOCALE) returns (locale_t)0 with
dnl errno set to EINVAL.
dnl Also, on NetBSD 7.0, duplocale(LC_GLOBAL_LOCALE) returns a locale that
dnl corresponds to the C locale.
AC_REQUIRE([gl_LOCALE_H])
AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works],
[gl_cv_func_duplocale_works],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
if test $HAVE_LOCALE_T = 1; then
AC_CHECK_FUNCS_ONCE([snprintf_l nl_langinfo_l])
AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works],
[gl_cv_func_duplocale_works],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
#if HAVE_XLOCALE_H
# include <xlocale.h>
#endif
#if HAVE_SNPRINTF_L
# include <stdio.h>
#endif
#if HAVE_NL_LANGINFO_L
# include <langinfo.h>
#endif
#include <string.h>
struct locale_dependent_values
{
char numeric[100];
char time[100];
};
int main ()
{
locale_t loc = duplocale (LC_GLOBAL_LOCALE);
struct locale_dependent_values expected_result;
struct locale_dependent_values result;
locale_t loc;
setlocale (LC_ALL, "en_US.UTF-8");
setlocale (LC_NUMERIC, "de_DE.UTF-8");
setlocale (LC_TIME, "fr_FR.UTF-8");
#if HAVE_SNPRINTF_L
snprintf (expected_result.numeric, sizeof (expected_result.numeric), "%g", 3.5);
#endif
#if HAVE_NL_LANGINFO_L
strcpy (expected_result.time, nl_langinfo (MON_1));
#endif
loc = duplocale (LC_GLOBAL_LOCALE);
if (!loc)
return 1;
#if HAVE_SNPRINTF_L
snprintf_l (result.numeric, sizeof (result.numeric), loc, "%g", 3.5);
#endif
#if HAVE_NL_LANGINFO_L
strcpy (result.time, nl_langinfo_l (MON_1, loc));
#endif
#if HAVE_SNPRINTF_L
if (strcmp (result.numeric, expected_result.numeric) != 0)
return 2;
#endif
#if HAVE_NL_LANGINFO_L
if (strcmp (result.time, expected_result.time) != 0)
return 3;
#endif
freelocale (loc);
return 0;
}]])],
[gl_cv_func_duplocale_works=yes],
[gl_cv_func_duplocale_works=no],
[dnl Guess it works except on glibc < 2.12, uClibc, and AIX.
case "$host_os" in
aix*) gl_cv_func_duplocale_works="guessing no";;
*-gnu*)
AC_EGREP_CPP([Unlucky], [
[gl_cv_func_duplocale_works=yes],
[gl_cv_func_duplocale_works=no],
[dnl Guess it works except on glibc < 2.12, uClibc, AIX, and NetBSD.
case "$host_os" in
aix* | netbsd*) gl_cv_func_duplocale_works="guessing no";;
*-gnu* | gnu*)
AC_EGREP_CPP([Unlucky], [
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)
@ -47,20 +90,34 @@ int main ()
#ifdef __UCLIBC__
Unlucky user
#endif
],
[gl_cv_func_duplocale_works="guessing no"],
[gl_cv_func_duplocale_works="guessing yes"])
;;
*) gl_cv_func_duplocale_works="guessing yes";;
esac
])
])
case "$gl_cv_func_duplocale_works" in
*no) REPLACE_DUPLOCALE=1 ;;
esac
],
[gl_cv_func_duplocale_works="guessing no"],
[gl_cv_func_duplocale_works="guessing yes"])
;;
*) gl_cv_func_duplocale_works="guessing yes";;
esac
])
])
case "$gl_cv_func_duplocale_works" in
*no) REPLACE_DUPLOCALE=1 ;;
esac
else
dnl In 2019, some versions of z/OS lack the locale_t type and have broken
dnl newlocale, duplocale, freelocale functions. In this situation, we
dnl cannot use nor override duplocale.
HAVE_DUPLOCALE=0
fi
else
HAVE_DUPLOCALE=0
fi
if test $REPLACE_DUPLOCALE = 1; then
LIB_DUPLOCALE="$LIB_SETLOCALE_NULL"
else
LIB_DUPLOCALE=
fi
dnl LIB_DUPLOCALE is expected to be '-pthread' or '-lpthread' on AIX
dnl with gcc or xlc, and empty otherwise.
AC_SUBST([LIB_DUPLOCALE])
])
# Prerequisites of lib/duplocale.c.

View file

@ -1,5 +1,5 @@
# eealloc.m4 serial 3
dnl Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2003, 2009-2021 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.

View file

@ -1,5 +1,5 @@
# environ.m4 serial 6
dnl Copyright (C) 2001-2004, 2006-2017 Free Software Foundation, Inc.
# environ.m4 serial 7
dnl Copyright (C) 2001-2004, 2006-2021 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.
@ -29,16 +29,14 @@ AC_DEFUN_ONCE([gl_ENVIRON],
AC_DEFUN([gt_CHECK_VAR_DECL],
[
define([gt_cv_var], [gt_cv_var_]$2[_declaration])
AC_MSG_CHECKING([if $2 is properly declared])
AC_CACHE_VAL([gt_cv_var], [
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[$1
extern struct { int foo; } $2;]],
[[$2.foo = 1;]])],
[gt_cv_var=no],
[gt_cv_var=yes])])
AC_MSG_RESULT([$gt_cv_var])
AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[$1
extern struct { int foo; } $2;]],
[[$2.foo = 1;]])],
[gt_cv_var=no],
[gt_cv_var=yes])])
if test $gt_cv_var = yes; then
AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
[Define if you have the declaration of $2.])

View file

@ -1,9 +1,11 @@
# errno_h.m4 serial 12
dnl Copyright (C) 2004, 2006, 2008-2017 Free Software Foundation, Inc.
# errno_h.m4 serial 13
dnl Copyright (C) 2004, 2006, 2008-2021 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.
AC_PREREQ([2.61])
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[
AC_REQUIRE([AC_PROG_CC])
@ -129,9 +131,3 @@ yes
AC_SUBST($1[_VALUE])
fi
])
dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
dnl Remove this when we can assume autoconf >= 2.61.
m4_ifdef([AC_COMPUTE_INT], [], [
AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
])

View file

@ -1,5 +1,5 @@
# exponentd.m4 serial 3
dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2007-2008, 2010-2021 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.

View file

@ -1,5 +1,5 @@
# exponentf.m4 serial 2
dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2007-2008, 2010-2021 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.

View file

@ -1,11 +1,12 @@
# exponentl.m4 serial 3
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# exponentl.m4 serial 5
dnl Copyright (C) 2007-2021 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.
AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
[
AC_REQUIRE([gl_BIGENDIAN])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([where to find the exponent in a 'long double'],
[gl_cv_cc_long_double_expbit0],
[
@ -21,14 +22,14 @@ typedef union { long double value; unsigned int word[NWORDS]; }
memory_long_double;
static unsigned int ored_words[NWORDS];
static unsigned int anded_words[NWORDS];
static void add_to_ored_words (long double x)
static void add_to_ored_words (long double *x)
{
memory_long_double m;
size_t i;
/* Clear it first, in case
sizeof (long double) < sizeof (memory_long_double). */
memset (&m, 0, sizeof (memory_long_double));
m.value = x;
m.value = *x;
for (i = 0; i < NWORDS; i++)
{
ored_words[i] |= m.word[i];
@ -37,17 +38,15 @@ static void add_to_ored_words (long double x)
}
int main ()
{
static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
size_t j;
FILE *fp = fopen ("conftest.out", "w");
if (fp == NULL)
return 1;
for (j = 0; j < NWORDS; j++)
anded_words[j] = ~ (unsigned int) 0;
add_to_ored_words (0.25L);
add_to_ored_words (0.5L);
add_to_ored_words (1.0L);
add_to_ored_words (2.0L);
add_to_ored_words (4.0L);
for (j = 0; j < 5; j++)
add_to_ored_words (&samples[j]);
/* Remove bits that are common (e.g. if representation of the first mantissa
bit is explicit). */
for (j = 0; j < NWORDS; j++)
@ -79,9 +78,24 @@ int main ()
[gl_cv_cc_long_double_expbit0=`cat conftest.out`],
[gl_cv_cc_long_double_expbit0="unknown"],
[
dnl When cross-compiling, we don't know. It depends on the
dnl When cross-compiling, in general we don't know. It depends on the
dnl ABI and compiler version. There are too many cases.
gl_cv_cc_long_double_expbit0="unknown"
case "$host_os" in
mingw*) # On native Windows (little-endian), we know the result
# in two cases: mingw, MSVC.
AC_EGREP_CPP([Known], [
#ifdef __MINGW32__
Known
#endif
], [gl_cv_cc_long_double_expbit0="word 2 bit 0"])
AC_EGREP_CPP([Known], [
#ifdef _MSC_VER
Known
#endif
], [gl_cv_cc_long_double_expbit0="word 1 bit 20"])
;;
esac
])
rm -f conftest.out
])

View file

@ -1,14 +1,19 @@
# serial 15 -*- Autoconf -*-
# serial 22 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc.
# Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
[AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
# Autoconf. Perhaps we can remove this once we can assume Autoconf
# 2.70 or later everywhere, but since Autoconf mutates rapidly
# is recent-enough everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
@ -26,36 +31,27 @@
# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
# invocation occurs in gl_EARLY, not in gl_INIT.
m4_version_prereq([2.70.1], [], [
# AC_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
#
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
# cause problems on some platforms (such as __EXTENSIONS__).
# We unconditionally define as many of the known feature-enabling
# as possible, reserving conditional behavior for macros that are
# known to cause problems on some platforms (such as __EXTENSIONS__).
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
[Define to 1 if you need to in order for 'stat' and other
things to work.])
AC_DEFINE([_POSIX_1_SOURCE], [2],
[Define to 2 if the system does not provide POSIX.1 features
except with this defined.])
AC_DEFINE([_MINIX], [1],
[Define to 1 if on MINIX.])
AC_DEFINE([_NETBSD_SOURCE], [1],
[Define to 1 to make NetBSD features available. MINIX 3 needs this.])
fi
AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
dnl Use a different key than __EXTENSIONS__, as that name broke existing
dnl configure.ac when using autoheader 2.62.
AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
dnl The macros below are in alphabetical order ignoring leading _ or __
dnl prefixes.
AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
@ -64,11 +60,44 @@ dnl configure.ac when using autoheader 2.62.
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
/* Enable X/Open compliant socket functions that do not require linking
with -lxnet on HP-UX 11.11. */
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
# undef _HPUX_ALT_XOPEN_SOCKET_API
#endif
/* Identify the host operating system as Minix.
This macro does not affect the system headers' behavior.
A future release of Autoconf may stop defining this macro. */
#ifndef _MINIX
# undef _MINIX
#endif
/* Enable general extensions on NetBSD.
Enable NetBSD compatibility extensions on Minix. */
#ifndef _NETBSD_SOURCE
# undef _NETBSD_SOURCE
#endif
/* Enable OpenBSD compatibility extensions on NetBSD.
Oddly enough, this does nothing on OpenBSD. */
#ifndef _OPENBSD_SOURCE
# undef _OPENBSD_SOURCE
#endif
/* Define to 1 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_SOURCE
# undef _POSIX_SOURCE
#endif
/* Define to 2 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_1_SOURCE
# undef _POSIX_1_SOURCE
#endif
/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
@ -104,17 +133,19 @@ dnl configure.ac when using autoheader 2.62.
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
whether compiling with -Ae or -D_HPUX_SOURCE=1. */
/* Enable X/Open extensions. Define to 500 only if necessary
to make mbstate_t available. */
#ifndef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
])
])dnl
AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
_AC_CHECK_HEADER_ONCE([wchar.h])
_AC_CHECK_HEADER_ONCE([minix/config.h])
dnl Defining __EXTENSIONS__ may break the system headers on some systems.
dnl (FIXME: Which ones?)
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
@ -123,11 +154,35 @@ dnl configure.ac when using autoheader 2.62.
]AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
test $ac_cv_safe_to_define___extensions__ = yes &&
AC_DEFINE([__EXTENSIONS__])
dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
dnl it should only be defined when necessary.
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
[ac_cv_should_define__xopen_source],
[ac_cv_should_define__xopen_source=no
AS_IF([test $ac_cv_header_wchar_h = yes],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <wchar.h>
mbstate_t x;]])],
[],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#define _XOPEN_SOURCE 500
#include <wchar.h>
mbstate_t x;]])],
[ac_cv_should_define__xopen_source=yes])])])])
AC_DEFINE([_ALL_SOURCE])
AC_DEFINE([_DARWIN_C_SOURCE])
AC_DEFINE([_GNU_SOURCE])
AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
AC_DEFINE([_NETBSD_SOURCE])
AC_DEFINE([_OPENBSD_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
@ -137,23 +192,18 @@ dnl configure.ac when using autoheader 2.62.
AC_DEFINE([__STDC_WANT_LIB_EXT2__])
AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
AC_DEFINE([_TANDEM_SOURCE])
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
[ac_cv_should_define__xopen_source],
[ac_cv_should_define__xopen_source=no
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <wchar.h>
mbstate_t x;]])],
[],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#define _XOPEN_SOURCE 500
#include <wchar.h>
mbstate_t x;]])],
[ac_cv_should_define__xopen_source=yes])])])
test $ac_cv_should_define__xopen_source = yes &&
AC_DEFINE([_XOPEN_SOURCE], [500])
AS_IF([test $ac_cv_header_minix_config_h = yes],
[MINIX=yes
AC_DEFINE([_MINIX])
AC_DEFINE([_POSIX_SOURCE])
AC_DEFINE([_POSIX_1_SOURCE], [2])],
[MINIX=])
AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
[AC_DEFINE([__EXTENSIONS__])])
AS_IF([test $ac_cv_should_define__xopen_source = yes],
[AC_DEFINE([_XOPEN_SOURCE], [500])])
])# AC_USE_SYSTEM_EXTENSIONS
])
# gl_USE_SYSTEM_EXTENSIONS
# ------------------------
@ -161,13 +211,17 @@ dnl configure.ac when using autoheader 2.62.
# typically due to standards-conformance issues.
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
[
dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
dnl gnulib does not need it. But if it gets required by third-party macros
dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
dnl That's because this version of GCC (4.2.1) supports the option
dnl '-std=gnu99' but not the option '-std=gnu11'.
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
openbsd*)
AC_DEFINE([_ISOC11_SOURCE], [1],
[Define to enable the declarations of ISO C 11 types and functions.])
;;
esac
])

View file

@ -1,6 +1,6 @@
dnl 'extern inline' a la ISO C99.
dnl Copyright 2012-2017 Free Software Foundation, Inc.
dnl Copyright 2012-2021 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.
@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
[/* Please see the Gnulib manual for how to use these macros.
Suppress extern inline with HP-UX cc, as it appears to be broken; see
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
<https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
Suppress extern inline with Sun C in standards-conformance mode, as it
mishandles inline functions that call each other. E.g., for 'inline void f
@ -25,20 +25,32 @@ AC_DEFUN([gl_EXTERN_INLINE],
if isdigit is mistakenly implemented via a static inline function,
a program containing an extern inline function that calls isdigit
may not work since the C standard prohibits extern inline functions
from calling static functions. This bug is known to occur on:
from calling static functions (ISO C 99 section 6.7.4.(3).
This bug is known to occur on:
OS X 10.8 and earlier; see:
http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
DragonFly; see
http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
FreeBSD; see:
http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
Assume DragonFly and FreeBSD will be similar. */
for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
Assume DragonFly and FreeBSD will be similar.
GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
inline semantics, unless -fgnu89-inline is used. It defines a macro
__GNUC_STDC_INLINE__ to indicate this situation or a macro
__GNUC_GNU_INLINE__ to indicate the opposite situation.
GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
semantics but warns, unless -fgnu89-inline is used:
warning: C99 inline functions are not supported; using GNU89
warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
*/
#if (((defined __APPLE__ && defined __MACH__) \
|| defined __DragonFly__ || defined __FreeBSD__) \
&& (defined __header_inline \

View file

@ -1,23 +1,22 @@
# fcntl-o.m4 serial 4
dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
# fcntl-o.m4 serial 7
dnl Copyright (C) 2006, 2009-2021 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.
dnl Written by Paul Eggert.
AC_PREREQ([2.60])
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
AC_DEFUN([gl_FCNTL_O_FLAGS],
[
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
dnl AC_GNU_SOURCE.
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
[AC_REQUIRE([AC_GNU_SOURCE])])
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_FUNCS_ONCE([symlink])
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
@ -33,6 +32,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
# defined sleep(n) _sleep ((n) * 1000)
#endif
#include <fcntl.h>
]GL_MDA_DEFINES[
#ifndef O_NOATIME
#define O_NOATIME 0
#endif
@ -116,7 +116,13 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
*) gl_cv_header_working_fcntl_h='no';;
esac],
[gl_cv_header_working_fcntl_h=cross-compiling])])
[case "$host_os" in
# Guess 'no' on native Windows.
mingw*) gl_cv_header_working_fcntl_h='no' ;;
*) gl_cv_header_working_fcntl_h=cross-compiling ;;
esac
])
])
case $gl_cv_header_working_fcntl_h in #(
*O_NOATIME* | no | cross-compiling) ac_val=0;; #(

151
m4/fcntl.m4 Normal file
View file

@ -0,0 +1,151 @@
# fcntl.m4 serial 11
dnl Copyright (C) 2009-2021 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.
# For now, this module ensures that fcntl()
# - supports F_DUPFD correctly
# - supports or emulates F_DUPFD_CLOEXEC
# - supports F_GETFD
# Still to be ported to mingw:
# - F_SETFD
# - F_GETFL, F_SETFL
# - F_GETOWN, F_SETOWN
# - F_GETLK, F_SETLK, F_SETLKW
AC_DEFUN([gl_FUNC_FCNTL],
[
dnl Persuade glibc to expose F_DUPFD_CLOEXEC.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_FUNCS_ONCE([fcntl])
if test $ac_cv_func_fcntl = no; then
gl_REPLACE_FCNTL
else
dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target
dnl haiku alpha 2 F_DUPFD has wrong errno
AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
[gl_cv_func_fcntl_f_dupfd_works],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/resource.h>
#include <unistd.h>
]GL_MDA_DEFINES[
#ifndef RLIM_SAVED_CUR
# define RLIM_SAVED_CUR RLIM_INFINITY
#endif
#ifndef RLIM_SAVED_MAX
# define RLIM_SAVED_MAX RLIM_INFINITY
#endif
]],
[[int result = 0;
int bad_fd = INT_MAX;
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
&& 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
&& rlim.rlim_cur != RLIM_INFINITY
&& rlim.rlim_cur != RLIM_SAVED_MAX
&& rlim.rlim_cur != RLIM_SAVED_CUR)
bad_fd = rlim.rlim_cur;
if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
if (errno != EINVAL) result |= 2;
if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
if (errno != EINVAL) result |= 8;
/* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
{
int fd;
fd = open (".", O_RDONLY);
if (fd == -1)
result |= 16;
else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
result |= 32;
close (fd);
}
return result;]])],
[gl_cv_func_fcntl_f_dupfd_works=yes],
[gl_cv_func_fcntl_f_dupfd_works=no],
[case $host_os in
aix* | cygwin* | haiku*)
gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
*) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
esac])])
case $gl_cv_func_fcntl_f_dupfd_works in
*yes) ;;
*) gl_REPLACE_FCNTL
AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD
behavior does not match POSIX]) ;;
esac
dnl Many systems lack F_DUPFD_CLOEXEC.
dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
[gl_cv_func_fcntl_f_dupfd_cloexec],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE(
[[#include <fcntl.h>
#include <unistd.h>
int main (int argc, char *argv[])
{
if (argc == 1)
/* parent process */
{
if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
return 1;
return execl ("./conftest", "./conftest", "child", NULL);
}
else
/* child process */
return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
}
]])
],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef __linux__
/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
it to support the semantics on older kernels that failed with EINVAL. */
choke me
#endif
]])],
[gl_cv_func_fcntl_f_dupfd_cloexec=yes],
[gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])
],
[gl_cv_func_fcntl_f_dupfd_cloexec=no],
[case "$host_os" in
# Guess no on NetBSD.
netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
*) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
esac
])
])
case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
*yes) ;;
*) gl_REPLACE_FCNTL
dnl No witness macro needed for this bug.
;;
esac
fi
dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
dnl to keep fchdir's bookkeeping up-to-date.
m4_ifdef([gl_FUNC_FCHDIR], [
gl_TEST_FCHDIR
if test $HAVE_FCHDIR = 0; then
gl_REPLACE_FCNTL
fi
])
])
AC_DEFUN([gl_REPLACE_FCNTL],
[
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([fcntl])
if test $ac_cv_func_fcntl = no; then
HAVE_FCNTL=0
else
REPLACE_FCNTL=1
fi
])

View file

@ -1,6 +1,6 @@
# serial 15
# serial 17
# Configure fcntl.h.
dnl Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2006-2007, 2009-2021 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.
@ -37,13 +37,18 @@ AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
AC_DEFUN([gl_FCNTL_H_DEFAULTS],
[
GNULIB_CREAT=0; AC_SUBST([GNULIB_CREAT])
GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING])
GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
dnl Support Microsoft deprecated alias function names by default.
GNULIB_MDA_CREAT=1; AC_SUBST([GNULIB_MDA_CREAT])
GNULIB_MDA_OPEN=1; AC_SUBST([GNULIB_MDA_OPEN])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT])
REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])

View file

@ -1,7 +1,7 @@
# serial 4
# serial 5
# Check for flexible array member support.
# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
[[#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
struct s { int n; double d[]; };]],
struct m { struct m *next, **list; char name[]; };
struct s { struct s *p; struct m *m; int n; double d[]; };]],
[[int m = getchar ();
size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
nbytes += sizeof (struct s) - 1;
nbytes -= nbytes % sizeof (struct s);
struct s *p = malloc (nbytes);
p->p = p;
p->m = NULL;
p->d[0] = 0.0;
return p->d != (double *) NULL;]])],
[ac_cv_c_flexmember=yes],
@ -31,12 +34,10 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
[Define to nothing if C supports flexible array members, and to
1 if it does not. That way, with a declaration like 'struct s
{ int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
{ int n; short d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
can be used with pre-C99 compilers.
When computing the size of such an object, don't use 'sizeof (struct s)'
as it overestimates the size. Use 'offsetof (struct s, d)' instead.
Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
MSVC and with C++ compilers.])
Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
the size in bytes of such a struct containing an N-element array.])
else
AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
fi

View file

@ -1,5 +1,5 @@
# float_h.m4 serial 9
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
# float_h.m4 serial 12
dnl Copyright (C) 2007, 2009-2021 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.
@ -14,7 +14,7 @@ AC_DEFUN([gl_FLOAT_H],
aix* | beos* | openbsd* | mirbsd* | irix*)
FLOAT_H=float.h
;;
freebsd*)
freebsd* | dragonfly*)
case "$host_cpu" in
changequote(,)dnl
i[34567]86 )
@ -24,10 +24,14 @@ changequote([,])dnl
x86_64 )
# On x86_64 systems, the C compiler may still be generating
# 32-bit code.
AC_EGREP_CPP([yes],
[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
yes
#endif],
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
int ok;
#else
error fail
#endif
]])],
[],
[FLOAT_H=float.h])
;;
@ -42,7 +46,7 @@ changequote([,])dnl
;;
esac
case "$host_os" in
aix* | freebsd* | linux*)
aix* | freebsd* | dragonfly* | linux*)
if test -n "$FLOAT_H"; then
REPLACE_FLOAT_LDBL=1
fi
@ -69,14 +73,20 @@ int main ()
[gl_cv_func_itold_works=no],
[case "$host" in
sparc*-*-linux*)
AC_EGREP_CPP([yes],
[#if defined __LP64__ || defined __arch64__
yes
#endif],
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __LP64__ || defined __arch64__
int ok;
#else
error fail
#endif
]])],
[gl_cv_func_itold_works="guessing no"],
[gl_cv_func_itold_works="guessing yes"])
;;
*) gl_cv_func_itold_works="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_itold_works="guessing yes" ;;
*) gl_cv_func_itold_works="guessing yes" ;;
esac
])
])

View file

@ -1,5 +1,5 @@
# flock.m4 serial 3
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2008-2021 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.

View file

@ -1,5 +1,5 @@
# floor.m4 serial 8
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
# floor.m4 serial 14
dnl Copyright (C) 2007, 2009-2021 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.
@ -32,7 +32,7 @@ AC_DEFUN([gl_FUNC_FLOOR],
static double dummy (double f) { return 0; }
int main (int argc, char *argv[])
{
double (*my_floor) (double) = argc ? floor : dummy;
double (* volatile my_floor) (double) = argc ? floor : dummy;
/* Test whether floor (-0.0) is -0.0. */
if (signbitd (minus_zerod) && !signbitd (my_floor (minus_zerod)))
return 1;
@ -42,10 +42,14 @@ int main (int argc, char *argv[])
[gl_cv_func_floor_ieee=yes],
[gl_cv_func_floor_ieee=no],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_floor_ieee="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_floor_ieee="guessing no" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_floor_ieee="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_floor_ieee="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_floor_ieee="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_floor_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
@ -75,8 +79,9 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
double (*funcptr) (double) = floor;
double x;]],
[[x = floor(x);]])],
[[x = funcptr(x) + floor(x);]])],
[gl_cv_func_floor_libm=])
if test "$gl_cv_func_floor_libm" = "?"; then
save_LIBS="$LIBS"
@ -87,8 +92,9 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
double (*funcptr) (double) = floor;
double x;]],
[[x = floor(x);]])],
[[x = funcptr(x) + floor(x);]])],
[gl_cv_func_floor_libm="-lm"])
LIBS="$save_LIBS"
fi

View file

@ -1,5 +1,5 @@
# fpieee.m4 serial 2 -*- coding: utf-8 -*-
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2007, 2009-2021 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.
@ -33,7 +33,7 @@ AC_DEFUN([gl_FP_IEEE],
alpha*)
# On Alpha systems, a compiler option provides the behaviour.
# See the ieee(3) manual page, also available at
# <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
# <https://backdrift.org/man/tru64/man3/ieee.3.html>
if test -n "$GCC"; then
# GCC has the option -mieee.
# For full IEEE compliance (rarely needed), use option -mieee-with-inexact.

49
m4/free.m4 Normal file
View file

@ -0,0 +1,49 @@
# free.m4 serial 5
# Copyright (C) 2003-2005, 2009-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert and Bruno Haible.
AC_DEFUN([gl_FUNC_FREE],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
dnl In the next release of POSIX, free must preserve errno.
dnl https://www.austingroupbugs.net/view.php?id=385
dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924
dnl So far, we know of three platforms that do this:
dnl * glibc >= 2.33, thanks to the fix for this bug:
dnl <https://sourceware.org/bugzilla/show_bug.cgi?id=17924>
dnl * OpenBSD >= 4.5, thanks to this commit:
dnl <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h>
dnl * Solaris, because its malloc() implementation is based on brk(),
dnl not mmap(); hence its free() implementation makes no system calls.
dnl For other platforms, you can only be sure if they state it in their
dnl documentation, or by code inspection of the free() implementation in libc.
AC_CACHE_CHECK([whether free is known to preserve errno],
[gl_cv_func_free_preserves_errno],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>
]],
[[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
#elif defined __OpenBSD__
#elif defined __sun
#else
#error "'free' is not known to preserve errno"
#endif
]])],
[gl_cv_func_free_preserves_errno=yes],
[gl_cv_func_free_preserves_errno=no])
])
case $gl_cv_func_free_preserves_errno in
*yes) ;;
*) REPLACE_FREE=1 ;;
esac
])
# Prerequisites of lib/free.c.
AC_DEFUN([gl_PREREQ_FREE], [:])

View file

@ -1,5 +1,5 @@
# frexp.m4 serial 15
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# frexp.m4 serial 16
dnl Copyright (C) 2007-2021 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.
@ -164,8 +164,17 @@ int main()
[gl_cv_func_frexp_works=yes],
[gl_cv_func_frexp_works=no],
[case "$host_os" in
netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
*) gl_cv_func_frexp_works="guessing yes";;
netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
mingw*) # Guess yes with MSVC, no with mingw.
AC_EGREP_CPP([Good], [
#ifdef _MSC_VER
Good
#endif
],
[gl_cv_func_frexp_works="guessing yes"],
[gl_cv_func_frexp_works="guessing no"])
;;
*) gl_cv_func_frexp_works="guessing yes" ;;
esac
])
])

View file

@ -1,22 +1,22 @@
# fstat.m4 serial 4
dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
# fstat.m4 serial 7
dnl Copyright (C) 2011-2021 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.
AC_DEFUN([gl_FUNC_FSTAT],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
AC_REQUIRE([gl_MSVC_INVAL])
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
REPLACE_FSTAT=1
fi
AC_REQUIRE([gl_HEADER_SYS_STAT_H])
if test $WINDOWS_64_BIT_ST_SIZE = 1; then
REPLACE_FSTAT=1
fi
case "$host_os" in
mingw* | solaris*)
dnl On MinGW, the original stat() returns st_atime, st_mtime,
dnl st_ctime values that are affected by the time zone.
dnl Solaris stat can return a negative tv_nsec.
REPLACE_FSTAT=1
;;
esac
dnl Replace fstat() for supporting the gnulib-defined open() on directories.
m4_ifdef([gl_FUNC_FCHDIR], [
@ -32,5 +32,9 @@ AC_DEFUN([gl_FUNC_FSTAT],
])
])
# Prerequisites of lib/fstat.c.
AC_DEFUN([gl_PREREQ_FSTAT], [:])
# Prerequisites of lib/fstat.c and lib/stat-w32.c.
AC_DEFUN([gl_PREREQ_FSTAT], [
AC_REQUIRE([gl_HEADER_SYS_STAT_H])
AC_REQUIRE([gl_PREREQ_STAT_W32])
:
])

View file

@ -1,5 +1,5 @@
# fsync.m4 serial 2
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2008-2021 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.

View file

@ -1,5 +1,5 @@
# func.m4 serial 2
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2008-2021 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.

View file

@ -1,5 +1,5 @@
# getaddrinfo.m4 serial 31
dnl Copyright (C) 2004-2017 Free Software Foundation, Inc.
# getaddrinfo.m4 serial 33
dnl Copyright (C) 2004-2021 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.
@ -8,7 +8,6 @@ AC_DEFUN([gl_GETADDRINFO],
[
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
AC_MSG_CHECKING([how to do getaddrinfo, freeaddrinfo and getnameinfo])
GETADDRINFO_LIB=
gai_saved_LIBS="$LIBS"
@ -55,10 +54,40 @@ AC_DEFUN([gl_GETADDRINFO],
if test "$gl_cv_w32_getaddrinfo" = "yes"; then
GETADDRINFO_LIB="-lws2_32"
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
dnl Check for correct signature, in particular for a cdecl-compatible
dnl calling convention.
AC_CACHE_CHECK([for getaddrinfo with POSIX signature],
[gl_cv_func_getaddrinfo_posix_signature],
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#include <stddef.h>
extern
#ifdef __cplusplus
"C"
#endif
int getaddrinfo (const char *, const char *, const struct addrinfo *, struct addrinfo **);
]])],
[gl_cv_func_getaddrinfo_posix_signature=yes],
[gl_cv_func_getaddrinfo_posix_signature=no])
])
if test $gl_cv_func_getaddrinfo_posix_signature = no; then
REPLACE_GETADDRINFO=1
fi
else
HAVE_GETADDRINFO=0
fi
fi
AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO], [$HAVE_GETADDRINFO],
[Define to 1 if getaddrinfo exists, or to 0 otherwise.])
# We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
# inline function declared in ws2tcpip.h, so we need to get that

63
m4/getdtablesize.m4 Normal file
View file

@ -0,0 +1,63 @@
# getdtablesize.m4 serial 8
dnl Copyright (C) 2008-2021 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.
AC_DEFUN([gl_FUNC_GETDTABLESIZE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_FUNCS_ONCE([getdtablesize])
AC_CHECK_DECLS_ONCE([getdtablesize])
if test $ac_cv_func_getdtablesize = yes &&
test $ac_cv_have_decl_getdtablesize = yes; then
AC_CACHE_CHECK([whether getdtablesize works],
[gl_cv_func_getdtablesize_works],
[dnl There are two concepts: the "maximum possible file descriptor value + 1"
dnl and the "maximum number of open file descriptors in a process".
dnl Per SUSv2 and POSIX, getdtablesize() should return the first one.
dnl On most platforms, the first and the second concept are the same.
dnl On OpenVMS, however, they are different and getdtablesize() returns
dnl the second one; thus the test below fails. But we don't care
dnl because there's no good way to write a replacement getdtablesize().
case "$host_os" in
vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
*)
dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft
dnl limit up to an unchangeable hard limit; all other platforms
dnl correctly require setrlimit before getdtablesize() can report
dnl a larger value.
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[#include <unistd.h>]
GL_MDA_DEFINES
],
[[int size = getdtablesize();
if (dup2 (0, getdtablesize()) != -1)
return 1;
if (size != getdtablesize())
return 2;
]])],
[gl_cv_func_getdtablesize_works=yes],
[gl_cv_func_getdtablesize_works=no],
[case "$host_os" in
cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
gl_cv_func_getdtablesize_works="guessing no" ;;
*) gl_cv_func_getdtablesize_works="guessing yes" ;;
esac
])
;;
esac
])
case "$gl_cv_func_getdtablesize_works" in
*yes | "no (limitation)") ;;
*) REPLACE_GETDTABLESIZE=1 ;;
esac
else
HAVE_GETDTABLESIZE=0
fi
])
# Prerequisites of lib/getdtablesize.c.
AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])

View file

@ -1,5 +1,5 @@
# getlogin.m4 serial 5
dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2010-2021 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.

68
m4/getrandom.m4 Normal file
View file

@ -0,0 +1,68 @@
# getrandom.m4 serial 8
dnl Copyright 2020-2021 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.
dnl Written by Paul Eggert.
AC_DEFUN([gl_FUNC_GETRANDOM],
[
AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([getrandom])
if test "$ac_cv_func_getrandom" != yes; then
HAVE_GETRANDOM=0
else
dnl On Solaris 11.4 the return type is 'int', not 'ssize_t'.
AC_CACHE_CHECK([whether getrandom is compatible with its GNU+BSD signature],
[gl_cv_func_getrandom_ok],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[/* Additional includes are needed before <sys/random.h> on uClibc
and Mac OS X. */
#include <sys/types.h>
#include <stdlib.h>
#include <sys/random.h>
ssize_t getrandom (void *, size_t, unsigned int);
]],
[[]])
],
[gl_cv_func_getrandom_ok=yes],
[gl_cv_func_getrandom_ok=no])
])
if test $gl_cv_func_getrandom_ok = no; then
REPLACE_GETRANDOM=1
fi
fi
case "$host_os" in
mingw*)
AC_CHECK_HEADERS([bcrypt.h], [], [],
[[#include <windows.h>
]])
AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present],
[gl_cv_lib_assume_bcrypt],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <windows.h>]],
[[#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
cannot assume it
#endif
]])
],
[gl_cv_lib_assume_bcrypt=yes],
[gl_cv_lib_assume_bcrypt=no])
])
if test $gl_cv_lib_assume_bcrypt = yes; then
AC_DEFINE([HAVE_LIB_BCRYPT], [1],
[Define to 1 if the bcrypt library is guaranteed to be present.])
LIB_GETRANDOM='-lbcrypt'
else
LIB_GETRANDOM='-ladvapi32'
fi
;;
*)
LIB_GETRANDOM= ;;
esac
AC_SUBST([LIB_GETRANDOM])
])

View file

@ -1,138 +0,0 @@
# serial 21
# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl From Jim Meyering.
AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
[
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_SYS_TIME_H])
AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([gettimeofday])
gl_gettimeofday_timezone=void
if test $ac_cv_func_gettimeofday != yes; then
HAVE_GETTIMEOFDAY=0
else
gl_FUNC_GETTIMEOFDAY_CLOBBER
AC_CACHE_CHECK([for gettimeofday with POSIX signature],
[gl_cv_func_gettimeofday_posix_signature],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/time.h>
struct timeval c;
int gettimeofday (struct timeval *restrict, void *restrict);
]],
[[/* glibc uses struct timezone * rather than the POSIX void *
if _GNU_SOURCE is defined. However, since the only portable
use of gettimeofday uses NULL as the second parameter, and
since the glibc definition is actually more typesafe, it is
not worth wrapping this to get a compliant signature. */
int (*f) (struct timeval *restrict, void *restrict)
= gettimeofday;
int x = f (&c, 0);
return !(x | c.tv_sec | c.tv_usec);
]])],
[gl_cv_func_gettimeofday_posix_signature=yes],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/time.h>
int gettimeofday (struct timeval *restrict, struct timezone *restrict);
]])],
[gl_cv_func_gettimeofday_posix_signature=almost],
[gl_cv_func_gettimeofday_posix_signature=no])])])
if test $gl_cv_func_gettimeofday_posix_signature = almost; then
gl_gettimeofday_timezone='struct timezone'
elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
REPLACE_GETTIMEOFDAY=1
fi
dnl If we override 'struct timeval', we also have to override gettimeofday.
if test $REPLACE_STRUCT_TIMEVAL = 1; then
REPLACE_GETTIMEOFDAY=1
fi
m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
gl_FUNC_TZSET_CLOBBER
case "$gl_cv_func_tzset_clobber" in
*yes)
REPLACE_GETTIMEOFDAY=1
gl_GETTIMEOFDAY_REPLACE_LOCALTIME
AC_DEFINE([tzset], [rpl_tzset],
[Define to rpl_tzset if the wrapper function should be used.])
AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
[Define if tzset clobbers localtime's static buffer.])
;;
esac
])
fi
AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
[Define this to 'void' or 'struct timezone' to match the system's
declaration of the second argument to gettimeofday.])
])
dnl See if gettimeofday clobbers the static buffer that localtime uses
dnl for its return value. The gettimeofday function from Mac OS X 10.0.4
dnl (i.e., Darwin 1.3.7) has this problem.
dnl
dnl If it does, then arrange to use gettimeofday and localtime only via
dnl the wrapper functions that work around the problem.
AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
[
AC_REQUIRE([gl_HEADER_SYS_TIME_H])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
[gl_cv_func_gettimeofday_clobber],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
]],
[[
time_t t = 0;
struct tm *lt;
struct tm saved_lt;
struct timeval tv;
lt = localtime (&t);
saved_lt = *lt;
gettimeofday (&tv, NULL);
return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
]])],
[gl_cv_func_gettimeofday_clobber=no],
[gl_cv_func_gettimeofday_clobber=yes],
[# When cross-compiling:
case "$host_os" in
# Guess all is fine on glibc systems.
*-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
# If we don't know, assume the worst.
*) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
esac
])])
case "$gl_cv_func_gettimeofday_clobber" in
*yes)
REPLACE_GETTIMEOFDAY=1
gl_GETTIMEOFDAY_REPLACE_LOCALTIME
AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
[Define if gettimeofday clobbers the localtime buffer.])
;;
esac
])
AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
REPLACE_GMTIME=1
REPLACE_LOCALTIME=1
])
# Prerequisites of lib/gettimeofday.c.
AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
AC_CHECK_HEADERS([sys/timeb.h])
AC_CHECK_FUNCS([_ftime])
])

View file

@ -1,34 +0,0 @@
# glibc21.m4 serial 5
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 Free Software Foundation,
dnl 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.
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
# From Bruno Haible.
AC_DEFUN([gl_GLIBC21],
[
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
[ac_cv_gnu_library_2_1],
[AC_EGREP_CPP([Lucky],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user
#endif
#endif
#ifdef __UCLIBC__
Lucky user
#endif
],
[ac_cv_gnu_library_2_1=yes],
[ac_cv_gnu_library_2_1=no])
]
)
AC_SUBST([GLIBC21])
GLIBC21="$ac_cv_gnu_library_2_1"
]
)

View file

@ -1,4 +1,4 @@
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -11,7 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
# along with this file. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
@ -27,7 +27,121 @@
# Specification in the form of a command-line invocation:
# gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --avoid=unistr/base --avoid=unistr/u8-mbtouc --avoid=unistr/u8-mbtouc-unsafe --avoid=unistr/u8-mbtoucr --avoid=unistr/u8-prev --avoid=unistr/u8-uctomb --avoid=unitypes --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept4 alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd dirname-lgpl duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkostemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar
# gnulib-tool --import --local-dir=gnulib-local \
# --lib=libgnu \
# --source-base=lib \
# --m4-base=m4 \
# --doc-base=doc \
# --tests-base=tests \
# --aux-dir=build-aux \
# --lgpl=3 \
# --conditional-dependencies \
# --libtool \
# --macro-prefix=gl \
# --no-vc-files \
# --avoid=lock \
# --avoid=unistr/base \
# --avoid=unistr/u8-mbtouc \
# --avoid=unistr/u8-mbtouc-unsafe \
# --avoid=unistr/u8-mbtoucr \
# --avoid=unistr/u8-prev \
# --avoid=unistr/u8-uctomb \
# --avoid=unitypes \
# accept4 \
# alignof \
# alloca-opt \
# announce-gen \
# autobuild \
# bind \
# byteswap \
# c-strcase \
# canonicalize-lgpl \
# ceil \
# clock-time \
# close \
# connect \
# copysign \
# dirfd \
# dirname-lgpl \
# duplocale \
# environ \
# extensions \
# flexmember \
# flock \
# floor \
# fpieee \
# frexp \
# fstat \
# fsync \
# full-read \
# full-write \
# func \
# gendocs \
# getaddrinfo \
# getlogin \
# getpeername \
# getsockname \
# getsockopt \
# git-version-gen \
# gitlog-to-changelog \
# gnu-web-doc-update \
# gnupload \
# havelib \
# iconv_open-utf \
# inet_ntop \
# inet_pton \
# isfinite \
# isinf \
# isnan \
# ldexp \
# lib-symbol-versions \
# lib-symbol-visibility \
# libunistring \
# link \
# listen \
# localcharset \
# locale \
# log1p \
# lstat \
# maintainer-makefile \
# malloc-gnu \
# malloca \
# mkdir \
# mkostemp \
# nl_langinfo \
# nproc \
# open \
# pipe-posix \
# pipe2 \
# poll \
# putenv \
# readlink \
# recv \
# recvfrom \
# regex \
# rename \
# rmdir \
# select \
# send \
# sendto \
# setenv \
# setsockopt \
# shutdown \
# socket \
# stat-time \
# stdlib \
# strftime \
# striconveh \
# string \
# sys_stat \
# time \
# times \
# trunc \
# unistd \
# verify \
# vsnprintf \
# warnings \
# wchar
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gnulib-local])
@ -51,6 +165,7 @@ gl_MODULES([
duplocale
environ
extensions
flexmember
flock
floor
fpieee

View file

@ -1,25 +1,54 @@
# gnulib-common.m4 serial 36
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# gnulib-common.m4 serial 63
dnl Copyright (C) 2007-2021 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.
AC_PREREQ([2.62])
# gl_COMMON
# is expanded unconditionally through gnulib-tool magic.
AC_DEFUN([gl_COMMON], [
dnl Use AC_REQUIRE here, so that the code is expanded once only.
AC_REQUIRE([gl_00GNULIB])
AC_REQUIRE([gl_COMMON_BODY])
AC_REQUIRE([gl_ZZGNULIB])
])
AC_DEFUN([gl_COMMON_BODY], [
AH_VERBATIM([_GL_GNUC_PREREQ],
[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
#if defined __GNUC__ && defined __GNUC_MINOR__
# define _GL_GNUC_PREREQ(major, minor) \
((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
#else
# define _GL_GNUC_PREREQ(major, minor) 0
#endif
])
AH_VERBATIM([_Noreturn],
[/* The _Noreturn keyword of C11. */
#if ! (defined _Noreturn \
|| (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|| 0x5110 <= __SUNPRO_C)
#ifndef _Noreturn
# if (defined __cplusplus \
&& ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
|| (defined _MSC_VER && 1900 <= _MSC_VER)) \
&& 0)
/* [[noreturn]] is not practically usable, because with it the syntax
extern _Noreturn void func (...);
would not be valid; such a declaration would only be valid with 'extern'
and '_Noreturn' swapped, or without the 'extern' keyword. However, some
AIX system header files and several gnulib header files use precisely
this syntax with 'extern'. */
# define _Noreturn [[noreturn]]
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \
&& (_GL_GNUC_PREREQ (4, 7) \
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
: 3 < __clang_major__ + (5 <= __clang_minor__))))))
/* _Noreturn works as-is. */
# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
# elif defined _MSC_VER && 1200 <= _MSC_VER
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
# define _Noreturn __declspec (noreturn)
# else
# define _Noreturn
@ -36,43 +65,288 @@ AC_DEFUN([gl_COMMON_BODY], [
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
# define __GNUC_STDC_INLINE__ 1
#endif])
AH_VERBATIM([unused_parameter],
[/* Define as a marker that can be attached to declarations that might not
be used. This helps to reduce warnings, such as from
GCC -Wunused-parameter. */
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define _GL_UNUSED __attribute__ ((__unused__))
AH_VERBATIM([attribute],
[/* Attributes. */
#ifdef __has_attribute
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
# define _GL_UNUSED
# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
# define _GL_ATTR_diagnose_if 0
# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
# ifdef _ICC
# define _GL_ATTR_may_alias 0
# else
# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
# endif
# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
#endif
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
/* gcc supports the "unused" attribute on possibly unused labels, and
g++ has since version 4.5. Note to support C++ as well as C,
_GL_UNUSED_LABEL should be used with a trailing ; */
#if !defined __cplusplus || __GNUC__ > 4 \
|| (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
# define _GL_UNUSED_LABEL _GL_UNUSED
]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
[
#if _GL_HAS_ATTRIBUTE (alloc_size)
# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
#else
# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
#endif
#if _GL_HAS_ATTRIBUTE (always_inline)
# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
#else
# define _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
#if _GL_HAS_ATTRIBUTE (artificial)
# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
#else
# define _GL_ATTRIBUTE_ARTIFICIAL
#endif
/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
<https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
# ifndef __SUNPRO_C
# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
# else
# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
# endif
#else
# define _GL_ATTRIBUTE_COLD
#endif
#if _GL_HAS_ATTRIBUTE (const)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
#else
# define _GL_ATTRIBUTE_CONST
#endif
#if 201710L < __STDC_VERSION__
# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
#elif _GL_HAS_ATTRIBUTE (deprecated)
# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
#else
# define _GL_ATTRIBUTE_DEPRECATED
#endif
#if _GL_HAS_ATTRIBUTE (error)
# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
#elif _GL_HAS_ATTRIBUTE (diagnose_if)
# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
#else
# define _GL_ATTRIBUTE_ERROR(msg)
# define _GL_ATTRIBUTE_WARNING(msg)
#endif
#if _GL_HAS_ATTRIBUTE (externally_visible)
# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
#else
# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
#endif
/* FALLTHROUGH is special, because it always expands to something. */
#if 201710L < __STDC_VERSION__
# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
#elif _GL_HAS_ATTRIBUTE (fallthrough)
# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
#else
# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
#endif
#if _GL_HAS_ATTRIBUTE (format)
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
#else
# define _GL_ATTRIBUTE_FORMAT(spec)
#endif
#if _GL_HAS_ATTRIBUTE (leaf)
# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
#else
# define _GL_ATTRIBUTE_LEAF
#endif
/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
#else
# define _GL_ATTRIBUTE_MAY_ALIAS
#endif
#if 201710L < __STDC_VERSION__
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
#elif _GL_HAS_ATTRIBUTE (unused)
# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
#else
# define _GL_ATTRIBUTE_MAYBE_UNUSED
#endif
/* Earlier spellings of this macro. */
#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
#if _GL_HAS_ATTRIBUTE (malloc)
# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
#else
# define _GL_ATTRIBUTE_MALLOC
#endif
#if 201710L < __STDC_VERSION__
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
#else
# define _GL_ATTRIBUTE_NODISCARD
#endif
#if _GL_HAS_ATTRIBUTE (noinline)
# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
#else
# define _GL_ATTRIBUTE_NOINLINE
#endif
#if _GL_HAS_ATTRIBUTE (nonnull)
# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
#else
# define _GL_ATTRIBUTE_NONNULL(args)
#endif
#if _GL_HAS_ATTRIBUTE (nonstring)
# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
#else
# define _GL_ATTRIBUTE_NONSTRING
#endif
/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
#else
# define _GL_ATTRIBUTE_NOTHROW
#endif
#if _GL_HAS_ATTRIBUTE (packed)
# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
#else
# define _GL_ATTRIBUTE_PACKED
#endif
#if _GL_HAS_ATTRIBUTE (pure)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
# define _GL_ATTRIBUTE_PURE
#endif
#if _GL_HAS_ATTRIBUTE (returns_nonnull)
# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
#else
# define _GL_ATTRIBUTE_RETURNS_NONNULL
#endif
#if _GL_HAS_ATTRIBUTE (sentinel)
# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
#else
# define _GL_ATTRIBUTE_SENTINEL(pos)
#endif
]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
[
/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */
#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5)
# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED
#else
# define _GL_UNUSED_LABEL
#endif
/* The __pure__ attribute was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
# define _GL_ATTRIBUTE_PURE /* empty */
#endif
/* The __const__ attribute was added in gcc 2.95. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
#else
# define _GL_ATTRIBUTE_CONST /* empty */
#endif
])
AH_VERBATIM([async_safe],
[/* The _GL_ASYNC_SAFE marker should be attached to functions that are
signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
invoked from such signal handlers. Such functions have some restrictions:
* All functions that it calls should be marked _GL_ASYNC_SAFE as well,
or should be listed as async-signal-safe in POSIX
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
particular, are NOT async-signal-safe.
* All memory locations (variables and struct fields) that these functions
access must be marked 'volatile'. This holds for both read and write
accesses. Otherwise the compiler might optimize away stores to and
reads from such locations that occur in the program, depending on its
data flow analysis. For example, when the program contains a loop
that is intended to inspect a variable set from within a signal handler
while (!signal_occurred)
;
the compiler is allowed to transform this into an endless loop if the
variable 'signal_occurred' is not declared 'volatile'.
Additionally, recall that:
* A signal handler should not modify errno (except if it is a handler
for a fatal signal and ends by raising the same signal again, thus
provoking the termination of the process). If it invokes a function
that may clobber errno, it needs to save and restore the value of
errno. */
#define _GL_ASYNC_SAFE
])
AH_VERBATIM([micro_optimizations],
[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
n1 and n2 are expressions without side effects, that evaluate to real
numbers (excluding NaN).
It returns
1 if n1 > n2
0 if n1 == n2
-1 if n1 < n2
The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
jump with nearly all GCC versions up to GCC 10.
This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
GCC versions up to GCC 9.
The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
avoids conditional jumps in all GCC versions >= 3.4. */
#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
])
dnl Hint which direction to take regarding cross-compilation guesses:
dnl When a user installs a program on a platform they are not intimately
dnl familiar with, --enable-cross-guesses=conservative is the appropriate
dnl choice. It implements the "If we don't know, assume the worst" principle.
dnl However, when an operating system developer (on a platform which is not
dnl yet known to gnulib) builds packages for their platform, they want to
dnl expose, not hide, possible platform bugs; in this case,
dnl --enable-cross-guesses=risky is the appropriate choice.
dnl Sets the variables
dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad),
dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad).
AC_ARG_ENABLE([cross-guesses],
[AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
[specify policy for cross-compilation guesses])],
[if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
enableval=conservative
fi
gl_cross_guesses="$enableval"],
[gl_cross_guesses=conservative])
if test $gl_cross_guesses = risky; then
gl_cross_guess_normal="guessing yes"
gl_cross_guess_inverted="guessing no"
else
gl_cross_guess_normal="guessing no"
gl_cross_guess_inverted="guessing yes"
fi
dnl Preparation for running test programs:
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
@ -207,42 +481,20 @@ AC_DEFUN([gl_FEATURES_H],
AC_SUBST([HAVE_FEATURES_H])
])
# m4_foreach_w
# is a backport of autoconf-2.59c's m4_foreach_w.
# Remove this macro when we can assume autoconf >= 2.60.
m4_ifndef([m4_foreach_w],
[m4_define([m4_foreach_w],
[m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
# ----------------------------------------------------
# Backport of autoconf-2.63b's macro.
# Remove this macro when we can assume autoconf >= 2.64.
m4_ifndef([AS_VAR_IF],
[m4_define([AS_VAR_IF],
[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
# gl_PROG_CC_C99
# Modifies the value of the shell variable CC in an attempt to make $CC
# understand ISO C99 source code.
# This is like AC_PROG_CC_C99, except that
# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
# Remaining problems:
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
# to CC twice
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
AC_DEFUN([gl_PROG_CC_C99],
[
dnl Change that version number to the minimum Autoconf version that supports
dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
m4_version_prereq([9.0],
[AC_REQUIRE([AC_PROG_CC_C99])],
[AC_REQUIRE([AC_PROG_CC_STDC])])
dnl Just use AC_PROG_CC_C99.
dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted
dnl value of CC will contain the C99 enabling options twice. But this is only
dnl a cosmetic problem.
dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99;
dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
m4_version_prereq([2.70],
[AC_REQUIRE([AC_PROG_CC])],
[AC_REQUIRE([AC_PROG_CC_C99])])
])
# gl_PROG_AR_RANLIB
@ -256,7 +508,8 @@ AC_DEFUN([gl_PROG_AR_RANLIB],
dnl library formats. In particular, the GNU binutils programs ar and ranlib
dnl produce libraries that work only with gcc, not with cc.
AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AM_PROG_AR])
dnl The '][' hides this use from 'aclocal'.
AC_BEFORE([$0], [A][M_PROG_AR])
AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
[
AC_EGREP_CPP([Amsterdam],
@ -288,7 +541,9 @@ Amsterdam
dnl __ACK__. It may seem like its easier to avoid calling the macro here,
dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
dnl default value and automake should usually know them).
m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
dnl
dnl The '][' hides this use from 'aclocal'.
m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
fi
dnl In case the code above has not helped with setting AR/ARFLAGS, use
@ -312,48 +567,29 @@ Amsterdam
AC_SUBST([RANLIB])
])
# AC_PROG_MKDIR_P
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
# for interoperability with automake-1.9.6 from autoconf-2.62.
# Remove this macro when we can assume autoconf >= 2.62 or
# autoconf >= 2.60 && automake >= 1.10.
# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
m4_ifndef([AC_AUTOCONF_VERSION],[
m4_ifdef([AC_PROG_MKDIR_P], [
dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
m4_define([AC_PROG_MKDIR_P],
m4_defn([AC_PROG_MKDIR_P])[
AC_SUBST([MKDIR_P])])], [
dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
[AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
MKDIR_P='$(mkdir_p)'
AC_SUBST([MKDIR_P])])])
])
# AC_C_RESTRICT
# This definition is copied from post-2.69 Autoconf and overrides the
# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed
# once autoconf >= 2.70 can be assumed. It's painful to check version
# numbers, and in practice this macro is more up-to-date than Autoconf
# is, so override Autoconf unconditionally.
# This definition is copied from post-2.70 Autoconf and overrides the
# AC_C_RESTRICT macro from autoconf 2.60..2.70.
m4_version_prereq([2.70.1], [], [
AC_DEFUN([AC_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
[ac_cv_c_restrict=no
# The order here caters to the fact that C++ does not require restrict.
for ac_kw in __restrict __restrict__ _Restrict restrict; do
# Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
# https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
# Put 'restrict' last, because C++ lacks it.
for ac_kw in __restrict__ __restrict _Restrict restrict; do
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[typedef int *int_ptr;
int foo (int_ptr $ac_kw ip) { return ip[0]; }
int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
int bar (int ip[$ac_kw]) { return ip[0]; }
]],
[[int s[1];
int *$ac_kw t = s;
t[0] = 0;
return foo (t) + bar (t);
]])],
[[typedef int *int_ptr;
int foo (int_ptr $ac_kw ip) { return ip[0]; }
int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
int bar (int ip[$ac_kw]) { return ip[0]; }
]],
[[int s[1];
int *$ac_kw t = s;
t[0] = 0;
return foo (t) + bar (t);
]])],
[ac_cv_c_restrict=$ac_kw])
test "$ac_cv_c_restrict" != no && break
done
@ -361,14 +597,15 @@ AC_DEFUN([AC_C_RESTRICT],
AH_VERBATIM([restrict],
[/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
supported only directly. */
#undef restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
/* Work around a bug in older versions of Sun C++, which did not
#define __restrict__ or support _Restrict or __restrict__
even though the corresponding Sun C compiler ended up with
"#define restrict _Restrict" or "#define restrict __restrict__"
in the previous line. This workaround can be removed once
we assume Oracle Developer Studio 12.5 (2016) or later. */
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
# define _Restrict
# define __restrict__
#endif])
@ -378,6 +615,7 @@ AC_DEFUN([AC_C_RESTRICT],
*) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
esac
])# AC_C_RESTRICT
])
# gl_BIGENDIAN
# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
@ -388,6 +626,22 @@ AC_DEFUN([gl_BIGENDIAN],
AC_C_BIGENDIAN
])
# A temporary file descriptor.
# Must be less than 10, because dash 0.5.8 does not support redirections
# with multi-digit file descriptors.
m4_define([GL_TMP_FD], 9)
# gl_SILENT(command)
# executes command, but without the normal configure output.
# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
# inside another AC_CACHE_CHECK.
AC_DEFUN([gl_SILENT],
[
exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
$1
exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
])
# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
# output a spurious "(cached)" mark in the midst of other configure output.
@ -395,68 +649,77 @@ AC_DEFUN([gl_BIGENDIAN],
# by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
AC_DEFUN([gl_CACHE_VAL_SILENT],
[
saved_as_echo_n="$as_echo_n"
as_echo_n=':'
AC_CACHE_VAL([$1], [$2])
as_echo_n="$saved_as_echo_n"
gl_SILENT([
AC_CACHE_VAL([$1], [$2])
])
])
# AS_VAR_COPY was added in autoconf 2.63b
m4_define_default([AS_VAR_COPY],
[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
# AC_PROG_SED was added in autoconf 2.59b
m4_ifndef([AC_PROG_SED],
[AC_DEFUN([AC_PROG_SED],
[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
[dnl ac_script should not contain more than 99 commands (for HP-UX sed),
dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
done
echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
AS_UNSET([ac_script])
if test -z "$SED"; then
ac_path_SED_found=false
_AS_PATH_WALK([], [
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
case `"$ac_path_SED" --version 2>&1` in
*GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
*)
ac_count=0
_AS_ECHO_N([0123456789]) >conftest.in
while :
do
cat conftest.in conftest.in >conftest.tmp
mv conftest.tmp conftest.in
cp conftest.in conftest.nl
echo >> conftest.nl
"$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
diff conftest.out conftest.nl >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
if test $ac_count -gt ${ac_path_SED_max-0}; then
# Best so far, but keep looking for better
ac_cv_path_SED=$ac_path_SED
ac_path_SED_max=$ac_count
fi
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_SED_found && break 3
done
done])
if test -z "$ac_cv_path_SED"; then
AC_ERROR([no acceptable sed could be found in \$PATH])
fi
else
ac_cv_path_SED=$SED
fi
SED="$ac_cv_path_SED"
AC_SUBST([SED])dnl
rm -f conftest.sed
])])])
dnl Expands to some code for use in .c programs that, on native Windows, defines
dnl the Microsoft deprecated alias function names to the underscore-prefixed
dnl actual function names. With this macro, these function names are available
dnl without linking with '-loldnames' and without generating warnings.
dnl Usage: Use it after all system header files are included.
dnl #include <...>
dnl #include <...>
dnl ]GL_MDA_DEFINES[
dnl ...
AC_DEFUN([GL_MDA_DEFINES],[
AC_REQUIRE([_GL_MDA_DEFINES])
[$gl_mda_defines]
])
AC_DEFUN([_GL_MDA_DEFINES],
[gl_mda_defines='
#if defined _WIN32 && !defined __CYGWIN__
#define access _access
#define chdir _chdir
#define chmod _chmod
#define close _close
#define creat _creat
#define dup _dup
#define dup2 _dup2
#define ecvt _ecvt
#define execl _execl
#define execle _execle
#define execlp _execlp
#define execv _execv
#define execve _execve
#define execvp _execvp
#define execvpe _execvpe
#define fcloseall _fcloseall
#define fcvt _fcvt
#define fdopen _fdopen
#define fileno _fileno
#define gcvt _gcvt
#define getcwd _getcwd
#define getpid _getpid
#define getw _getw
#define isatty _isatty
#define j0 _j0
#define j1 _j1
#define jn _jn
#define lfind _lfind
#define lsearch _lsearch
#define lseek _lseek
#define memccpy _memccpy
#define mkdir _mkdir
#define mktemp _mktemp
#define open _open
#define putenv _putenv
#define putw _putw
#define read _read
#define rmdir _rmdir
#define strdup _strdup
#define swab _swab
#define tempnam _tempnam
#define tzset _tzset
#define umask _umask
#define unlink _unlink
#define utime _utime
#define wcsdup _wcsdup
#define write _write
#define y0 _y0
#define y1 _y1
#define yn _yn
#endif
'
])

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
dnl Copyright (C) 2004-2005, 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2004-2005, 2009-2021 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.

View file

@ -1,11 +0,0 @@
# hard-locale.m4 serial 8
dnl Copyright (C) 2002-2006, 2009-2017 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.
dnl No prerequisites of lib/hard-locale.c.
AC_DEFUN([gl_HARD_LOCALE],
[
:
])

675
m4/host-cpu-c-abi.m4 Normal file
View file

@ -0,0 +1,675 @@
# host-cpu-c-abi.m4 serial 13
dnl Copyright (C) 2002-2021 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.
dnl From Bruno Haible and Sam Steingold.
dnl Sets the HOST_CPU variable to the canonical name of the CPU.
dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
dnl C language ABI (application binary interface).
dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
dnl config.h.
dnl
dnl This canonical name can be used to select a particular assembly language
dnl source file that will interoperate with C code on the given host.
dnl
dnl For example:
dnl * 'i386' and 'sparc' are different canonical names, because code for i386
dnl will not run on SPARC CPUs and vice versa. They have different
dnl instruction sets.
dnl * 'sparc' and 'sparc64' are different canonical names, because code for
dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
dnl mode, but not both.
dnl * 'mips' and 'mipsn32' are different canonical names, because they use
dnl different argument passing and return conventions for C functions, and
dnl although the instruction set of 'mips' is a large subset of the
dnl instruction set of 'mipsn32'.
dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
dnl different sizes for the C types like 'int' and 'void *', and although
dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
dnl * The same canonical name is used for different endiannesses. You can
dnl determine the endianness through preprocessor symbols:
dnl - 'arm': test __ARMEL__.
dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
dnl assembly language source files use such instructions, you will
dnl need to make the distinction.
dnl - Speed of execution of the common instruction set is reasonable across
dnl the entire family of CPUs. If you have assembly language source files
dnl that are optimized for particular CPU types (like GNU gmp has), you
dnl will need to make the distinction.
dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
AC_DEFUN([gl_HOST_CPU_C_ABI],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_C_ASM])
AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
[case "$host_cpu" in
changequote(,)dnl
i[34567]86 )
changequote([,])dnl
gl_cv_host_cpu_c_abi=i386
;;
x86_64 )
# On x86_64 systems, the C compiler may be generating code in one of
# these ABIs:
# - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
# - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
# with native Windows (mingw, MSVC).
# - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if (defined __x86_64__ || defined __amd64__ \
|| defined _M_X64 || defined _M_AMD64)
int ok;
#else
error fail
#endif
]])],
[AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __ILP32__ || defined _ILP32
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=x86_64-x32],
[gl_cv_host_cpu_c_abi=x86_64])],
[gl_cv_host_cpu_c_abi=i386])
;;
changequote(,)dnl
alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
changequote([,])dnl
gl_cv_host_cpu_c_abi=alpha
;;
arm* | aarch64 )
# Assume arm with EABI.
# On arm64 systems, the C compiler may be generating code in one of
# these ABIs:
# - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
# - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifdef __aarch64__
int ok;
#else
error fail
#endif
]])],
[AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __ILP32__ || defined _ILP32
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=arm64-ilp32],
[gl_cv_host_cpu_c_abi=arm64])],
[# Don't distinguish little-endian and big-endian arm, since they
# don't require different machine code for simple operations and
# since the user can distinguish them through the preprocessor
# defines __ARMEL__ vs. __ARMEB__.
# But distinguish arm which passes floating-point arguments and
# return values in integer registers (r0, r1, ...) - this is
# gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
# passes them in float registers (s0, s1, ...) and double registers
# (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
# sets the preprocessor defines __ARM_PCS (for the first case) and
# __ARM_PCS_VFP (for the second case), but older GCC does not.
echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
# Look for a reference to the register d0 in the .s file.
AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
gl_cv_host_cpu_c_abi=armhf
else
gl_cv_host_cpu_c_abi=arm
fi
rm -f conftest*
])
;;
hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
# On hppa, the C compiler may be generating 32-bit code or 64-bit
# code. In the latter case, it defines _LP64 and __LP64__.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifdef __LP64__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=hppa64],
[gl_cv_host_cpu_c_abi=hppa])
;;
ia64* )
# On ia64 on HP-UX, the C compiler may be generating 64-bit code or
# 32-bit code. In the latter case, it defines _ILP32.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifdef _ILP32
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=ia64-ilp32],
[gl_cv_host_cpu_c_abi=ia64])
;;
mips* )
# We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
# at 32.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=mips64],
[# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
# may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
# In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
# may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if (_MIPS_SIM == _ABIN32)
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=mipsn32],
[gl_cv_host_cpu_c_abi=mips])])
;;
powerpc* )
# Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
# No need to distinguish them here; the caller may distinguish
# them based on the OS.
# On powerpc64 systems, the C compiler may still be generating
# 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
# be generating 64-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __powerpc64__ || defined _ARCH_PPC64
int ok;
#else
error fail
#endif
]])],
[# On powerpc64, there are two ABIs on Linux: The AIX compatible
# one and the ELFv2 one. The latter defines _CALL_ELF=2.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined _CALL_ELF && _CALL_ELF == 2
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=powerpc64-elfv2],
[gl_cv_host_cpu_c_abi=powerpc64])
],
[gl_cv_host_cpu_c_abi=powerpc])
;;
rs6000 )
gl_cv_host_cpu_c_abi=powerpc
;;
riscv32 | riscv64 )
# There are 2 architectures (with variants): rv32* and rv64*.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if __riscv_xlen == 64
int ok;
#else
error fail
#endif
]])],
[cpu=riscv64],
[cpu=riscv32])
# There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
# Size of 'long' and 'void *':
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __LP64__
int ok;
#else
error fail
#endif
]])],
[main_abi=lp64],
[main_abi=ilp32])
# Float ABIs:
# __riscv_float_abi_double:
# 'float' and 'double' are passed in floating-point registers.
# __riscv_float_abi_single:
# 'float' are passed in floating-point registers.
# __riscv_float_abi_soft:
# No values are passed in floating-point registers.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __riscv_float_abi_double
int ok;
#else
error fail
#endif
]])],
[float_abi=d],
[AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __riscv_float_abi_single
int ok;
#else
error fail
#endif
]])],
[float_abi=f],
[float_abi=''])
])
gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
;;
s390* )
# On s390x, the C compiler may be generating 64-bit (= s390x) code
# or 31-bit (= s390) code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __LP64__ || defined __s390x__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=s390x],
[gl_cv_host_cpu_c_abi=s390])
;;
sparc | sparc64 )
# UltraSPARCs running Linux have `uname -m` = "sparc64", but the
# C compiler still generates 32-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __sparcv9 || defined __arch64__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi=sparc64],
[gl_cv_host_cpu_c_abi=sparc])
;;
*)
gl_cv_host_cpu_c_abi="$host_cpu"
;;
esac
])
dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
AC_SUBST([HOST_CPU])
AC_SUBST([HOST_CPU_C_ABI])
# This was
# AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
# AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
# earlier, but KAI C++ 3.2d doesn't like this.
sed -e 's/-/_/g' >> confdefs.h <<EOF
#ifndef __${HOST_CPU}__
#define __${HOST_CPU}__ 1
#endif
#ifndef __${HOST_CPU_C_ABI}__
#define __${HOST_CPU_C_ABI}__ 1
#endif
EOF
AH_TOP([/* CPU and C ABI indicator */
#ifndef __i386__
#undef __i386__
#endif
#ifndef __x86_64_x32__
#undef __x86_64_x32__
#endif
#ifndef __x86_64__
#undef __x86_64__
#endif
#ifndef __alpha__
#undef __alpha__
#endif
#ifndef __arm__
#undef __arm__
#endif
#ifndef __armhf__
#undef __armhf__
#endif
#ifndef __arm64_ilp32__
#undef __arm64_ilp32__
#endif
#ifndef __arm64__
#undef __arm64__
#endif
#ifndef __hppa__
#undef __hppa__
#endif
#ifndef __hppa64__
#undef __hppa64__
#endif
#ifndef __ia64_ilp32__
#undef __ia64_ilp32__
#endif
#ifndef __ia64__
#undef __ia64__
#endif
#ifndef __m68k__
#undef __m68k__
#endif
#ifndef __mips__
#undef __mips__
#endif
#ifndef __mipsn32__
#undef __mipsn32__
#endif
#ifndef __mips64__
#undef __mips64__
#endif
#ifndef __powerpc__
#undef __powerpc__
#endif
#ifndef __powerpc64__
#undef __powerpc64__
#endif
#ifndef __powerpc64_elfv2__
#undef __powerpc64_elfv2__
#endif
#ifndef __riscv32__
#undef __riscv32__
#endif
#ifndef __riscv64__
#undef __riscv64__
#endif
#ifndef __riscv32_ilp32__
#undef __riscv32_ilp32__
#endif
#ifndef __riscv32_ilp32f__
#undef __riscv32_ilp32f__
#endif
#ifndef __riscv32_ilp32d__
#undef __riscv32_ilp32d__
#endif
#ifndef __riscv64_ilp32__
#undef __riscv64_ilp32__
#endif
#ifndef __riscv64_ilp32f__
#undef __riscv64_ilp32f__
#endif
#ifndef __riscv64_ilp32d__
#undef __riscv64_ilp32d__
#endif
#ifndef __riscv64_lp64__
#undef __riscv64_lp64__
#endif
#ifndef __riscv64_lp64f__
#undef __riscv64_lp64f__
#endif
#ifndef __riscv64_lp64d__
#undef __riscv64_lp64d__
#endif
#ifndef __s390__
#undef __s390__
#endif
#ifndef __s390x__
#undef __s390x__
#endif
#ifndef __sh__
#undef __sh__
#endif
#ifndef __sparc__
#undef __sparc__
#endif
#ifndef __sparc64__
#undef __sparc64__
#endif
])
])
dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
dnl one, or to 'unknown' if unknown.
dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
[if test -n "$gl_cv_host_cpu_c_abi"; then
case "$gl_cv_host_cpu_c_abi" in
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
gl_cv_host_cpu_c_abi_32bit=yes ;;
x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
gl_cv_host_cpu_c_abi_32bit=no ;;
*)
gl_cv_host_cpu_c_abi_32bit=unknown ;;
esac
else
case "$host_cpu" in
# CPUs that only support a 32-bit ABI.
arc \
| bfin \
| cris* \
| csky \
| epiphany \
| ft32 \
| h8300 \
| m68k \
| microblaze | microblazeel \
| nds32 | nds32le | nds32be \
| nios2 | nios2eb | nios2el \
| or1k* \
| or32 \
| sh | sh[1234] | sh[1234]e[lb] \
| tic6x \
| xtensa* )
gl_cv_host_cpu_c_abi_32bit=yes
;;
# CPUs that only support a 64-bit ABI.
changequote(,)dnl
alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
| mmix )
changequote([,])dnl
gl_cv_host_cpu_c_abi_32bit=no
;;
changequote(,)dnl
i[34567]86 )
changequote([,])dnl
gl_cv_host_cpu_c_abi_32bit=yes
;;
x86_64 )
# On x86_64 systems, the C compiler may be generating code in one of
# these ABIs:
# - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
# - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
# with native Windows (mingw, MSVC).
# - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if (defined __x86_64__ || defined __amd64__ \
|| defined _M_X64 || defined _M_AMD64) \
&& !(defined __ILP32__ || defined _ILP32)
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
arm* | aarch64 )
# Assume arm with EABI.
# On arm64 systems, the C compiler may be generating code in one of
# these ABIs:
# - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
# - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
# On hppa, the C compiler may be generating 32-bit code or 64-bit
# code. In the latter case, it defines _LP64 and __LP64__.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifdef __LP64__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
ia64* )
# On ia64 on HP-UX, the C compiler may be generating 64-bit code or
# 32-bit code. In the latter case, it defines _ILP32.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#ifdef _ILP32
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=yes],
[gl_cv_host_cpu_c_abi_32bit=no])
;;
mips* )
# We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
# at 32.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
powerpc* )
# Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
# No need to distinguish them here; the caller may distinguish
# them based on the OS.
# On powerpc64 systems, the C compiler may still be generating
# 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
# be generating 64-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __powerpc64__ || defined _ARCH_PPC64
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
rs6000 )
gl_cv_host_cpu_c_abi_32bit=yes
;;
riscv32 | riscv64 )
# There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
# Size of 'long' and 'void *':
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __LP64__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
s390* )
# On s390x, the C compiler may be generating 64-bit (= s390x) code
# or 31-bit (= s390) code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __LP64__ || defined __s390x__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
sparc | sparc64 )
# UltraSPARCs running Linux have `uname -m` = "sparc64", but the
# C compiler still generates 32-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __sparcv9 || defined __arch64__
int ok;
#else
error fail
#endif
]])],
[gl_cv_host_cpu_c_abi_32bit=no],
[gl_cv_host_cpu_c_abi_32bit=yes])
;;
*)
gl_cv_host_cpu_c_abi_32bit=unknown
;;
esac
fi
])
HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
])

View file

@ -1,5 +1,5 @@
# hostent.m4 serial 2
dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
# hostent.m4 serial 3
dnl Copyright (C) 2008, 2010-2021 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.
@ -8,7 +8,7 @@ AC_DEFUN([gl_HOSTENT],
[
dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
dnl gethostbyaddr() defined?
dnl - On Solaris, they are in libnsl. Ignore libxnet.
dnl - On Solaris < 11.4, they are in libnsl. Ignore libxnet.
dnl - On Haiku, they are in libnetwork.
dnl - On BeOS, they are in libnet.
dnl - On native Windows, they are in ws2_32.dll.

View file

@ -1,5 +1,5 @@
# iconv.m4 serial 21
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2018 Free Software Foundation,
# iconv.m4 serial 24
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -7,6 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_PREREQ([2.64])
dnl Note: AM_ICONV is documented in the GNU gettext manual
dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
dnl Don't make changes that are incompatible with that documentation!
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
@ -86,8 +92,9 @@ AC_DEFUN([AM_ICONV_LINK],
#endif
]],
[[int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
/* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
successful returns. This is even documented in
<https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
@ -225,8 +232,7 @@ AC_DEFUN([AM_ICONV_LINK],
AC_SUBST([LTLIBICONV])
])
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
dnl avoid warnings like
dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
dnl This is tricky because of the way 'aclocal' is implemented:
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
@ -234,54 +240,43 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition.
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings.
m4_define([gl_iconv_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[m4_ifdef([gl_00GNULIB],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[[AC_DEFUN(
[$1], [$2])]])]))
gl_iconv_AC_DEFUN([AM_ICONV],
AC_DEFUN_ONCE([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL([am_cv_proto_iconv], [
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
[gl_cv_iconv_nonconst],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
]],
[[]])],
[am_cv_proto_iconv_arg1=""],
[am_cv_proto_iconv_arg1="const"])
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([
$am_cv_proto_iconv])
]],
[[]])],
[gl_cv_iconv_nonconst=yes],
[gl_cv_iconv_nonconst=no])
])
else
dnl When compiling GNU libiconv on a system that does not have iconv yet,
dnl pick the POSIX compliant declaration without 'const'.
am_cv_proto_iconv_arg1=""
gl_cv_iconv_nonconst=yes
fi
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
if test $gl_cv_iconv_nonconst = yes; then
iconv_arg1=""
else
iconv_arg1="const"
fi
AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
m4_ifdef([gl_ICONV_H_DEFAULTS],
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
if test -n "$am_cv_proto_iconv_arg1"; then
if test $gl_cv_iconv_nonconst != yes; then
ICONV_CONST="const"
fi
])

View file

@ -1,5 +1,5 @@
# iconv_h.m4 serial 8
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# iconv_h.m4 serial 12
dnl Copyright (C) 2007-2021 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.
@ -11,6 +11,14 @@ AC_DEFUN([gl_ICONV_H],
dnl Execute this unconditionally, because ICONV_H may be set by other
dnl modules, after this code is executed.
gl_CHECK_NEXT_HEADERS([iconv.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <iconv.h>
]], [iconv iconv_open])
AC_REQUIRE([AC_C_RESTRICT])
])
dnl Unconditionally enables the replacement of <iconv.h>.
@ -30,6 +38,7 @@ AC_DEFUN([gl_ICONV_MODULE_INDICATOR],
AC_DEFUN([gl_ICONV_H_DEFAULTS],
[
m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV])
dnl Assume proper GNU behavior unless another module says otherwise.
ICONV_CONST=; AC_SUBST([ICONV_CONST])
@ -37,5 +46,12 @@ AC_DEFUN([gl_ICONV_H_DEFAULTS],
REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF])
ICONV_H=''; AC_SUBST([ICONV_H])
m4_ifdef([gl_POSIXCHECK],
[ICONV_H='iconv.h'],
[if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE.
ICONV_H='iconv.h'
fi
])
AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
])

View file

@ -1,5 +1,5 @@
# iconv_open-utf.m4 serial 1
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# iconv_open-utf.m4 serial 4
dnl Copyright (C) 2007-2021 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.
@ -211,16 +211,18 @@ int main ()
[gl_cv_func_iconv_supports_utf=yes],
[gl_cv_func_iconv_supports_utf=no],
[
dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
dnl We know that GNU libiconv, GNU libc, musl libc, and Solaris >= 9 do.
dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"
dnl direction.
gl_cv_func_iconv_supports_utf=no
gl_cv_func_iconv_supports_utf="$gl_cross_guess_normal"
if test $gl_func_iconv_gnu = yes; then
gl_cv_func_iconv_supports_utf=yes
gl_cv_func_iconv_supports_utf="guessing yes"
else
changequote(,)dnl
case "$host_os" in
solaris2.9 | solaris2.1[0-9]) gl_cv_func_iconv_supports_utf=yes ;;
*-musl*) gl_cv_func_iconv_supports_utf="guessing yes" ;;
solaris2.9 | solaris2.1[0-9])
gl_cv_func_iconv_supports_utf="guessing yes" ;;
esac
changequote([,])dnl
fi

View file

@ -1,5 +1,5 @@
# iconv_open.m4 serial 14
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# iconv_open.m4 serial 16
dnl Copyright (C) 2007-2021 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.
@ -23,11 +23,12 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
if test $gl_func_iconv_gnu = no; then
iconv_flavor=
case "$host_os" in
aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
openedition*) iconv_flavor=ICONV_FLAVOR_ZOS ;;
esac
if test -n "$iconv_flavor"; then
AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
@ -38,13 +39,16 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
fi
m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
gl_FUNC_ICONV_OPEN_UTF_SUPPORT
if test $gl_cv_func_iconv_supports_utf = no; then
REPLACE_ICONV_UTF=1
AC_DEFINE([REPLACE_ICONV_UTF], [1],
[Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
REPLACE_ICONV=1
gl_REPLACE_ICONV_OPEN
fi
case "$gl_cv_func_iconv_supports_utf" in
*yes) ;;
*)
REPLACE_ICONV_UTF=1
AC_DEFINE([REPLACE_ICONV_UTF], [1],
[Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
REPLACE_ICONV=1
gl_REPLACE_ICONV_OPEN
;;
esac
])
fi
])

View file

@ -1,12 +1,13 @@
# include_next.m4 serial 23
dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
# include_next.m4 serial 26
dnl Copyright (C) 2006-2021 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.
dnl From Paul Eggert and Derek Price.
dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER,
dnl and PRAGMA_COLUMNS.
dnl
dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
dnl 'include' otherwise.
@ -105,19 +106,21 @@ dnl We intentionally avoid using AC_LANG_SOURCE here.
AC_SUBST([INCLUDE_NEXT])
AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
AC_SUBST([PRAGMA_SYSTEM_HEADER])
AC_CACHE_CHECK([whether system header files limit the line length],
[gl_cv_pragma_columns],
[dnl HP NonStop systems, which define __TANDEM, have this misfeature.
AC_EGREP_CPP([choke me],
dnl HP NonStop systems, which define __TANDEM, limit the line length
dnl after including some system header files.
AC_CACHE_CHECK([whether source code line length is unlimited],
[gl_cv_source_line_length_unlimited],
[AC_EGREP_CPP([choke me],
[
#ifdef __TANDEM
choke me
#endif
],
[gl_cv_pragma_columns=yes],
[gl_cv_pragma_columns=no])
[gl_cv_source_line_length_unlimited=no],
[gl_cv_source_line_length_unlimited=yes])
])
if test $gl_cv_pragma_columns = yes; then
if test $gl_cv_source_line_length_unlimited = no; then
PRAGMA_COLUMNS="#pragma COLUMNS 10000"
else
PRAGMA_COLUMNS=
@ -175,42 +178,40 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
[AC_CHECK_HEADERS_ONCE([$1])
])
dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
dnl until we can assume autoconf 2.64 or newer.
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
if test $gl_cv_have_include_next = yes; then
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
else
AC_CACHE_CHECK(
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
m4_defn([gl_next_header]),
[gl_next_header],
[m4_if([$2], [check],
[AS_VAR_PUSHDEF([gl_header_exists],
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))
if test AS_VAR_GET(gl_header_exists) = yes; then
if test AS_VAR_GET([gl_header_exists]) = yes; then
AS_VAR_POPDEF([gl_header_exists])
])
gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
AS_VAR_SET(gl_next_header, ['"'$gl_header'"'])
AS_VAR_SET([gl_next_header], ['"'$gl_header'"'])
m4_if([$2], [check],
[else
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
fi
])
])
fi
AC_SUBST(
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
[AS_VAR_GET(gl_next_header)])
[AS_VAR_GET([gl_next_header])])
if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
gl_next_as_first_directive='<'gl_HEADER_NAME'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
fi
AC_SUBST(
AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),

View file

@ -1,5 +1,5 @@
# inet_ntop.m4 serial 19
dnl Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc.
# inet_ntop.m4 serial 21
dnl Copyright (C) 2005-2006, 2008-2021 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.
@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
dnl Most platforms that provide inet_ntop define it in libc.
dnl Solaris 8..10 provide inet_ntop in libnsl instead.
dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
dnl Haiku provides it in -lnetwork.
dnl Native Windows provides it in -lws2_32 instead, with a declaration in
dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
@ -23,19 +24,20 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
INET_NTOP_LIB=
gl_PREREQ_SYS_H_WINSOCK2
if test $HAVE_WINSOCK2_H = 1; then
dnl It needs to be overridden, because the stdcall calling convention
dnl is not compliant with POSIX. Set REPLACE_INET_NTOP in order to avoid
dnl a name conflict at the linker level, even though the header file
dnl <ws2tcpip.h> declares inet_ntop only if _WIN32_WINNT >= 0x0600.
REPLACE_INET_NTOP=1
AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
if test $ac_cv_have_decl_inet_ntop = yes; then
dnl It needs to be overridden, because the stdcall calling convention
dnl is not compliant with POSIX.
REPLACE_INET_NTOP=1
INET_NTOP_LIB="-lws2_32"
else
HAVE_DECL_INET_NTOP=0
HAVE_INET_NTOP=0
fi
else
gl_save_LIBS=$LIBS
AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [],
[AC_CHECK_FUNCS([inet_ntop])
if test $ac_cv_func_inet_ntop = no; then
HAVE_INET_NTOP=0

View file

@ -1,5 +1,5 @@
# inet_pton.m4 serial 17
dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
# inet_pton.m4 serial 19
dnl Copyright (C) 2006, 2008-2021 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.
@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_INET_PTON],
dnl Most platforms that provide inet_pton define it in libc.
dnl Solaris 8..10 provide inet_pton in libnsl instead.
dnl Solaris 2.6..7 provide inet_pton in libresolv instead.
dnl Haiku provides it in -lnetwork.
dnl Native Windows provides it in -lws2_32 instead, with a declaration in
dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
@ -23,19 +24,20 @@ AC_DEFUN([gl_FUNC_INET_PTON],
INET_PTON_LIB=
gl_PREREQ_SYS_H_WINSOCK2
if test $HAVE_WINSOCK2_H = 1; then
dnl It needs to be overridden, because the stdcall calling convention
dnl is not compliant with POSIX. Set REPLACE_INET_PTON in order to avoid
dnl a name conflict at the linker level, even though the header file
dnl <ws2tcpip.h> declares inet_pton only if _WIN32_WINNT >= 0x0600.
REPLACE_INET_PTON=1
AC_CHECK_DECLS([inet_pton],,, [[#include <ws2tcpip.h>]])
if test $ac_cv_have_decl_inet_pton = yes; then
dnl It needs to be overridden, because the stdcall calling convention
dnl is not compliant with POSIX.
REPLACE_INET_PTON=1
INET_PTON_LIB="-lws2_32"
else
HAVE_DECL_INET_PTON=0
HAVE_INET_PTON=0
fi
else
gl_save_LIBS=$LIBS
AC_SEARCH_LIBS([inet_pton], [nsl resolv], [],
AC_SEARCH_LIBS([inet_pton], [nsl resolv network], [],
[AC_CHECK_FUNCS([inet_pton])
if test $ac_cv_func_inet_pton = no; then
HAVE_INET_PTON=0

View file

@ -1,5 +1,5 @@
# intmax_t.m4 serial 8
dnl Copyright (C) 1997-2004, 2006-2007, 2009-2017 Free Software Foundation,
# intmax_t.m4 serial 9
dnl Copyright (C) 1997-2004, 2006-2007, 2009-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -19,11 +19,7 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
test $ac_cv_type_long_long_int = yes \
&& ac_type='long long' \
|| ac_type='long'
AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
AC_DEFINE_UNQUOTED([intmax_t], [long long],
[Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
else
AC_DEFINE([HAVE_INTMAX_T], [1],
@ -57,11 +53,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
AC_DEFINE([HAVE_INTMAX_T], [1],
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
else
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
test $ac_cv_type_long_long_int = yes \
&& ac_type='long long' \
|| ac_type='long'
AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
AC_DEFINE_UNQUOTED([intmax_t], [long long],
[Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
fi
])

165
m4/inttypes.m4 Normal file
View file

@ -0,0 +1,165 @@
# inttypes.m4 serial 32
dnl Copyright (C) 2006-2021 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.
dnl From Derek Price, Bruno Haible.
dnl Test whether <inttypes.h> is supported or must be substituted.
AC_DEFUN([gl_INTTYPES_H],
[
AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
gl_INTTYPES_PRI_SCN
])
AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
[
AC_REQUIRE([gl_STDINT_H])
AC_CHECK_HEADERS_ONCE([inttypes.h])
dnl Override <inttypes.h> always, so that the portability warnings work.
AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([inttypes.h])
AC_REQUIRE([gl_MULTIARCH])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
]], [imaxabs imaxdiv strtoimax strtoumax])
AC_REQUIRE([AC_C_RESTRICT])
])
# Ensure that the PRI* and SCN* macros are defined appropriately.
AC_DEFUN([gl_INTTYPES_PRI_SCN],
[
PRIPTR_PREFIX=
if test -n "$STDINT_H"; then
dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
dnl 'long long', depending on _WIN64.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#ifdef _WIN64
LLP64
#endif
]])
],
[PRIPTR_PREFIX='"l"'],
[PRIPTR_PREFIX='"ll"'])
else
dnl Using the system's <stdint.h>.
for glpfx in '' l ll I64; do
case $glpfx in
'') gltype1='int';;
l) gltype1='long int';;
ll) gltype1='long long int';;
I64) gltype1='__int64';;
esac
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <stdint.h>
extern intptr_t foo;
extern $gltype1 foo;]])],
[PRIPTR_PREFIX='"'$glpfx'"'])
test -n "$PRIPTR_PREFIX" && break
done
fi
AC_SUBST([PRIPTR_PREFIX])
gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
[INT32_MAX_LT_INTMAX_MAX],
[defined INT32_MAX && defined INTMAX_MAX],
[INT32_MAX < INTMAX_MAX],
[sizeof (int) < sizeof (long long int)])
if test $APPLE_UNIVERSAL_BUILD = 0; then
gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
[INT64_MAX_EQ_LONG_MAX],
[defined INT64_MAX],
[INT64_MAX == LONG_MAX],
[sizeof (long long int) == sizeof (long int)])
else
INT64_MAX_EQ_LONG_MAX=-1
fi
gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
[UINT32_MAX_LT_UINTMAX_MAX],
[defined UINT32_MAX && defined UINTMAX_MAX],
[UINT32_MAX < UINTMAX_MAX],
[sizeof (unsigned int) < sizeof (unsigned long long int)])
if test $APPLE_UNIVERSAL_BUILD = 0; then
gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
[UINT64_MAX_EQ_ULONG_MAX],
[defined UINT64_MAX],
[UINT64_MAX == ULONG_MAX],
[sizeof (unsigned long long int) == sizeof (unsigned long int)])
else
UINT64_MAX_EQ_ULONG_MAX=-1
fi
])
# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
# If $2 is true, the condition is $3; otherwise if long long int is supported
# approximate the condition with $4; otherwise, assume the condition is false.
# The condition should work on all C99 platforms; the approximations should be
# good enough to work on all practical pre-C99 platforms.
# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
[
AC_CACHE_CHECK([whether $3],
[gl_cv_test_$1],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[/* Work also in C++ mode. */
#define __STDC_LIMIT_MACROS 1
/* Work if build is not clean. */
#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
#include <limits.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
#if $2
#define CONDITION ($3)
#else
#define CONDITION ($4)
#endif
int test[CONDITION ? 1 : -1];]])],
[gl_cv_test_$1=yes],
[gl_cv_test_$1=no])])
if test $gl_cv_test_$1 = yes; then
$1=1;
else
$1=0;
fi
AC_SUBST([$1])
])
AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
])
AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
[
GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS])
GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV])
GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX])
GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS])
HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
])

View file

@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
dnl Copyright (C) 1997-2004, 2006, 2008-2017 Free Software Foundation, Inc.
dnl Copyright (C) 1997-2004, 2006, 2008-2021 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.

View file

@ -1,5 +1,5 @@
# isfinite.m4 serial 15
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# isfinite.m4 serial 17
dnl Copyright (C) 2007-2021 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,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ISFINITE],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <math.h> to declare isfinite.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_DECLS([isfinite], , , [[#include <math.h>]])
@ -25,8 +26,13 @@ AC_DEFUN([gl_ISFINITE],
dnl isfinite(long double) also does not work in this situation.
fi
fi
if test "$ac_cv_have_decl_isfinite" != yes ||
test "$ISFINITE_LIBM" = missing; then
dnl On Solaris 10, with CC in C++ mode, isfinite is not available although
dnl is with cc in C mode. This cannot be worked around by defining
dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
if test "$ac_cv_have_decl_isfinite" != yes \
|| test "$ISFINITE_LIBM" = missing \
|| { case "$host_os" in solaris*) true;; *) false;; esac; }; then
REPLACE_ISFINITE=1
dnl No libraries are needed to link lib/isfinite.c.
ISFINITE_LIBM=
@ -143,7 +149,14 @@ int main ()
#endif
return result;
}]])], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no],
[gl_cv_func_isfinitel_works="guessing yes"])
}]])],
[gl_cv_func_isfinitel_works=yes],
[gl_cv_func_isfinitel_works=no],
[case "$host_os" in
# Guess no on native Windows.
mingw*) gl_cv_func_isfinitel_works="guessing no" ;;
*) gl_cv_func_isfinitel_works="guessing yes" ;;
esac
])
])
])

View file

@ -1,5 +1,5 @@
# isinf.m4 serial 11
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# isinf.m4 serial 13
dnl Copyright (C) 2007-2021 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,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ISINF],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <math.h> to declare isinf.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_DECLS([isinf], , ,
@ -26,8 +27,13 @@ AC_DEFUN([gl_ISINF],
esac
fi
fi
if test "$ac_cv_have_decl_isinf" != yes ||
test "$ISINF_LIBM" = missing; then
dnl On Solaris 10, with CC in C++ mode, isinf is not available although
dnl is with cc in C mode. This cannot be worked around by defining
dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
if test "$ac_cv_have_decl_isinf" != yes \
|| test "$ISINF_LIBM" = missing \
|| { case "$host_os" in solaris*) true;; *) false;; esac; }; then
REPLACE_ISINF=1
dnl No libraries are needed to link lib/isinf.c.
ISINF_LIBM=
@ -150,7 +156,23 @@ int main ()
#endif
return result;
}]])], [gl_cv_func_isinfl_works=yes], [gl_cv_func_isinfl_works=no],
[gl_cv_func_isinfl_works="guessing yes"])
}]])],
[gl_cv_func_isinfl_works=yes],
[gl_cv_func_isinfl_works=no],
[case "$host_os" in
mingw*) # Guess yes on mingw, no on MSVC.
AC_EGREP_CPP([Known], [
#ifdef __MINGW32__
Known
#endif
],
[gl_cv_func_isinfl_works="guessing yes"],
[gl_cv_func_isinfl_works="guessing no"])
;;
*)
gl_cv_func_isinfl_works="guessing yes"
;;
esac
])
])
])

View file

@ -1,5 +1,5 @@
# isnan.m4 serial 5
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2007-2021 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.

View file

@ -1,5 +1,5 @@
# isnand.m4 serial 11
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# isnand.m4 serial 12
dnl Copyright (C) 2007-2021 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.
@ -58,7 +58,7 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnand
# define isnand(x) __builtin_isnan ((double)(x))
#elif defined isnan
@ -81,7 +81,7 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnand
# define isnand(x) __builtin_isnan ((double)(x))
#else

View file

@ -1,5 +1,5 @@
# isnanf.m4 serial 14
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# isnanf.m4 serial 18
dnl Copyright (C) 2007-2021 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.
@ -74,9 +74,9 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanf
# define isnanf(x) __builtin_isnanf ((float)(x))
# define isnanf(x) __builtin_isnan ((float)(x))
#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@ -99,9 +99,9 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanf
# define isnanf(x) __builtin_isnanf ((float)(x))
# define isnanf(x) __builtin_isnan ((float)(x))
#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@ -127,9 +127,9 @@ AC_DEFUN([gl_ISNANF_WORKS],
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanf
# define isnanf(x) __builtin_isnanf ((float)(x))
# define isnanf(x) __builtin_isnan ((float)(x))
#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@ -169,7 +169,7 @@ int main()
m.value = NaN ();
/* Set the bits below the exponent to 01111...111. */
m.word[0] &= -1U << FLT_EXPBIT0_BIT;
m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1;
if (!isnanf (m.value))
result |= 4;
}
@ -180,8 +180,17 @@ int main()
[gl_cv_func_isnanf_works=yes],
[gl_cv_func_isnanf_works=no],
[case "$host_os" in
irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
*) gl_cv_func_isnanf_works="guessing yes";;
irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
mingw*) # Guess yes on mingw, no on MSVC.
AC_EGREP_CPP([Known], [
#ifdef __MINGW32__
Known
#endif
],
[gl_cv_func_isnanf_works="guessing yes"],
[gl_cv_func_isnanf_works="guessing no"])
;;
*) gl_cv_func_isnanf_works="guessing yes" ;;
esac
])
])

View file

@ -1,5 +1,5 @@
# isnanl.m4 serial 19
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# isnanl.m4 serial 22
dnl Copyright (C) 2007-2021 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.
@ -68,9 +68,9 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
# define isnanl(x) __builtin_isnan ((long double)(x))
#elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@ -93,9 +93,9 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
# define isnanl(x) __builtin_isnan ((long double)(x))
#elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@ -123,9 +123,9 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
#include <float.h>
#include <limits.h>
#include <math.h>
#if __GNUC__ >= 4
#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
# define isnanl(x) __builtin_isnan ((long double)(x))
#elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@ -231,6 +231,18 @@ int main ()
}]])],
[gl_cv_func_isnanl_works=yes],
[gl_cv_func_isnanl_works=no],
[gl_cv_func_isnanl_works="guessing yes"])
[case "$host_os" in
mingw*) # Guess yes on mingw, no on MSVC.
AC_EGREP_CPP([Known], [
#ifdef __MINGW32__
Known
#endif
],
[gl_cv_func_isnanl_works="guessing yes"],
[gl_cv_func_isnanl_works="guessing no"])
;;
*) gl_cv_func_isnanl_works="guessing yes" ;;
esac
])
])
])

View file

@ -1,5 +1,5 @@
# langinfo_h.m4 serial 7
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
# langinfo_h.m4 serial 9
dnl Copyright (C) 2009-2021 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.
@ -17,13 +17,17 @@ AC_DEFUN([gl_LANGINFO_H],
dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
HAVE_LANGINFO_CODESET=0
HAVE_LANGINFO_T_FMT_AMPM=0
HAVE_LANGINFO_ALTMON=0
HAVE_LANGINFO_ERA=0
HAVE_LANGINFO_YESEXPR=0
AC_CHECK_HEADERS_ONCE([langinfo.h])
if test $ac_cv_header_langinfo_h = yes; then
HAVE_LANGINFO_H=1
dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
dnl Determine what <langinfo.h> defines.
dnl CODESET is missing on OpenBSD 3.8.
dnl ERA etc. are missing on OpenBSD 6.7.
dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
dnl ALTMON_* are missing on glibc 2.26 and many other systems.
AC_CACHE_CHECK([whether langinfo.h defines CODESET],
[gl_cv_header_langinfo_codeset],
[AC_COMPILE_IFELSE(
@ -48,6 +52,18 @@ int a = T_FMT_AMPM;
if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
HAVE_LANGINFO_T_FMT_AMPM=1
fi
AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
[gl_cv_header_langinfo_altmon],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <langinfo.h>
int a = ALTMON_1;
]])],
[gl_cv_header_langinfo_altmon=yes],
[gl_cv_header_langinfo_altmon=no])
])
if test $gl_cv_header_langinfo_altmon = yes; then
HAVE_LANGINFO_ALTMON=1
fi
AC_CACHE_CHECK([whether langinfo.h defines ERA],
[gl_cv_header_langinfo_era],
[AC_COMPILE_IFELSE(
@ -78,6 +94,7 @@ int a = YESEXPR;
AC_SUBST([HAVE_LANGINFO_H])
AC_SUBST([HAVE_LANGINFO_CODESET])
AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
AC_SUBST([HAVE_LANGINFO_ALTMON])
AC_SUBST([HAVE_LANGINFO_ERA])
AC_SUBST([HAVE_LANGINFO_YESEXPR])

View file

@ -1,24 +1,41 @@
# Enable large files on systems where this is not the default.
# Enable support for files on Linux file systems with 64-bit inode numbers.
# Copyright 1992-1996, 1998-2017 Free Software Foundation, Inc.
# Copyright 1992-1996, 1998-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
# and ftello in C++ mode as well.
AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_FUNC_FSEEKO
case "$host_os" in
hpux*)
AC_DEFINE([_LARGEFILE_SOURCE], [1],
[Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
;;
esac
])
# The following implementation works around a problem in autoconf <= 2.69;
# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
# or configures them incorrectly in some cases.
m4_version_prereq([2.70], [] ,[
m4_version_prereq([2.70], [], [
# _AC_SYS_LARGEFILE_TEST_INCLUDES
# -------------------------------
m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
[@%:@include <sys/types.h>
[#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1]];[]dnl
@ -37,7 +54,7 @@ m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
[AC_LANG_PROGRAM([$5], [$6])],
[$3=no; break])
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
[AC_LANG_PROGRAM([@%:@define $1 $2
[AC_LANG_PROGRAM([#define $1 $2
$5], [$6])],
[$3=$2; break])
$3=unknown
@ -56,7 +73,10 @@ rm -rf conftest*[]dnl
# By default, many hosts won't let programs access large files;
# one must use special compiler options to get large-file access to work.
# For more details about this brain damage please see:
# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
# http://www.unix.org/version2/whatsnew/lfs20mar.html
# Additionally, on Linux file systems with 64-bit inodes a file that happens
# to have a 64-bit inode number cannot be accessed by 32-bit applications on
# Linux x86/x86_64. This can occur with file systems such as XFS and NFS.
AC_DEFUN([AC_SYS_LARGEFILE],
[AC_ARG_ENABLE(largefile,
[ --disable-largefile omit support for large files])
@ -93,9 +113,6 @@ if test "$enable_largefile" != no; then
[Define for large files, on AIX-style hosts.],
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
fi
AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
[Enable large inode numbers on Mac OS X 10.5.])
fi
])# AC_SYS_LARGEFILE
])# m4_version_prereq 2.70
@ -126,9 +143,24 @@ AC_DEFUN([gl_LARGEFILE],
else
WINDOWS_64_BIT_OFF_T=0
fi
dnl But all native Windows platforms (including mingw64) have a 32-bit
dnl st_size member in 'struct stat'.
WINDOWS_64_BIT_ST_SIZE=1
dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat'
dnl to 'struct _stat32i64' or 'struct _stat64' (depending on
dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member.
AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/types.h>
struct stat buf;
int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
]],
[[]])],
[gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no])
])
if test $gl_cv_member_st_size_64 = no; then
WINDOWS_64_BIT_ST_SIZE=1
else
WINDOWS_64_BIT_ST_SIZE=0
fi
;;
*)
dnl Nothing to do on gnulib's side.

View file

@ -1,5 +1,5 @@
# ld-version-script.m4 serial 4
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
# ld-version-script.m4 serial 5
dnl Copyright (C) 2008-2021 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.
@ -27,7 +27,7 @@ AC_DEFUN([gl_LD_VERSION_SCRIPT],
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
echo foo >conftest.map
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[],
[cat > conftest.map <<EOF
VERS_1 {
@ -38,7 +38,7 @@ VERS_2 {
global: sym;
} VERS_1;
EOF
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_sys_ld_version_script=yes])])
rm -f conftest.map
LDFLAGS=$save_LDFLAGS])

View file

@ -1,5 +1,5 @@
# ldexp.m4 serial 1
dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2010-2021 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.

View file

@ -1,5 +1,5 @@
# lib-ld.m4 serial 6
dnl Copyright (C) 1996-2003, 2009-2017 Free Software Foundation, Inc.
# lib-ld.m4 serial 9
dnl Copyright (C) 1996-2003, 2009-2021 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.
@ -47,73 +47,122 @@ if test "${PATH_SEPARATOR+set}" != set; then
}
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
if test -n "$LD"; then
AC_MSG_CHECKING([for ld])
elif test "$GCC" = yes; then
AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL([acl_cv_path_LD],
[if test -z "$LD"; then
acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$acl_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
;;
*)
test "$with_gnu_ld" != yes && break
;;
if test -n "$LD"; then
# Let the user override the test with a path.
:
else
AC_CACHE_VAL([acl_cv_path_LD],
[
acl_cv_path_LD= # Final result of this test
ac_prog=ld # Program to search in $PATH
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $acl_output in
# Accept absolute paths.
[[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the pathname of ld
acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
done
# Got the pathname. No search in PATH is needed.
acl_cv_path_LD="$acl_output"
ac_prog=
;;
"")
# If it fails, then pretend we aren't using GCC.
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
fi
done
IFS="$acl_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$acl_cv_path_LD"
if test -n "$ac_prog"; then
# Search for $ac_prog in $PATH.
acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$acl_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
;;
*)
test "$with_gnu_ld" != yes && break
;;
esac
fi
done
IFS="$acl_save_ifs"
fi
case $host in
*-*-aix*)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __powerpc64__ || defined _ARCH_PPC64
int ok;
#else
error fail
#endif
]])],
[# The compiler produces 64-bit code. Add option '-b64' so that the
# linker groks 64-bit object files.
case "$acl_cv_path_LD " in
*" -b64 "*) ;;
*) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
esac
], [])
;;
sparc64-*-netbsd*)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[#if defined __sparcv9 || defined __arch64__
int ok;
#else
error fail
#endif
]])],
[],
[# The compiler produces 32-bit code. Add option '-m elf32_sparc'
# so that the linker groks 32-bit object files.
case "$acl_cv_path_LD " in
*" -m elf32_sparc "*) ;;
*) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
esac
])
;;
esac
])
LD="$acl_cv_path_LD"
fi
if test -n "$LD"; then
AC_MSG_RESULT([$LD])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([no acceptable ld found in \$PATH])
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])

View file

@ -1,12 +1,12 @@
# lib-link.m4 serial 26 (gettext-0.18.2)
dnl Copyright (C) 2001-2017 Free Software Foundation, Inc.
# lib-link.m4 serial 32
dnl Copyright (C) 2001-2021 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.
dnl From Bruno Haible.
AC_PREREQ([2.54])
AC_PREREQ([2.61])
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
@ -124,8 +124,8 @@ dnl acl_hardcode_direct,
dnl acl_hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
dnl Complain if config.rpath is missing.
AC_REQUIRE_AUX_FILE([config.rpath])
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
@ -187,17 +187,17 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
dnl Autoconf >= 2.61 supports dots in --with options.
pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
])
AC_ARG_WITH(P_A_C_K[-prefix],
[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
--without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
AC_ARG_WITH(PACK[-prefix],
[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
--without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@ -206,17 +206,23 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
if test "$acl_libdirstem2" != "$acl_libdirstem" \
&& ! test -d "$withval/$acl_libdirstem"; then
additional_libdir="$withval/$acl_libdirstem2"
fi
additional_libdir2="$withval/$acl_libdirstem2"
additional_libdir3="$withval/$acl_libdirstem3"
fi
fi
])
if test "X$additional_libdir2" = "X$additional_libdir"; then
additional_libdir2=
fi
if test "X$additional_libdir3" = "X$additional_libdir"; then
additional_libdir3=
fi
dnl Search the library and its dependencies in $additional_libdir and
dnl $LDFLAGS. Using breadth-first-seach.
LIB[]NAME=
@ -272,58 +278,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
shrext=
fi
if test $use_additional = yes; then
dir="$additional_libdir"
dnl The same code as in the loop below:
dnl First look for a shared library.
if test -n "$acl_shlibext"; then
if test -f "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
ver=`(cd "$dir" && \
for f in "$libname$shrext".*; do echo "$f"; done \
| sed -e "s,^$libname$shrext\\\\.,," \
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
| sed 1q ) 2>/dev/null`
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
found_dir="$dir"
found_so="$dir/$libname$shrext.$ver"
fi
else
eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
if test -f "$dir/$f"; then
found_dir="$dir"
found_so="$dir/$f"
break
fi
done
fi
fi
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
if test -f "$dir/$libname.$acl_libext"; then
found_dir="$dir"
found_a="$dir/$libname.$acl_libext"
fi
fi
if test "X$found_dir" != "X"; then
if test -f "$dir/$libname.la"; then
found_la="$dir/$libname.la"
fi
fi
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
case "$x" in
-L*)
dir=`echo "X$x" | sed -e 's/^X-L//'`
for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
if test "X$found_dir" = "X"; then
eval dir=\$$additional_libdir_variable
if test -n "$dir"; then
dnl The same code as in the loop below:
dnl First look for a shared library.
if test -n "$acl_shlibext"; then
if test -f "$dir/$libname$shrext"; then
if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
@ -333,14 +295,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
| sed -e "s,^$libname$shrext\\\\.,," \
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
| sed 1q ) 2>/dev/null`
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
found_dir="$dir"
found_so="$dir/$libname$shrext.$ver"
fi
else
eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
if test -f "$dir/$f"; then
if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
found_dir="$dir"
found_so="$dir/$f"
break
@ -351,7 +313,57 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
if test -f "$dir/$libname.$acl_libext"; then
if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
found_dir="$dir"
found_a="$dir/$libname.$acl_libext"
fi
fi
if test "X$found_dir" != "X"; then
if test -f "$dir/$libname.la"; then
found_la="$dir/$libname.la"
fi
fi
fi
fi
done
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
case "$x" in
-L*)
dir=`echo "X$x" | sed -e 's/^X-L//'`
dnl First look for a shared library.
if test -n "$acl_shlibext"; then
if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
ver=`(cd "$dir" && \
for f in "$libname$shrext".*; do echo "$f"; done \
| sed -e "s,^$libname$shrext\\\\.,," \
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
| sed 1q ) 2>/dev/null`
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
found_dir="$dir"
found_so="$dir/$libname$shrext.$ver"
fi
else
eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
found_dir="$dir"
found_so="$dir/$f"
break
fi
done
fi
fi
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
found_dir="$dir"
found_a="$dir/$libname.$acl_libext"
fi
@ -377,7 +389,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl standard /usr/lib.
if test "$enable_rpath" = no \
|| test "X$found_dir" = "X/usr/$acl_libdirstem" \
|| test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
|| test "X$found_dir" = "X/usr/$acl_libdirstem2" \
|| test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@ -477,6 +490,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
fi
additional_includedir="$basedir/include"
;;
*/$acl_libdirstem3 | */$acl_libdirstem3/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
if test "$name" = '$1'; then
LIB[]NAME[]_PREFIX="$basedir"
fi
additional_includedir="$basedir/include"
;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
@ -527,19 +547,21 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
for dep in $dependency_libs; do
case "$dep" in
-L*)
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
&& test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
&& test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
&& test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
haveit=
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
|| test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
|| test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
|| test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@ -550,29 +572,29 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
if test "X$x" = "X-L$dependency_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LIBNAME.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
if test -d "$dependency_libdir"; then
dnl Really add $dependency_libdir to $LIBNAME.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
fi
fi
haveit=
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
if test "X$x" = "X-L$dependency_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LTLIBNAME.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
if test -d "$dependency_libdir"; then
dnl Really add $dependency_libdir to $LTLIBNAME.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
fi
fi
fi
@ -609,7 +631,20 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
;;
-l*)
dnl Handle this in the next round.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
dnl But on GNU systems, ignore -lc options, because
dnl - linking with libc is the default anyway,
dnl - linking with libc.a may produce an error
dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie"
dnl or may produce an executable that always crashes, see
dnl <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.
dep=`echo "X$dep" | sed -e 's/^X-l//'`
if test "X$dep" != Xc \
|| case $host_os in
linux* | gnu* | k*bsd*-gnu) false ;;
*) true ;;
esac; then
names_next_round="$names_next_round $dep"
fi
;;
*.la)
dnl Handle this in the next round. Throw away the .la's
@ -670,7 +705,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
popdef([P_A_C_K])
popdef([PACKLIBS])
popdef([PACKUP])
popdef([PACK])
@ -721,7 +755,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
dir="$next"
dnl No need to hardcode the standard /usr/lib.
if test "X$dir" != "X/usr/$acl_libdirstem" \
&& test "X$dir" != "X/usr/$acl_libdirstem2"; then
&& test "X$dir" != "X/usr/$acl_libdirstem2" \
&& test "X$dir" != "X/usr/$acl_libdirstem3"; then
rpathdirs="$rpathdirs $dir"
fi
next=
@ -731,7 +766,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
dnl No need to hardcode the standard /usr/lib.
if test "X$dir" != "X/usr/$acl_libdirstem" \
&& test "X$dir" != "X/usr/$acl_libdirstem2"; then
&& test "X$dir" != "X/usr/$acl_libdirstem2" \
&& test "X$dir" != "X/usr/$acl_libdirstem3"; then
rpathdirs="$rpathdirs $dir"
fi
next= ;;

View file

@ -1,18 +1,11 @@
# lib-prefix.m4 serial 7 (gettext-0.18)
dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc.
# lib-prefix.m4 serial 19
dnl Copyright (C) 2001-2005, 2008-2021 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.
dnl From Bruno Haible.
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
@ -32,9 +25,9 @@ AC_DEFUN([AC_LIB_PREFIX],
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
AC_ARG_WITH([lib-prefix],
[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@ -154,71 +147,177 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
])
dnl AC_LIB_PREPARE_MULTILIB creates
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
dnl "lib" or "lib64" or "lib/64",
dnl - a variable acl_libdirstem2, as a secondary possible value for
dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
dnl "lib/amd64".
dnl - a function acl_is_expected_elfclass, that tests whether standard input
dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
[
dnl There is no formal standard regarding lib and lib64.
dnl On glibc systems, the current practice is that on a system supporting
dnl There is no formal standard regarding lib, lib32, and lib64.
dnl On most glibc systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
dnl the compiler's default mode by looking at the compiler's library search
dnl path. If at least one of its elements ends in /lib64 or points to a
dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
dnl Otherwise we use the default, namely "lib".
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
dnl We determine the compiler's default mode by looking at the compiler's
dnl library search path. If at least one of its elements ends in /lib64 or
dnl points to a directory whose absolute pathname ends in /lib64, we use that
dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
dnl namely "lib".
dnl On Solaris systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
AC_REQUIRE([AC_CANONICAL_HOST])
acl_libdirstem=lib
acl_libdirstem2=
case "$host_os" in
solaris*)
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
dnl symlink is missing, so we set acl_libdirstem2 too.
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
[AC_EGREP_CPP([sixtyfour bits], [
#ifdef _LP64
sixtyfour bits
#endif
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
])
if test $gl_cv_solaris_64bit = yes; then
acl_libdirstem=lib/64
case "$host_cpu" in
sparc*) acl_libdirstem2=lib/sparcv9 ;;
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
esac
fi
;;
*)
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
if test -n "$searchpath"; then
acl_save_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
if test -d "$searchdir"; then
case "$searchdir" in
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
*/../ | */.. )
# Better ignore directories of this form. They are misleading.
;;
*) searchdir=`cd "$searchdir" && pwd`
case "$searchdir" in
*/lib64 ) acl_libdirstem=lib64 ;;
esac ;;
esac
fi
done
IFS="$acl_save_IFS"
fi
;;
esac
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
[AC_EGREP_CPP([Extensible Linking Format],
[#ifdef __ELF__
Extensible Linking Format
#endif
],
[gl_cv_elf=yes],
[gl_cv_elf=no])
])
if test $gl_cv_elf = yes; then
# Extract the ELF class of a file (5th byte) in decimal.
# Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
if od -A x < /dev/null >/dev/null 2>/dev/null; then
# Use POSIX od.
func_elfclass ()
{
od -A n -t d1 -j 4 -N 1
}
else
# Use BSD hexdump.
func_elfclass ()
{
dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
echo
}
fi
# Use 'expr', not 'test', to compare the values of func_elfclass, because on
# Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
# not 1 or 2.
changequote(,)dnl
case $HOST_CPU_C_ABI_32BIT in
yes)
# 32-bit ABI.
acl_is_expected_elfclass ()
{
expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null
}
;;
no)
# 64-bit ABI.
acl_is_expected_elfclass ()
{
expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null
}
;;
*)
# Unknown.
acl_is_expected_elfclass ()
{
:
}
;;
esac
changequote([,])dnl
else
acl_is_expected_elfclass ()
{
:
}
fi
dnl Allow the user to override the result by setting acl_cv_libdirstems.
AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
[acl_cv_libdirstems],
[dnl Try 'lib' first, because that's the default for libdir in GNU, see
dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
acl_libdirstem=lib
acl_libdirstem2=
acl_libdirstem3=
case "$host_os" in
solaris*)
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
dnl symlink is missing, so we set acl_libdirstem2 too.
if test $HOST_CPU_C_ABI_32BIT = no; then
acl_libdirstem2=lib/64
case "$host_cpu" in
sparc*) acl_libdirstem3=lib/sparcv9 ;;
i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
esac
fi
;;
*)
dnl If $CC generates code for a 32-bit ABI, the libraries are
dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
dnl Find the compiler's search path. However, non-system compilers
dnl sometimes have odd library search paths. But we can't simply invoke
dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
| sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
if test $HOST_CPU_C_ABI_32BIT != no; then
# 32-bit or unknown ABI.
if test -d /usr/lib32; then
acl_libdirstem2=lib32
fi
fi
if test $HOST_CPU_C_ABI_32BIT != yes; then
# 64-bit or unknown ABI.
if test -d /usr/lib64; then
acl_libdirstem3=lib64
fi
fi
if test -n "$searchpath"; then
acl_save_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
if test -d "$searchdir"; then
case "$searchdir" in
*/lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
*/lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
*/../ | */.. )
# Better ignore directories of this form. They are misleading.
;;
*) searchdir=`cd "$searchdir" && pwd`
case "$searchdir" in
*/lib32 ) acl_libdirstem2=lib32 ;;
*/lib64 ) acl_libdirstem3=lib64 ;;
esac ;;
esac
fi
done
IFS="$acl_save_IFS"
if test $HOST_CPU_C_ABI_32BIT = yes; then
# 32-bit ABI.
acl_libdirstem3=
fi
if test $HOST_CPU_C_ABI_32BIT = no; then
# 64-bit ABI.
acl_libdirstem2=
fi
fi
;;
esac
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
])
dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
dnl acl_libdirstem3.
changequote(,)dnl
acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
changequote([,])dnl
])

View file

@ -1,9 +1,11 @@
# libunistring.m4 serial 11
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
# libunistring.m4 serial 12
dnl Copyright (C) 2009-2021 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.
AC_PREREQ([2.64])
dnl gl_LIBUNISTRING
dnl Searches for an installed libunistring.
dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING
@ -12,8 +14,8 @@ dnl augments the CPPFLAGS variable, and #defines HAVE_LIBUNISTRING to 1.
dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBUNISTRING=no and LIBUNISTRING and
dnl LTLIBUNISTRING to empty.
dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE for Autoconf >= 2.64, in order
dnl to avoid warnings like
dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE, in order dnl to avoid warnings
dnl like
dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was required".
dnl This is tricky because of the way 'aclocal' is implemented:
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
@ -21,16 +23,7 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition.
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings.
m4_define([gl_libunistring_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[m4_ifdef([gl_00GNULIB],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[[AC_DEFUN(
[$1], [$2])]])]))
gl_libunistring_AC_DEFUN([gl_LIBUNISTRING],
AC_DEFUN_ONCE([gl_LIBUNISTRING],
[
AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE])
AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER])

View file

@ -1,6 +1,6 @@
dnl Check whether limits.h has needed features.
dnl Copyright 2016-2017 Free Software Foundation, Inc.
dnl Copyright 2016-2021 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.
@ -11,14 +11,18 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
[
gl_CHECK_NEXT_HEADERS([limits.h])
AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.],
[gl_cv_header_limits_width],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#endif
#include <limits.h>
int ullw = ULLONG_WIDTH;]])],
[AC_LANG_PROGRAM(
[[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#endif
#include <limits.h>
long long llm = LLONG_MAX;
int wb = WORD_BIT;
int ullw = ULLONG_WIDTH;
]])],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])
if test "$gl_cv_header_limits_width" = yes; then
@ -29,3 +33,11 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
AC_SUBST([LIMITS_H])
AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
])
dnl Unconditionally enables the replacement of <limits.h>.
AC_DEFUN([gl_REPLACE_LIMITS_H],
[
AC_REQUIRE([gl_LIMITS_H])
LIMITS_H='limits.h'
AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
])

View file

@ -1,5 +1,5 @@
# link.m4 serial 8
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
# link.m4 serial 11
dnl Copyright (C) 2009-2021 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.
@ -39,10 +39,12 @@ AC_DEFUN([gl_FUNC_LINK],
]])],
[gl_cv_func_link_works=yes], [gl_cv_func_link_works=no],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_link_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_link_works="guessing no" ;;
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_link_works="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_link_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.a conftest.b conftest.lnk])

View file

@ -1,5 +1,5 @@
# localcharset.m4 serial 7
dnl Copyright (C) 2002, 2004, 2006, 2009-2017 Free Software Foundation, Inc.
# localcharset.m4 serial 8
dnl Copyright (C) 2002, 2004, 2006, 2009-2021 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.
@ -8,10 +8,4 @@ AC_DEFUN([gl_LOCALCHARSET],
[
dnl Prerequisites of lib/localcharset.c.
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_REQUIRE([gl_FCNTL_O_FLAGS])
AC_CHECK_DECLS_ONCE([getc_unlocked])
dnl Prerequisites of the lib/Makefile.am snippet.
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_GLIBC21])
])

View file

@ -1,5 +1,5 @@
# locale-fr.m4 serial 17
dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc.
# locale-fr.m4 serial 20
dnl Copyright (C) 2003, 2005-2021 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.
@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_FR],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
AC_LANG_CONFTEST([AC_LANG_SOURCE([
changequote(,)dnl
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@ -24,8 +23,14 @@ changequote(,)dnl
struct tm t;
char buf[16];
int main () {
/* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
imitates locale dependent behaviour by looking at the environment
variables, and all locales use the UTF-8 encoding. */
#if defined __BEOS__ || defined __HAIKU__
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@ -33,9 +38,9 @@ int main () {
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
#else
# else
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@ -44,35 +49,35 @@ int main () {
some unit tests fail.
On MirBSD 10, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
#if HAVE_LANGINFO_CODESET
# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|| strcmp (cs, "UTF-8") == 0)
return 1;
}
#endif
#ifdef __CYGWIN__
# endif
# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
#endif
# endif
/* Check whether in the abbreviation of the second month, the second
character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
one byte long. This excludes the UTF-8 encoding. */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
/* Check whether the decimal separator is a comma.
On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
are nl_langinfo(RADIXCHAR) are both ".". */
if (localeconv () ->decimal_point[0] != ',') return 1;
#endif
# endif
return 0;
#endif
}
changequote([,])dnl
])])
]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets
@ -136,8 +141,7 @@ AC_DEFUN([gt_LOCALE_FR_UTF8],
[
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
AC_LANG_CONFTEST([AC_LANG_SOURCE([
changequote(,)dnl
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@ -153,7 +157,7 @@ int main () {
variables, and all locales use the UTF-8 encoding. */
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@ -199,8 +203,7 @@ int main () {
#endif
return 0;
}
changequote([,])dnl
])])
]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets

View file

@ -1,5 +1,5 @@
# locale-ja.m4 serial 12
dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc.
# locale-ja.m4 serial 15
dnl Copyright (C) 2003, 2005-2021 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.
@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_JA],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
AC_LANG_CONFTEST([AC_LANG_SOURCE([
changequote(,)dnl
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@ -25,9 +24,14 @@ struct tm t;
char buf[16];
int main ()
{
const char *p;
/* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
imitates locale dependent behaviour by looking at the environment
variables, and all locales use the UTF-8 encoding. */
#if defined __BEOS__ || defined __HAIKU__
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@ -35,9 +39,9 @@ int main ()
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
#else
# else
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@ -46,35 +50,38 @@ int main ()
some unit tests fail.
On MirBSD 10, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
#if HAVE_LANGINFO_CODESET
# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|| strcmp (cs, "UTF-8") == 0)
return 1;
}
#endif
#ifdef __CYGWIN__
# endif
# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
#endif
# endif
/* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
on Cygwin 1.5.x. */
if (MB_CUR_MAX == 1)
return 1;
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
This excludes the UTF-8 encoding (except on MirBSD). */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
for (p = buf; *p != '\0'; p++)
if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
return 1;
{
const char *p;
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
for (p = buf; *p != '\0'; p++)
if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
return 1;
}
return 0;
#endif
}
changequote([,])dnl
])])
]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets

View file

@ -1,5 +1,5 @@
# locale-zh.m4 serial 12
dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc.
# locale-zh.m4 serial 15
dnl Copyright (C) 2003, 2005-2021 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.
@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_ZH_CN],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
AC_LANG_CONFTEST([AC_LANG_SOURCE([
changequote(,)dnl
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <stdlib.h>
#include <time.h>
@ -26,9 +25,14 @@ struct tm t;
char buf[16];
int main ()
{
const char *p;
/* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
imitates locale dependent behaviour by looking at the environment
variables, and all locales use the UTF-8 encoding. */
#if defined __BEOS__ || defined __HAIKU__
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@ -36,9 +40,9 @@ int main ()
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
#else
# else
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@ -47,35 +51,38 @@ int main ()
some unit tests fail.
On MirBSD 10, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
#if HAVE_LANGINFO_CODESET
# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|| strcmp (cs, "UTF-8") == 0)
return 1;
}
#endif
#ifdef __CYGWIN__
# endif
# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
#endif
# endif
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
This excludes the UTF-8 encoding (except on MirBSD). */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
for (p = buf; *p != '\0'; p++)
if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
return 1;
{
const char *p;
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
for (p = buf; *p != '\0'; p++)
if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
return 1;
}
/* Check whether a typical GB18030 multibyte sequence is recognized as a
single wide character. This excludes the GB2312 and GBK encodings. */
if (mblen ("\203\062\332\066", 5) != 4)
return 1;
return 0;
#endif
}
changequote([,])dnl
])])
]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets

View file

@ -1,5 +1,5 @@
# locale_h.m4 serial 19
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
# locale_h.m4 serial 25
dnl Copyright (C) 2007, 2009-2021 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.
@ -17,7 +17,9 @@ AC_DEFUN([gl_LOCALE_H],
dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
AC_REQUIRE([gl_STDDEF_H])
dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv'
AC_REQUIRE([gl_LOCALE_T])
dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv'
dnl only if _LCONV_C99 is defined.
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
@ -37,34 +39,6 @@ AC_DEFUN([gl_LOCALE_H],
[gl_cv_header_locale_h_posix2001=yes],
[gl_cv_header_locale_h_posix2001=no])])
dnl Check for <xlocale.h>.
AC_CHECK_HEADERS_ONCE([xlocale.h])
if test $ac_cv_header_xlocale_h = yes; then
HAVE_XLOCALE_H=1
dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
dnl itself, we assume that <xlocale.h> will do so.
AC_CACHE_CHECK([whether locale.h defines locale_t],
[gl_cv_header_locale_has_locale_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <locale.h>
locale_t x;]],
[[]])],
[gl_cv_header_locale_has_locale_t=yes],
[gl_cv_header_locale_has_locale_t=no])
])
if test $gl_cv_header_locale_has_locale_t = yes; then
gl_cv_header_locale_h_needs_xlocale_h=no
else
gl_cv_header_locale_h_needs_xlocale_h=yes
fi
else
HAVE_XLOCALE_H=0
gl_cv_header_locale_h_needs_xlocale_h=no
fi
AC_SUBST([HAVE_XLOCALE_H])
dnl Check whether 'struct lconv' is complete.
dnl Bionic libc's 'struct lconv' is just a dummy.
dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
@ -82,7 +56,20 @@ AC_DEFUN([gl_LOCALE_H],
[gl_cv_sys_struct_lconv_ok=no])
])
if test $gl_cv_sys_struct_lconv_ok = no; then
REPLACE_STRUCT_LCONV=1
dnl On native Windows with MSVC, merely define these member names as macros.
dnl This avoids trouble in C++ mode.
case "$host_os" in
mingw*)
AC_EGREP_CPP([Special], [
#ifdef _MSC_VER
Special
#endif
],
[],
[REPLACE_STRUCT_LCONV=1])
;;
*) REPLACE_STRUCT_LCONV=1 ;;
esac
fi
dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
@ -96,7 +83,50 @@ AC_DEFUN([gl_LOCALE_H],
# include <xlocale.h>
#endif
]],
[setlocale duplocale])
[setlocale newlocale duplocale freelocale])
])
dnl Checks to determine whether the system has the locale_t type,
dnl and how to obtain it.
AC_DEFUN([gl_LOCALE_T],
[
dnl Persuade glibc and Solaris <locale.h> to define locale_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
dnl itself, we assume that <xlocale.h> will do so.
AC_CACHE_CHECK([whether locale.h defines locale_t],
[gl_cv_header_locale_has_locale_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <locale.h>
locale_t x;]],
[[]])],
[gl_cv_header_locale_has_locale_t=yes],
[gl_cv_header_locale_has_locale_t=no])
])
dnl Check for <xlocale.h>.
AC_CHECK_HEADERS_ONCE([xlocale.h])
if test $ac_cv_header_xlocale_h = yes; then
HAVE_XLOCALE_H=1
if test $gl_cv_header_locale_has_locale_t = yes; then
gl_cv_header_locale_h_needs_xlocale_h=no
else
gl_cv_header_locale_h_needs_xlocale_h=yes
fi
HAVE_LOCALE_T=1
else
HAVE_XLOCALE_H=0
gl_cv_header_locale_h_needs_xlocale_h=no
if test $gl_cv_header_locale_has_locale_t = yes; then
HAVE_LOCALE_T=1
else
HAVE_LOCALE_T=0
fi
fi
AC_SUBST([HAVE_XLOCALE_H])
])
AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
@ -110,13 +140,20 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
AC_DEFUN([gl_LOCALE_H_DEFAULTS],
[
GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE])
GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE])
GNULIB_SETLOCALE_NULL=0; AC_SUBST([GNULIB_SETLOCALE_NULL])
GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
GNULIB_LOCALENAME=0; AC_SUBST([GNULIB_LOCALENAME])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE])
HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE])
REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE])
REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE])
REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS])
])

View file

@ -1,5 +1,5 @@
# localeconv.m4 serial 1
dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2012-2021 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.

View file

@ -1,5 +1,5 @@
# log.m4 serial 4
dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
# log.m4 serial 11
dnl Copyright (C) 2011-2021 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.
@ -46,9 +46,9 @@ numeric_equal (double x, double y)
static double dummy (double x) { return 0; }
int main (int argc, char *argv[])
{
double (*my_log) (double) = argc ? log : dummy;
double (* volatile my_log) (double) = argc ? log : dummy;
/* Test log(negative).
This test fails on NetBSD 5.1, Solaris 11 2011-11. */
This test fails on NetBSD 5.1, Solaris 11.4. */
double y = my_log (-1.0);
if (numeric_equal (y, y))
return 1;
@ -58,10 +58,14 @@ int main (int argc, char *argv[])
[gl_cv_func_log_ieee=yes],
[gl_cv_func_log_ieee=no],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_log_ieee="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_log_ieee="guessing no" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_log_ieee="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_log_ieee="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_log_ieee="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_log_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
@ -99,8 +103,10 @@ int main ()
[gl_cv_func_log_works=yes],
[gl_cv_func_log_works=no],
[case "$host_os" in
osf*) gl_cv_func_log_works="guessing no";;
*) gl_cv_func_log_works="guessing yes";;
osf*) gl_cv_func_log_works="guessing no" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_log_works="guessing yes" ;;
*) gl_cv_func_log_works="guessing yes" ;;
esac
])
])

View file

@ -1,5 +1,5 @@
# log1p.m4 serial 3
dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
# log1p.m4 serial 8
dnl Copyright (C) 2012-2021 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.
@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_LOG1P],
static double dummy (double x) { return 0; }
int main (int argc, char *argv[])
{
double (*my_log1p) (double) = argc ? log1p : dummy;
double (* volatile my_log1p) (double) = argc ? log1p : dummy;
/* This test fails on AIX, HP-UX 11. */
double y = my_log1p (minus_zerod);
if (!(y == 0.0) || (signbitd (minus_zerod) && !signbitd (y)))
@ -52,10 +52,14 @@ int main (int argc, char *argv[])
[gl_cv_func_log1p_ieee=yes],
[gl_cv_func_log1p_ieee=no],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_log1p_ieee="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_log1p_ieee="guessing no" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_log1p_ieee="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_log1p_ieee="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_log1p_ieee="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_log1p_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"

View file

@ -1,113 +0,0 @@
# longlong.m4 serial 17
dnl Copyright (C) 1999-2007, 2009-2017 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.
dnl From Paul Eggert.
# Define HAVE_LONG_LONG_INT if 'long long int' works.
# 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
# defined. In this case you can treat 'long long int' like 'long int'.
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_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'.])
fi
])
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
# 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
# will not be defined. In this case you can treat 'unsigned long long int'
# like 'unsigned long int'.
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
[
AC_CACHE_CHECK([for unsigned long long int],
[ac_cv_type_unsigned_long_long_int],
[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'.])
fi
])
# Expands to a C program that can be used to test for simultaneous support
# of 'long long' and 'unsigned long long'. We don't want to say that
# 'long long' is available if 'unsigned long long' is not, or vice versa,
# because too many programs rely on the symmetry between signed and unsigned
# integer types (excluding 'bool').
AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
[
AC_LANG_PROGRAM(
[[/* For now, do not test the preprocessor; as of 2007 there are too many
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
/* Test literals. */
long long int ll = 9223372036854775807ll;
long long int nll = -9223372036854775807LL;
unsigned long long int ull = 18446744073709551615ULL;
/* Test constant expressions. */
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
? 1 : -1)];
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
? 1 : -1)];
int i = 63;]],
[[/* Test availability of runtime routines for shift and division. */
long long int llmax = 9223372036854775807ll;
unsigned long long int ullmax = 18446744073709551615ull;
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));]])
])

View file

@ -1,6 +1,6 @@
# serial 27
# serial 33
# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc.
# Copyright (C) 1997-2001, 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -10,14 +10,15 @@ dnl From Jim Meyering.
AC_DEFUN([gl_FUNC_LSTAT],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
dnl If lstat does not exist, the replacement <sys/stat.h> does
dnl "#define lstat stat", and lstat.c is a no-op.
AC_CHECK_FUNCS_ONCE([lstat])
if test $ac_cv_func_lstat = yes; then
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
*no)
case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
solaris* | *no)
REPLACE_LSTAT=1
;;
esac
@ -33,6 +34,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[
dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
[gl_cv_func_lstat_dereferences_slashed_symlink],
[rm -f conftest.sym conftest.file
@ -51,12 +53,18 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[gl_cv_func_lstat_dereferences_slashed_symlink=yes],
[gl_cv_func_lstat_dereferences_slashed_symlink=no],
[case "$host_os" in
*-gnu*)
linux-* | linux)
# Guess yes on Linux systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
*-gnu* | gnu*)
# Guess yes on glibc systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
*)
# If we don't know, assume the worst.
mingw*)
# Guess no on native Windows.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
*)
# If we don't know, obey --enable-cross-guesses.
gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.sym conftest.file

View file

@ -1,27 +1,19 @@
# malloc.m4 serial 15
dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
# malloc.m4 serial 21
dnl Copyright (C) 2007, 2009-2021 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.
m4_version_prereq([2.70], [] ,[
# This is adapted with modifications from upstream Autoconf here:
# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
AC_DEFUN([_AC_FUNC_MALLOC_IF],
[
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
AC_CHECK_HEADERS([stdlib.h])
AC_CACHE_CHECK([for GNU libc compatible malloc],
[ac_cv_func_malloc_0_nonnull],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
#else
char *malloc ();
#endif
[[#include <stdlib.h>
]],
[[char *p = malloc (0);
int result = !p;
@ -32,19 +24,24 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
[ac_cv_func_malloc_0_nonnull=no],
[case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* \
*-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
ac_cv_func_malloc_0_nonnull=yes ;;
# If we don't know, assume the worst.
*) ac_cv_func_malloc_0_nonnull=no ;;
ac_cv_func_malloc_0_nonnull="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
esac
])
])
AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
case "$ac_cv_func_malloc_0_nonnull" in
*yes)
$1
;;
*)
$2
;;
esac
])# _AC_FUNC_MALLOC_IF
])
# gl_FUNC_MALLOC_GNU
# ------------------
# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
@ -91,7 +88,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
[[#if defined _WIN32 && ! defined __CYGWIN__
choke me
#endif
]])],

View file

@ -1,5 +1,5 @@
# malloca.m4 serial 1
dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 Free Software Foundation,
# malloca.m4 serial 2
dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -11,5 +11,4 @@ AC_DEFUN([gl_MALLOCA],
dnl @ALLOCA@ and @LTALLOCA@.
dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
AC_REQUIRE([gl_EEMALLOC])
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
])

View file

@ -1,5 +1,5 @@
# math_h.m4 serial 115
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
# math_h.m4 serial 122
dnl Copyright (C) 2007-2021 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.
@ -10,7 +10,7 @@ AC_DEFUN([gl_MATH_H],
gl_CHECK_NEXT_HEADERS([math.h])
AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
[[/* Solaris 10 has a broken definition of NAN. Other platforms
fail to provide NAN, or provide it only in C99 mode; this
test only needs to fail when NAN is provided but wrong. */
@ -25,7 +25,7 @@ AC_DEFUN([gl_MATH_H],
REPLACE_NAN=1
fi
AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
[[/* Solaris 10 has a broken definition of HUGE_VAL. */
double d = HUGE_VAL;
return d == 0;]])],
@ -159,178 +159,189 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
dnl Support Microsoft deprecated alias function names by default.
GNULIB_MDA_J0=1; AC_SUBST([GNULIB_MDA_J0])
GNULIB_MDA_J1=1; AC_SUBST([GNULIB_MDA_J1])
GNULIB_MDA_JN=1; AC_SUBST([GNULIB_MDA_JN])
GNULIB_MDA_Y0=1; AC_SUBST([GNULIB_MDA_Y0])
GNULIB_MDA_Y1=1; AC_SUBST([GNULIB_MDA_Y1])
GNULIB_MDA_YN=1; AC_SUBST([GNULIB_MDA_YN])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
HAVE_COSF=1; AC_SUBST([HAVE_COSF])
HAVE_COSL=1; AC_SUBST([HAVE_COSL])
HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
HAVE_FMA=1; AC_SUBST([HAVE_FMA])
HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
HAVE_POWF=1; AC_SUBST([HAVE_POWF])
HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
HAVE_RINT=1; AC_SUBST([HAVE_RINT])
HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
HAVE_SINF=1; AC_SUBST([HAVE_SINF])
HAVE_SINL=1; AC_SUBST([HAVE_SINL])
HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
HAVE_TANF=1; AC_SUBST([HAVE_TANF])
HAVE_TANL=1; AC_SUBST([HAVE_TANL])
HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
HAVE_COSF=1; AC_SUBST([HAVE_COSF])
HAVE_COSL=1; AC_SUBST([HAVE_COSL])
HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
HAVE_FMA=1; AC_SUBST([HAVE_FMA])
HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
HAVE_POWF=1; AC_SUBST([HAVE_POWF])
HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
HAVE_RINT=1; AC_SUBST([HAVE_RINT])
HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
HAVE_SINF=1; AC_SUBST([HAVE_SINF])
HAVE_SINL=1; AC_SUBST([HAVE_SINL])
HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
HAVE_TANF=1; AC_SUBST([HAVE_TANF])
HAVE_TANL=1; AC_SUBST([HAVE_TANL])
HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
])
# gl_LONG_DOUBLE_VS_DOUBLE

View file

@ -1,5 +1,5 @@
# mathfunc.m4 serial 11
dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
# mathfunc.m4 serial 12
dnl Copyright (C) 2010-2021 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.
@ -60,7 +60,7 @@ AC_DEFUN([gl_MATHFUNC],
#endif
#include <math.h>
$4
$2 (*funcptr) $3 = ]func[;
$2 (* volatile funcptr) $3 = ]func[;
int i_ret;
float f_ret;
double d_ret;
@ -85,7 +85,7 @@ AC_DEFUN([gl_MATHFUNC],
#endif
#include <math.h>
$4
$2 (*funcptr) $3 = ]func[;
$2 (* volatile funcptr) $3 = ]func[;
int i_ret;
float f_ret;
double d_ret;

View file

@ -1,5 +1,5 @@
# mbrtowc.m4 serial 27 -*- coding: utf-8 -*-
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2017 Free Software Foundation,
# mbrtowc.m4 serial 38 -*- coding: utf-8 -*-
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -8,6 +8,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
AC_REQUIRE([gl_PTHREADLIB])
AC_CHECK_HEADERS_ONCE([threads.h])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
gl_MBSTATE_T_BROKEN
@ -16,15 +18,8 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
if test $ac_cv_func_mbrtowc = no; then
HAVE_MBRTOWC=0
AC_CHECK_DECLS([mbrtowc],,, [[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
]])
#include <wchar.h>
]])
if test $ac_cv_have_decl_mbrtowc = yes; then
dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
dnl it does not have the function. Avoid a collision with gnulib's
@ -39,6 +34,7 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
gl_MBRTOWC_NULL_ARG2
gl_MBRTOWC_RETVAL
gl_MBRTOWC_NUL_RETVAL
gl_MBRTOWC_STORES_INCOMPLETE
gl_MBRTOWC_EMPTY_INPUT
gl_MBRTOWC_C_LOCALE
case "$gl_cv_func_mbrtowc_null_arg1" in
@ -69,6 +65,13 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
REPLACE_MBRTOWC=1
;;
esac
case "$gl_cv_func_mbrtowc_stores_incomplete" in
*no) ;;
*) AC_DEFINE([MBRTOWC_STORES_INCOMPLETE_BUG], [1],
[Define if the mbrtowc function stores a wide character when reporting incomplete input.])
REPLACE_MBRTOWC=1
;;
esac
case "$gl_cv_func_mbrtowc_empty_input" in
*yes) ;;
*) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1],
@ -77,15 +80,32 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
REPLACE_MBRTOWC=1
;;
esac
case $gl_cv_C_locale_sans_EILSEQ in
case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
*yes) ;;
*) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1],
[Define to 1 if the C locale may have encoding errors.])
*) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1],
[Define if the mbrtowc function may signal encoding errors in the C locale.])
REPLACE_MBRTOWC=1
;;
esac
fi
fi
if test $REPLACE_MBSTATE_T = 1; then
case "$host_os" in
mingw*) LIB_MBRTOWC= ;;
*)
gl_WEAK_SYMBOLS
case "$gl_cv_have_weak" in
*yes) LIB_MBRTOWC= ;;
*) LIB_MBRTOWC="$LIBPTHREAD" ;;
esac
;;
esac
else
LIB_MBRTOWC=
fi
dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
dnl with gcc or xlc, and empty otherwise.
AC_SUBST([LIB_MBRTOWC])
])
dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
@ -97,11 +117,19 @@ dnl avoid inconsistencies.
AC_DEFUN([gl_MBSTATE_T_BROKEN],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
AC_CHECK_FUNCS_ONCE([mbsinit])
AC_CHECK_FUNCS_ONCE([mbrtowc])
if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
dnl On native Windows, we know exactly how mbsinit() behaves and don't need
dnl to override it, even if - like on MSVC - mbsinit() is only defined as
dnl an inline function, not as a global function.
if case "$host_os" in
mingw*) true ;;
*) test $ac_cv_func_mbsinit = yes ;;
esac \
&& test $ac_cv_func_mbrtowc = yes; then
gl_MBRTOWC_INCOMPLETE_STATE
gl_MBRTOWC_SANITYCHECK
REPLACE_MBSTATE_T=0
@ -126,6 +154,7 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gt_LOCALE_JA])
AC_REQUIRE([gt_LOCALE_FR_UTF8])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
[gl_cv_func_mbrtowc_incomplete_state],
@ -145,13 +174,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -171,6 +193,32 @@ int main ()
[gl_cv_func_mbrtowc_incomplete_state=yes],
[gl_cv_func_mbrtowc_incomplete_state=no],
[:])
else
if test $LOCALE_FR_UTF8 != none; then
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
int main ()
{
if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
const char input[] = "B\303\274\303\237er"; /* "Büßer" */
mbstate_t state;
wchar_t wc;
memset (&state, '\0', sizeof (mbstate_t));
if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
if (mbsinit (&state))
return 2;
}
return 0;
}]])],
[gl_cv_func_mbrtowc_incomplete_state=yes],
[gl_cv_func_mbrtowc_incomplete_state=no],
[:])
fi
fi
])
])
@ -202,13 +250,6 @@ changequote([,])dnl
#include <locale.h>
#include <stdlib.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -262,13 +303,6 @@ changequote([,])dnl
#include <locale.h>
#include <stdlib.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -331,13 +365,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -393,13 +420,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -521,13 +541,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
@ -550,6 +563,112 @@ int main ()
])
])
dnl Test whether mbrtowc stores a wide character when reporting incomplete
dnl input.
AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether mbrtowc stores incomplete characters],
[gl_cv_func_mbrtowc_stores_incomplete],
[
dnl Initial guess, used when cross-compiling or when no suitable locale
dnl is present.
changequote(,)dnl
case "$host_os" in
# Guess yes on native Windows.
mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
*) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
esac
changequote([,])dnl
case "$host_os" in
mingw*)
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
int main ()
{
int result = 0;
if (setlocale (LC_ALL, "French_France.65001") != NULL)
{
wchar_t wc = (wchar_t) 0xBADFACE;
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
&& wc != (wchar_t) 0xBADFACE)
result |= 1;
}
if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
{
wchar_t wc = (wchar_t) 0xBADFACE;
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
&& wc != (wchar_t) 0xBADFACE)
result |= 2;
}
if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
{
wchar_t wc = (wchar_t) 0xBADFACE;
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
&& wc != (wchar_t) 0xBADFACE)
result |= 4;
}
if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
{
wchar_t wc = (wchar_t) 0xBADFACE;
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
&& wc != (wchar_t) 0xBADFACE)
result |= 8;
}
return result;
}]])],
[gl_cv_func_mbrtowc_stores_incomplete=no],
[gl_cv_func_mbrtowc_stores_incomplete=yes],
[:])
;;
*)
AC_REQUIRE([gt_LOCALE_FR_UTF8])
if test $LOCALE_FR_UTF8 != none; then
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
int main ()
{
if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
wchar_t wc = (wchar_t) 0xBADFACE;
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
&& wc != (wchar_t) 0xBADFACE)
return 1;
}
return 0;
}]])],
[gl_cv_func_mbrtowc_stores_incomplete=no],
[gl_cv_func_mbrtowc_stores_incomplete=yes],
[:])
fi
;;
esac
])
])
dnl Test whether mbrtowc returns the correct value on empty input.
AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
@ -563,10 +682,11 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
dnl is present.
changequote(,)dnl
case "$host_os" in
# Guess no on AIX and glibc systems.
aix* | *-gnu*)
gl_cv_func_mbrtowc_empty_input="guessing no" ;;
*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
# Guess no on AIX and glibc systems.
aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
esac
changequote([,])dnl
AC_RUN_IFELSE(
@ -592,12 +712,13 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
AC_DEFUN([gl_MBRTOWC_C_LOCALE],
[
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether the C locale is free of encoding errors],
[gl_cv_C_locale_sans_EILSEQ],
[gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
[
dnl Initial guess, used when cross-compiling or when no suitable locale
dnl is present.
gl_cv_C_locale_sans_EILSEQ="guessing no"
gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
@ -620,16 +741,28 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
}
return 0;
]])],
[gl_cv_C_locale_sans_EILSEQ=yes],
[gl_cv_C_locale_sans_EILSEQ=no],
[:])])
[gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
[gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
[case "$host_os" in
# Guess yes on native Windows.
mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
esac
])
])
])
# Prerequisites of lib/mbrtowc.c.
# Prerequisites of lib/mbrtowc.c and lib/lc-charset-dispatch.c.
AC_DEFUN([gl_PREREQ_MBRTOWC], [
AC_REQUIRE([AC_C_INLINE])
:
])
# Prerequisites of lib/mbtowc-lock.c.
AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
[
gl_VISIBILITY
])
dnl From Paul Eggert
@ -639,24 +772,17 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
[
dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
gl_cv_func_mbrtowc,
[gl_cv_func_mbrtowc],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
included before <wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
must be included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>]],
[[#include <wchar.h>]],
[[wchar_t wc;
char const s[] = "";
size_t n = 1;
mbstate_t state;
return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
gl_cv_func_mbrtowc=yes,
gl_cv_func_mbrtowc=no)])
[gl_cv_func_mbrtowc=yes],
[gl_cv_func_mbrtowc=no])])
if test $gl_cv_func_mbrtowc = yes; then
AC_DEFINE([HAVE_MBRTOWC], [1],
[Define to 1 if mbrtowc and mbstate_t are properly declared.])

View file

@ -1,5 +1,5 @@
# mbsinit.m4 serial 8
dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
# mbsinit.m4 serial 9
dnl Copyright (C) 2008, 2010-2021 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.
@ -16,15 +16,8 @@ AC_DEFUN([gl_FUNC_MBSINIT],
if test $ac_cv_func_mbsinit = no; then
HAVE_MBSINIT=0
AC_CHECK_DECLS([mbsinit],,, [[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
]])
#include <wchar.h>
]])
if test $ac_cv_have_decl_mbsinit = yes; then
dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
dnl it does not have the function. Avoid a collision with gnulib's

Some files were not shown because too many files have changed in this diff Show more