diff options
Diffstat (limited to 'gnulib-m4')
114 files changed, 7229 insertions, 2861 deletions
diff --git a/gnulib-m4/00gnulib.m4 b/gnulib-m4/00gnulib.m4 index 301469b..c7103ed 100644 --- a/gnulib-m4/00gnulib.m4 +++ b/gnulib-m4/00gnulib.m4 @@ -1,12 +1,28 @@ -# 00gnulib.m4 serial 2 -dnl Copyright (C) 2009-2010 Free Software Foundation, Inc. +# 00gnulib.m4 serial 3 +dnl Copyright (C) 2009-2015 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 semantics. +dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and +dnl m4_divert semantics. + +# 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) # ---------------------------- diff --git a/gnulib-m4/absolute-header.m4 b/gnulib-m4/absolute-header.m4 new file mode 100644 index 0000000..bc19dfc --- /dev/null +++ b/gnulib-m4/absolute-header.m4 @@ -0,0 +1,102 @@ +# absolute-header.m4 serial 16 +dnl Copyright (C) 2006-2015 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. + +# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...) +# --------------------------------------- +# Find the absolute name of a header file, testing first if the header exists. +# If the header were sys/inttypes.h, this macro would define +# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h +# in config.h +# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). +# The three "///" are to pacify Sun C 5.8, which otherwise would say +# "warning: #include of /usr/include/... may be non-portable". +# Use '""', not '<>', so that the /// cannot be confused with a C99 comment. +# Note: This macro assumes that the header file is not empty after +# preprocessing, i.e. it does not only define preprocessor macros but also +# provides some type/enum definitions or function/variable declarations. +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]), + [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 + 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)"], + [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) + AS_VAR_POPDEF([gl_absolute_header])dnl +])dnl +])# gl_ABSOLUTE_HEADER + +# gl_ABSOLUTE_HEADER_ONE(HEADER) +# ------------------------------ +# Like gl_ABSOLUTE_HEADER, except that: +# - it assumes that the header exists, +# - it uses the current CPPFLAGS, +# - it does not cache the result, +# - it is silent. +AC_DEFUN([gl_ABSOLUTE_HEADER_ONE], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])]) + dnl AIX "xlc -E" and "cc -E" omit #line directives for header files + dnl that contain only a #include of other header files and no + dnl non-comment tokens of their own. This leads to a failure to + dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h> + dnl and others. The workaround is to force preservation of comments + dnl through option -C. This ensures all necessary #line directives + dnl are present. GCC supports option -C as well. + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac +changequote(,) + case "$host_os" in + mingw*) + dnl For the sake of native Windows compilers (excluding gcc), + dnl treat backslash as a directory separator, like /. + dnl Actually, these compilers use a double-backslash as + dnl directory separator, inside the + dnl # line "filename" + dnl directives. + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + dnl A sed expression that turns a string into a basic regular + dnl expression, for use within "/.../". + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo '$1' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' +changequote([,]) + dnl eval is necessary to expand gl_absname_cpp. + dnl Ultrix and Pyramid sh refuse to redirect output of eval, + dnl so use subshell. + AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]), +[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + sed -n "$gl_absolute_header_sed"`]) +]) diff --git a/gnulib-m4/alloca.m4 b/gnulib-m4/alloca.m4 index f3ee343..8408bed 100644 --- a/gnulib-m4/alloca.m4 +++ b/gnulib-m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 9 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation, +# alloca.m4 serial 14 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2015 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,10 +7,6 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_ALLOCA], [ - dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. - AC_REQUIRE([AC_PROG_CPP]) - AC_REQUIRE([AC_PROG_EGREP]) - AC_REQUIRE([AC_FUNC_ALLOCA]) if test $ac_cv_func_alloca_works = no; then gl_PREREQ_ALLOCA @@ -40,8 +36,86 @@ AC_DEFUN([gl_FUNC_ALLOCA], ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) + AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$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.69], [] ,[ + +# This is taken from the following Autoconf patch: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 + +# _AC_LIBOBJ_ALLOCA +# ----------------- +# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly +# AC_LIBOBJ since we actually set the output variable 'ALLOCA'. +# Nevertheless, for Automake, AC_LIBSOURCES it. +m4_define([_AC_LIBOBJ_ALLOCA], +[# The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. +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( +[AC_INCLUDES_DEFAULT +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +}])], + [ac_cv_c_stack_direction=1], + [ac_cv_c_stack_direction=-1], + [ac_cv_c_stack_direction=0])]) +AH_VERBATIM([STACK_DIRECTION], +[/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + 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 +AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) +])# _AC_LIBOBJ_ALLOCA +]) diff --git a/gnulib-m4/btowc.m4 b/gnulib-m4/btowc.m4 new file mode 100644 index 0000000..c1da65d --- /dev/null +++ b/gnulib-m4/btowc.m4 @@ -0,0 +1,116 @@ +# btowc.m4 serial 10 +dnl Copyright (C) 2008-2015 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_BTOWC], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + 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>. + AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) + + AC_CHECK_FUNCS_ONCE([btowc]) + if test $ac_cv_func_btowc = no; then + HAVE_BTOWC=0 + else + + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0. + AC_CACHE_CHECK([whether btowc(0) is correct], + [gl_cv_func_btowc_nul], + [ + 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 () +{ + if (btowc ('\0') != 0) + return 1; + return 0; +}]])], + [gl_cv_func_btowc_nul=yes], + [gl_cv_func_btowc_nul=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) + + dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF. + AC_CACHE_CHECK([whether btowc(EOF) is correct], + [gl_cv_func_btowc_eof], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + 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" ;; + 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 () +{ + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (btowc (EOF) != WEOF) + return 1; + } + return 0; +}]])], + [gl_cv_func_btowc_eof=yes], + [gl_cv_func_btowc_eof=no], + [:]) + fi + ]) + + case "$gl_cv_func_btowc_nul" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + case "$gl_cv_func_btowc_eof" in + *yes) ;; + *) REPLACE_BTOWC=1 ;; + esac + fi +]) + +# Prerequisites of lib/btowc.c. +AC_DEFUN([gl_PREREQ_BTOWC], [ + : +]) diff --git a/gnulib-m4/codeset.m4 b/gnulib-m4/codeset.m4 index a53c042..d7de8d6 100644 --- a/gnulib-m4/codeset.m4 +++ b/gnulib-m4/codeset.m4 @@ -1,5 +1,5 @@ -# codeset.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc. +# codeset.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2006, 2008-2014 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. @@ -9,10 +9,12 @@ dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], - [AC_TRY_LINK([#include <langinfo.h>], - [char* cs = nl_langinfo(CODESET); return !cs;], - [am_cv_langinfo_codeset=yes], - [am_cv_langinfo_codeset=no]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <langinfo.h>]], + [[char* cs = nl_langinfo(CODESET); return !cs;]])], + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], diff --git a/gnulib-m4/configmake.m4 b/gnulib-m4/configmake.m4 new file mode 100644 index 0000000..49d3a13 --- /dev/null +++ b/gnulib-m4/configmake.m4 @@ -0,0 +1,55 @@ +# configmake.m4 serial 2 +dnl Copyright (C) 2010-2015 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}']) +]) diff --git a/gnulib-m4/eealloc.m4 b/gnulib-m4/eealloc.m4 index 63dd920..322bdd5 100644 --- a/gnulib-m4/eealloc.m4 +++ b/gnulib-m4/eealloc.m4 @@ -1,5 +1,5 @@ -# eealloc.m4 serial 2 -dnl Copyright (C) 2003, 2009, 2010 Free Software Foundation, Inc. +# eealloc.m4 serial 3 +dnl Copyright (C) 2003, 2009-2015 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_EEALLOC], [ AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([gl_EEREALLOC]) - AC_REQUIRE([AC_C_INLINE]) ]) AC_DEFUN([gl_EEMALLOC], diff --git a/gnulib-m4/environ.m4 b/gnulib-m4/environ.m4 index 5f50d6e..4dbf947 100644 --- a/gnulib-m4/environ.m4 +++ b/gnulib-m4/environ.m4 @@ -1,5 +1,5 @@ -# environ.m4 serial 3 -dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc. +# environ.m4 serial 6 +dnl Copyright (C) 2001-2004, 2006-2015 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. @@ -9,7 +9,16 @@ AC_DEFUN_ONCE([gl_ENVIRON], AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl Persuade glibc <unistd.h> to declare environ. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - gt_CHECK_VAR_DECL([#include <unistd.h>], environ) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + gt_CHECK_VAR_DECL( + [#if HAVE_UNISTD_H + #include <unistd.h> + #endif + /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ + #include <stdlib.h> + ], + [environ]) if test $gt_cv_var_environ_declaration != yes; then HAVE_DECL_ENVIRON=0 fi @@ -22,14 +31,16 @@ 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_TRY_COMPILE([$1 - extern struct { int foo; } $2;], - [$2.foo = 1;], - gt_cv_var=no, - gt_cv_var=yes)]) + 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]) if test $gt_cv_var = yes; then - AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1, + AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, [Define if you have the declaration of $2.]) fi undefine([gt_cv_var]) diff --git a/gnulib-m4/errno_h.m4 b/gnulib-m4/errno_h.m4 index d02a039..cfaa687 100644 --- a/gnulib-m4/errno_h.m4 +++ b/gnulib-m4/errno_h.m4 @@ -1,5 +1,5 @@ -# errno_h.m4 serial 6 -dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. +# errno_h.m4 serial 12 +dnl Copyright (C) 2004, 2006, 2008-2015 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,6 +10,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ AC_EGREP_CPP([booboo],[ #include <errno.h> +#if !defined ETXTBSY +booboo +#endif #if !defined ENOMSG booboo #endif @@ -34,12 +37,30 @@ booboo #if !defined ENOTSUP booboo #endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif #if !defined ESTALE booboo #endif +#if !defined EDQUOT +booboo +#endif #if !defined ECANCELED booboo #endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif ], [gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=yes]) @@ -47,10 +68,11 @@ booboo if test $gl_cv_header_errno_h_complete = yes; then ERRNO_H='' else - gl_CHECK_NEXT_HEADERS([errno.h]) + gl_NEXT_HEADERS([errno.h]) ERRNO_H='errno.h' fi AC_SUBST([ERRNO_H]) + AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) gl_REPLACE_ERRNO_VALUE([ENOLINK]) gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) diff --git a/gnulib-m4/error.m4 b/gnulib-m4/error.m4 index 9f1307a..b3bd7f6 100644 --- a/gnulib-m4/error.m4 +++ b/gnulib-m4/error.m4 @@ -1,6 +1,6 @@ -#serial 12 +#serial 14 -# Copyright (C) 1996-1998, 2001-2004, 2009-2010 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2015 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8,15 +8,20 @@ AC_DEFUN([gl_ERROR], [ - AC_FUNC_ERROR_AT_LINE - dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). - gl_PREREQ_ERROR + dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer + dnl maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <error.h>]], + [[error_at_line (0, 0, "", 0, "an error occurred");]])], + [ac_cv_lib_error_at_line=yes], + [ac_cv_lib_error_at_line=no])]) ]) # Prerequisites of lib/error.c. AC_DEFUN([gl_PREREQ_ERROR], [ AC_REQUIRE([AC_FUNC_STRERROR_R]) - AC_REQUIRE([AC_C_INLINE]) : ]) diff --git a/gnulib-m4/exponentd.m4 b/gnulib-m4/exponentd.m4 index 5d44d0e..84f1691 100644 --- a/gnulib-m4/exponentd.m4 +++ b/gnulib-m4/exponentd.m4 @@ -1,5 +1,5 @@ -# exponentd.m4 serial 1 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# exponentd.m4 serial 3 +dnl Copyright (C) 2007-2008, 2010-2015 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,8 @@ AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION], AC_CACHE_CHECK([where to find the exponent in a 'double'], [gl_cv_cc_double_expbit0], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <float.h> #include <stddef.h> #include <stdio.h> @@ -71,7 +72,7 @@ int main () fprintf (fp, "unknown"); return (fclose (fp) != 0); } - ], + ]])], [gl_cv_cc_double_expbit0=`cat conftest.out`], [gl_cv_cc_double_expbit0="unknown"], [ @@ -79,7 +80,8 @@ int main () dnl different sets of instructions: The older FPA instructions assume dnl that they are stored in big-endian word order, while the words dnl (like integer types) are stored in little-endian byte order. - dnl The newer VFP instructions assume little-endian order consistenly. + dnl The newer VFP instructions assume little-endian order + dnl consistently. AC_EGREP_CPP([mixed_endianness], [ #if defined arm || defined __arm || defined __arm__ mixed_endianness diff --git a/gnulib-m4/exponentf.m4 b/gnulib-m4/exponentf.m4 index 4d8063f..95e32cd 100644 --- a/gnulib-m4/exponentf.m4 +++ b/gnulib-m4/exponentf.m4 @@ -1,5 +1,5 @@ -# exponentf.m4 serial 1 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# exponentf.m4 serial 2 +dnl Copyright (C) 2007-2008, 2010-2015 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,8 @@ AC_DEFUN([gl_FLOAT_EXPONENT_LOCATION], AC_CACHE_CHECK([where to find the exponent in a 'float'], [gl_cv_cc_float_expbit0], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <float.h> #include <stddef.h> #include <stdio.h> @@ -72,7 +73,7 @@ int main () fprintf (fp, "unknown"); return (fclose (fp) != 0); } - ], + ]])], [gl_cv_cc_float_expbit0=`cat conftest.out`], [gl_cv_cc_float_expbit0="unknown"], [gl_cv_cc_float_expbit0="word 0 bit 23"]) diff --git a/gnulib-m4/exponentl.m4 b/gnulib-m4/exponentl.m4 index a700d3b..6b95e73 100644 --- a/gnulib-m4/exponentl.m4 +++ b/gnulib-m4/exponentl.m4 @@ -1,5 +1,5 @@ -# exponentl.m4 serial 2 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# exponentl.m4 serial 3 +dnl Copyright (C) 2007-2015 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. @@ -9,7 +9,8 @@ AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION], AC_CACHE_CHECK([where to find the exponent in a 'long double'], [gl_cv_cc_long_double_expbit0], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <float.h> #include <stddef.h> #include <stdio.h> @@ -74,7 +75,7 @@ int main () fprintf (fp, "unknown"); return (fclose (fp) != 0); } - ], + ]])], [gl_cv_cc_long_double_expbit0=`cat conftest.out`], [gl_cv_cc_long_double_expbit0="unknown"], [ diff --git a/gnulib-m4/extensions.m4 b/gnulib-m4/extensions.m4 index 7d9458a..35bc49c 100644 --- a/gnulib-m4/extensions.m4 +++ b/gnulib-m4/extensions.m4 @@ -1,14 +1,14 @@ -# serial 9 -*- Autoconf -*- +# serial 13 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2015 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. -# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS +# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git # Autoconf. Perhaps we can remove this once we can assume Autoconf -# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly +# 2.70 or later 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. @@ -30,6 +30,7 @@ # ------------------------ # 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 @@ -38,39 +39,39 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl - AC_REQUIRE([AC_CANONICAL_HOST]) - 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 + [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 - dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, - dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already - dnl provided. - case "$host_os" in - hpux*) - AC_DEFINE([_XOPEN_SOURCE], [500], - [Define to 500 only on HP-UX.]) - ;; - esac - - AH_VERBATIM([__EXTENSIONS__], +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], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif +/* Enable general extensions on OS X. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif +/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS @@ -79,6 +80,12 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl #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. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ @@ -95,9 +102,27 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) + AC_DEFINE([__USE_MINGW_ANSI_STDIO]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) 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]) ])# AC_USE_SYSTEM_EXTENSIONS # gl_USE_SYSTEM_EXTENSIONS diff --git a/gnulib-m4/extern-inline.m4 b/gnulib-m4/extern-inline.m4 new file mode 100644 index 0000000..7280065 --- /dev/null +++ b/gnulib-m4/extern-inline.m4 @@ -0,0 +1,101 @@ +dnl 'extern inline' a la ISO C99. + +dnl Copyright 2012-2015 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_EXTERN_INLINE], +[ + AH_VERBATIM([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>. + + 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 + (void) { } inline void g (void) { f (); }', c99 incorrectly complains + 'reference to static identifier "f" in extern inline function'. + This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + + Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) + on configurations that mistakenly use 'static inline' to implement + functions or macros in standard C headers like <ctype.h>. For example, + 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: + + OS X 10.8 and earlier; see: + http://lists.gnu.org/archive/html/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 + + FreeBSD; see: + http://lists.gnu.org/archive/html/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. */ +#if (((defined __APPLE__ && defined __MACH__) \ + || defined __DragonFly__ || defined __FreeBSD__) \ + && (defined __header_inline \ + ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ + && ! defined __clang__) \ + : ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus)))) +# define _GL_EXTERN_INLINE_STDHEADER_BUG +#endif +#if ((__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : (199901L <= __STDC_VERSION__ \ + && !defined __HP_cc \ + && !(defined __SUNPRO_C && __STDC__))) \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE +#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) +# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE +#else +# define _GL_INLINE static _GL_UNUSED +# define _GL_EXTERN_INLINE static _GL_UNUSED +#endif + +/* In GCC 4.6 (inclusive) to 5.1 (exclusive), + suppress bogus "no previous prototype for 'FOO'" + and "no previous declaration for 'FOO'" diagnostics, + when FOO is an inline function in the header; see + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and + <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */ +#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +]) diff --git a/gnulib-m4/fcntl-o.m4 b/gnulib-m4/fcntl-o.m4 index d416a61..891a62f 100644 --- a/gnulib-m4/fcntl-o.m4 +++ b/gnulib-m4/fcntl-o.m4 @@ -1,5 +1,5 @@ -# fcntl-o.m4 serial 1 -dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. +# fcntl-o.m4 serial 4 +dnl Copyright (C) 2006, 2009-2015 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,13 +12,26 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_FCNTL_O_FLAGS], [ dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW. - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + 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_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([symlink]) AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include <sys/types.h> #include <sys/stat.h> - #include <unistd.h> + #if HAVE_UNISTD_H + # include <unistd.h> + #else /* on Windows with MSVC */ + # include <io.h> + # include <stdlib.h> + # defined sleep(n) _sleep ((n) * 1000) + #endif #include <fcntl.h> #ifndef O_NOATIME #define O_NOATIME 0 @@ -33,34 +46,74 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], }; ]], [[ - int status = !constants; + int result = !constants; + #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; - if (symlink (".", sym) != 0 - || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) - status |= 32; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } unlink (sym); } + #endif { static char const file[] = "confdefs.h"; int fd = open (file, O_RDONLY | O_NOATIME); - char c; - struct stat st0, st1; - if (fd < 0 - || fstat (fd, &st0) != 0 - || sleep (1) != 0 - || read (fd, &c, 1) != 1 - || close (fd) != 0 - || stat (file, &st1) != 0 - || st0.st_atime != st1.st_atime) - status |= 64; + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } } - return status;]])], + return result;]])], [gl_cv_header_working_fcntl_h=yes], [case $? in #( - 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( - 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + 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])]) diff --git a/gnulib-m4/fdopen.m4 b/gnulib-m4/fdopen.m4 new file mode 100644 index 0000000..8c57b99 --- /dev/null +++ b/gnulib-m4/fdopen.m4 @@ -0,0 +1,47 @@ +# fdopen.m4 serial 3 +dnl Copyright (C) 2011-2015 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_FDOPEN], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + else + dnl Test whether fdopen() sets errno when it fails due to a bad fd argument. + AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <errno.h> +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp == NULL && errno == 0) + return 1; + return 0; +}]])], + [gl_cv_func_fdopen_works=yes], + [gl_cv_func_fdopen_works=no], + [case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi +]) + +dnl Prerequisites of lib/fdopen.c. +AC_DEFUN([gl_PREREQ_FDOPEN], []) diff --git a/gnulib-m4/float_h.m4 b/gnulib-m4/float_h.m4 index a74a0d9..e4853f3 100644 --- a/gnulib-m4/float_h.m4 +++ b/gnulib-m4/float_h.m4 @@ -1,5 +1,5 @@ -# float_h.m4 serial 3 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# float_h.m4 serial 9 +dnl Copyright (C) 2007, 2009-2015 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. @@ -9,11 +9,90 @@ AC_DEFUN([gl_FLOAT_H], AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) FLOAT_H= + REPLACE_FLOAT_LDBL=0 case "$host_os" in - beos* | openbsd*) + aix* | beos* | openbsd* | mirbsd* | irix*) FLOAT_H=float.h - gl_CHECK_NEXT_HEADERS([float.h]) + ;; + freebsd*) + case "$host_cpu" in +changequote(,)dnl + i[34567]86 ) +changequote([,])dnl + FLOAT_H=float.h + ;; + 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], + [], + [FLOAT_H=float.h]) + ;; + esac + ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; + esac + case "$host_os" in + aix* | freebsd* | linux*) + if test -n "$FLOAT_H"; then + REPLACE_FLOAT_LDBL=1 + fi ;; esac + + dnl Test against glibc-2.7 Linux/SPARC64 bug. + REPLACE_ITOLD=0 + AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], + [gl_cv_func_itold_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +}]])], + [gl_cv_func_itold_works=yes], + [gl_cv_func_itold_works=no], + [case "$host" in + sparc*-*-linux*) + AC_EGREP_CPP([yes], + [#if defined __LP64__ || defined __arch64__ + yes + #endif], + [gl_cv_func_itold_works="guessing no"], + [gl_cv_func_itold_works="guessing yes"]) + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + dnl We add the workaround to <float.h> but also to <math.h>, + dnl to increase the chances that the fix function gets pulled in. + FLOAT_H=float.h + ;; + esac + + if test -n "$FLOAT_H"; then + gl_NEXT_HEADERS([float.h]) + fi AC_SUBST([FLOAT_H]) + AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) + AC_SUBST([REPLACE_ITOLD]) ]) diff --git a/gnulib-m4/fpieee.m4 b/gnulib-m4/fpieee.m4 index 532802d..a4e4899 100644 --- a/gnulib-m4/fpieee.m4 +++ b/gnulib-m4/fpieee.m4 @@ -1,5 +1,5 @@ -# fpieee.m4 serial 1 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# fpieee.m4 serial 2 +dnl Copyright (C) 2007, 2009-2015 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. @@ -36,9 +36,11 @@ AC_DEFUN([gl_FP_IEEE], # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> if test -n "$GCC"; then # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. CPPFLAGS="$CPPFLAGS -mieee" else - # Compaq (ex-DEC) C has the option -ieee. + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. CPPFLAGS="$CPPFLAGS -ieee" fi ;; diff --git a/gnulib-m4/frexp.m4 b/gnulib-m4/frexp.m4 index 3a450f6..04f4067 100644 --- a/gnulib-m4/frexp.m4 +++ b/gnulib-m4/frexp.m4 @@ -1,5 +1,5 @@ -# frexp.m4 serial 7 -dnl Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# frexp.m4 serial 15 +dnl Copyright (C) 2007-2015 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,25 +7,19 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FREXP], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) FREXP_LIBM= - AC_CACHE_CHECK([whether frexp() can be used without linking with libm], - [gl_cv_func_frexp_no_libm], - [ - AC_TRY_LINK([#include <math.h> - double x;], - [int e; return frexp (x, &e) > 0;], - [gl_cv_func_frexp_no_libm=yes], - [gl_cv_func_frexp_no_libm=no]) - ]) if test $gl_cv_func_frexp_no_libm = no; then AC_CACHE_CHECK([whether frexp() can be used with libm], [gl_cv_func_frexp_in_libm], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include <math.h> - double x;], - [int e; return frexp (x, &e) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + double x;]], + [[int e; return frexp (x, &e) > 0;]])], [gl_cv_func_frexp_in_libm=yes], [gl_cv_func_frexp_in_libm=no]) LIBS="$save_LIBS" @@ -50,8 +44,6 @@ AC_DEFUN([gl_FUNC_FREXP], if test $gl_func_frexp = yes; then AC_DEFINE([HAVE_FREXP], [1], [Define if the frexp() function is available and works.]) - else - AC_LIBOBJ([frexp]) fi AC_SUBST([FREXP_LIBM]) ]) @@ -59,15 +51,7 @@ AC_DEFUN([gl_FUNC_FREXP], AC_DEFUN([gl_FUNC_FREXP_NO_LIBM], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) - AC_CACHE_CHECK([whether frexp() can be used without linking with libm], - [gl_cv_func_frexp_no_libm], - [ - AC_TRY_LINK([#include <math.h> - double x;], - [int e; return frexp (x, &e) > 0;], - [gl_cv_func_frexp_no_libm=yes], - [gl_cv_func_frexp_no_libm=no]) - ]) + AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) if test $gl_cv_func_frexp_no_libm = yes; then gl_FUNC_FREXP_WORKS case "$gl_cv_func_frexp_works" in @@ -82,31 +66,71 @@ AC_DEFUN([gl_FUNC_FREXP_NO_LIBM], if test $gl_func_frexp_no_libm = yes; then AC_DEFINE([HAVE_FREXP_IN_LIBC], [1], [Define if the frexp() function is available in libc.]) - else - AC_LIBOBJ([frexp]) fi ]) +dnl Test whether frexp() can be used without linking with libm. +dnl Set gl_cv_func_frexp_no_libm to 'yes' or 'no' accordingly. +AC_DEFUN([gl_CHECK_FREXP_NO_LIBM], +[ + AC_CACHE_CHECK([whether frexp() can be used without linking with libm], + [gl_cv_func_frexp_no_libm], + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + double x;]], + [[int e; return frexp (x, &e) > 0;]])], + [gl_cv_func_frexp_no_libm=yes], + [gl_cv_func_frexp_no_libm=no]) + ]) +]) + dnl Test whether frexp() works also on denormalized numbers (this fails e.g. on dnl NetBSD 3.0), on infinite numbers (this fails e.g. on IRIX 6.5 and mingw), -dnl and on negative zero (this fails e.g. on NetBSD 4.99). +dnl and on negative zero (this fails e.g. on NetBSD 4.99 and mingw). AC_DEFUN([gl_FUNC_FREXP_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_DECLS_ONCE([alarm]) AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <float.h> #include <math.h> #include <string.h> +#if HAVE_DECL_ALARM +# include <signal.h> +# include <unistd.h> +#endif +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -DBL_MIN * DBL_MIN does not work when cross-compiling + to PowerPC on Mac OS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static double +compute_minus_zero (void) +{ + return -DBL_MIN * DBL_MIN; +} +# define minus_zero compute_minus_zero () +#else +double minus_zero = -0.0; +#endif int main() { + int result = 0; int i; volatile double x; -/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. - So we use -zero instead. */ double zero = 0.0; +#if HAVE_DECL_ALARM + /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite + number. Let the test fail in this case. */ + signal (SIGALRM, SIG_DFL); + alarm (5); +#endif /* Test on denormalized numbers. */ for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) ; @@ -117,30 +141,32 @@ int main() /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. On NetBSD: y = 0.75. Correct: y = 0.5. */ if (y != 0.5) - return 1; + result |= 1; } /* Test on infinite numbers. */ - x = 1.0 / 0.0; + x = 1.0 / zero; { int exp; double y = frexp (x, &exp); if (y != x) - return 1; + result |= 2; } /* Test on negative zero. */ - x = -zero; + x = minus_zero; { int exp; double y = frexp (x, &exp); if (memcmp (&y, &x, sizeof x)) - return 1; + result |= 4; } - return 0; -}], [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";; - esac - ]) + return result; +}]])], + [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";; + esac + ]) ]) ]) diff --git a/gnulib-m4/frexpl.m4 b/gnulib-m4/frexpl.m4 index 8016520..cd3ac6e 100644 --- a/gnulib-m4/frexpl.m4 +++ b/gnulib-m4/frexpl.m4 @@ -1,5 +1,5 @@ -# frexpl.m4 serial 9 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# frexpl.m4 serial 20 +dnl Copyright (C) 2007-2015 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,29 +7,29 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FREXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + + dnl Persuade glibc <math.h> to declare frexpl(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Check whether it's declared. - dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. - AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>]) + dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. + AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]]) + FREXPL_LIBM= if test $HAVE_DECL_FREXPL = 1; then - AC_CACHE_CHECK([whether frexpl() can be used without linking with libm], - [gl_cv_func_frexpl_no_libm], - [ - AC_TRY_LINK([#include <math.h> - long double x;], - [int e; return frexpl (x, &e) > 0;], - [gl_cv_func_frexpl_no_libm=yes], - [gl_cv_func_frexpl_no_libm=no]) - ]) + gl_CHECK_FREXPL_NO_LIBM if test $gl_cv_func_frexpl_no_libm = no; then AC_CACHE_CHECK([whether frexpl() can be used with libm], [gl_cv_func_frexpl_in_libm], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include <math.h> - long double x;], - [int e; return frexpl (x, &e) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + long double x;]], + [[int e; return frexpl (x, &e) > 0;]])], [gl_cv_func_frexpl_in_libm=yes], [gl_cv_func_frexpl_in_libm=no]) LIBS="$save_LIBS" @@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_FREXPL], LIBS="$save_LIBS" case "$gl_cv_func_frexpl_works" in *yes) gl_func_frexpl=yes ;; - *) gl_func_frexpl=no; REPLACE_FREXPL=1; FREXPL_LIBM= ;; + *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; esac else gl_func_frexpl=no @@ -57,7 +57,13 @@ AC_DEFUN([gl_FUNC_FREXPL], fi fi if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then - AC_LIBOBJ([frexpl]) + dnl Find libraries needed to link lib/frexpl.c. + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + AC_REQUIRE([gl_FUNC_FREXP]) + FREXPL_LIBM="$FREXP_LIBM" + else + FREXPL_LIBM= + fi fi AC_SUBST([FREXPL_LIBM]) ]) @@ -65,19 +71,12 @@ AC_DEFUN([gl_FUNC_FREXPL], AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) dnl Check whether it's declared. - dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. - AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>]) + dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. + AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]]) if test $HAVE_DECL_FREXPL = 1; then - AC_CACHE_CHECK([whether frexpl() can be used without linking with libm], - [gl_cv_func_frexpl_no_libm], - [ - AC_TRY_LINK([#include <math.h> - long double x;], - [int e; return frexpl (x, &e) > 0;], - [gl_cv_func_frexpl_no_libm=yes], - [gl_cv_func_frexpl_no_libm=no]) - ]) + gl_CHECK_FREXPL_NO_LIBM if test $gl_cv_func_frexpl_no_libm = yes; then gl_FUNC_FREXPL_WORKS case "$gl_cv_func_frexpl_works" in @@ -94,14 +93,28 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM], [Define if the frexpl() function is available in libc.]) fi fi - if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then - AC_LIBOBJ([frexpl]) - fi +]) + +dnl Test whether frexpl() can be used without linking with libm. +dnl Set gl_cv_func_frexpl_no_libm to 'yes' or 'no' accordingly. +AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM], +[ + AC_CACHE_CHECK([whether frexpl() can be used without linking with libm], + [gl_cv_func_frexpl_no_libm], + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + long double x;]], + [[int e; return frexpl (x, &e) > 0;]])], + [gl_cv_func_frexpl_no_libm=yes], + [gl_cv_func_frexpl_no_libm=no]) + ]) ]) dnl Test whether frexpl() works on finite numbers (this fails on -dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers -dnl (this fails on MacOS X 10.5/i386), and also on infinite numbers (this +dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers +dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this dnl fails e.g. on IRIX 6.5 and mingw). AC_DEFUN([gl_FUNC_FREXPL_WORKS], [ @@ -109,7 +122,8 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS], AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether frexpl works], [gl_cv_func_frexpl_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <float.h> #include <math.h> /* Override the values of <float.h>, like done in float.in.h. */ @@ -117,9 +131,28 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS], # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif -extern long double frexpl (long double, int *); +#if defined __i386__ && defined __FreeBSD__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +#endif +#if defined __sgi && (LDBL_MANT_DIG >= 106) +# if defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +# endif +#endif +extern +#ifdef __cplusplus +"C" +#endif +long double frexpl (long double, int *); int main() { + int result = 0; volatile long double x; /* Test on finite numbers that fails on AIX 5.1. */ x = 16.0L; @@ -127,9 +160,9 @@ int main() int exp = -9999; frexpl (x, &exp); if (exp != 5) - return 1; + result |= 1; } - /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl + /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl function returns an invalid (incorrectly normalized) value: it returns y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } but the correct result is @@ -139,7 +172,7 @@ int main() int exp = -9999; long double y = frexpl (x, &exp); if (!(exp == 1 && y == 0.505L)) - return 1; + result |= 2; } /* Test on large finite numbers. This fails on BeOS at i = 16322, while LDBL_MAX_EXP = 16384. @@ -152,7 +185,10 @@ int main() int exp = -9999; frexpl (x, &exp); if (exp != i) - return 1; + { + result |= 4; + break; + } } } /* Test on denormalized numbers. */ @@ -165,9 +201,9 @@ int main() int exp; long double y = frexpl (x, &exp); /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, - exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */ + exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ if (exp != LDBL_MIN_EXP - 1) - return 1; + result |= 8; } } /* Test on infinite numbers. */ @@ -176,15 +212,20 @@ int main() int exp; long double y = frexpl (x, &exp); if (y != x) - return 1; + result |= 16; } - return 0; -}], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no], - [case "$host_os" in - aix* | beos* | darwin* | irix* | mingw* | pw*) - gl_cv_func_frexpl_works="guessing no";; - *) gl_cv_func_frexpl_works="guessing yes";; - esac - ]) + return result; +}]])], + [gl_cv_func_frexpl_works=yes], + [gl_cv_func_frexpl_works=no], + [ +changequote(,)dnl + case "$host_os" in + aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac +changequote([,])dnl + ]) ]) ]) diff --git a/gnulib-m4/fseterr.m4 b/gnulib-m4/fseterr.m4 new file mode 100644 index 0000000..f687ef5 --- /dev/null +++ b/gnulib-m4/fseterr.m4 @@ -0,0 +1,10 @@ +# fseterr.m4 serial 1 +dnl Copyright (C) 2012-2015 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_FSETERR], +[ + AC_CHECK_FUNCS_ONCE([__fseterr]) +]) diff --git a/gnulib-m4/getpagesize.m4 b/gnulib-m4/getpagesize.m4 index 313ad7f..7057a21 100644 --- a/gnulib-m4/getpagesize.m4 +++ b/gnulib-m4/getpagesize.m4 @@ -1,5 +1,5 @@ -# getpagesize.m4 serial 8 -dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2010 Free Software Foundation, +# getpagesize.m4 serial 9 +dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2015 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, @@ -24,7 +24,6 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE], case "$host_os" in mingw*) REPLACE_GETPAGESIZE=1 - AC_LIBOBJ([getpagesize]) ;; esac dnl Also check whether it's declared. diff --git a/gnulib-m4/glibc21.m4 b/gnulib-m4/glibc21.m4 index 68ada9d..3a971c5 100644 --- a/gnulib-m4/glibc21.m4 +++ b/gnulib-m4/glibc21.m4 @@ -1,17 +1,18 @@ -# glibc21.m4 serial 4 -dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc. +# glibc21.m4 serial 5 +dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2015 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. +# 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 newer], + 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 GNU user], + [AC_EGREP_CPP([Lucky], [ #include <features.h> #ifdef __GNU_LIBRARY__ @@ -19,6 +20,9 @@ AC_DEFUN([gl_GLIBC21], Lucky GNU user #endif #endif +#ifdef __UCLIBC__ + Lucky user +#endif ], [ac_cv_gnu_library_2_1=yes], [ac_cv_gnu_library_2_1=no]) diff --git a/gnulib-m4/gnulib-cache.m4 b/gnulib-m4/gnulib-cache.m4 index 72bc8cc..3173b62 100644 --- a/gnulib-m4/gnulib-cache.m4 +++ b/gnulib-m4/gnulib-cache.m4 @@ -1,21 +1,33 @@ -# Copyright (C) 2002-2010 Free Software Foundation, Inc. +# Copyright (C) 2002-2015 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# 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 +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the specification of how gnulib-tool is used. # It acts as a cache: It is written and read by gnulib-tool. -# In projects using CVS, this file is meant to be stored in CVS, -# like the configure.ac and various Makefile.am files. +# In projects that use version control, this file is meant to be put under +# version control, like the configure.ac and various Makefile.am files. # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libunistring --source-base=lib --m4-base=gnulib-m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --lgpl --makefile-name=Makefile.gnulib --libtool --macro-prefix=gl relocatable-lib-lgpl unicase/base unicase/empty-prefix-context unicase/empty-suffix-context unicase/locale-language unicase/tolower unicase/totitle unicase/toupper unicase/u16-casecmp unicase/u16-casecoll unicase/u16-casefold unicase/u16-casexfrm unicase/u16-ct-casefold unicase/u16-ct-tolower unicase/u16-ct-totitle unicase/u16-ct-toupper unicase/u16-is-cased unicase/u16-is-casefolded unicase/u16-is-lowercase unicase/u16-is-titlecase unicase/u16-is-uppercase unicase/u16-tolower unicase/u16-totitle unicase/u16-toupper unicase/u32-casecmp unicase/u32-casecoll unicase/u32-casefold unicase/u32-casexfrm unicase/u32-ct-casefold unicase/u32-ct-tolower unicase/u32-ct-totitle unicase/u32-ct-toupper unicase/u32-is-cased unicase/u32-is-casefolded unicase/u32-is-lowercase unicase/u32-is-titlecase unicase/u32-is-uppercase unicase/u32-tolower unicase/u32-totitle unicase/u32-toupper unicase/u8-casecmp unicase/u8-casecoll unicase/u8-casefold unicase/u8-casexfrm unicase/u8-ct-casefold unicase/u8-ct-tolower unicase/u8-ct-totitle unicase/u8-ct-toupper unicase/u8-is-cased unicase/u8-is-casefolded unicase/u8-is-lowercase unicase/u8-is-titlecase unicase/u8-is-uppercase unicase/u8-tolower unicase/u8-totitle unicase/u8-toupper unicase/ulc-casecmp unicase/ulc-casecoll unicase/ulc-casexfrm uniconv/base uniconv/u16-conv-from-enc uniconv/u16-conv-to-enc uniconv/u16-strconv-from-enc uniconv/u16-strconv-from-locale uniconv/u16-strconv-to-enc uniconv/u16-strconv-to-locale uniconv/u32-conv-from-enc uniconv/u32-conv-to-enc uniconv/u32-strconv-from-enc uniconv/u32-strconv-from-locale uniconv/u32-strconv-to-enc uniconv/u32-strconv-to-locale uniconv/u8-conv-from-enc uniconv/u8-conv-to-enc uniconv/u8-strconv-from-enc uniconv/u8-strconv-from-locale uniconv/u8-strconv-to-enc uniconv/u8-strconv-to-locale unictype/base unictype/bidicategory-all unictype/block-all unictype/category-all unictype/combining-class unictype/ctype-alnum unictype/ctype-alpha unictype/ctype-blank unictype/ctype-cntrl unictype/ctype-digit unictype/ctype-graph unictype/ctype-lower unictype/ctype-print unictype/ctype-punct unictype/ctype-space unictype/ctype-upper unictype/ctype-xdigit unictype/decimal-digit unictype/digit unictype/mirror unictype/numeric unictype/property-all unictype/scripts-all unictype/syntax-c-ident unictype/syntax-c-whitespace unictype/syntax-java-ident unictype/syntax-java-whitespace unilbrk/base unilbrk/u16-possible-linebreaks unilbrk/u16-width-linebreaks unilbrk/u32-possible-linebreaks unilbrk/u32-width-linebreaks unilbrk/u8-possible-linebreaks unilbrk/u8-width-linebreaks unilbrk/ulc-possible-linebreaks unilbrk/ulc-width-linebreaks uniname/base uniname/uniname uninorm/base uninorm/canonical-decomposition uninorm/composition uninorm/decomposition uninorm/filter uninorm/nfc uninorm/nfd uninorm/nfkc uninorm/nfkd uninorm/u16-normalize uninorm/u16-normcmp uninorm/u16-normcoll uninorm/u16-normxfrm uninorm/u32-normalize uninorm/u32-normcmp uninorm/u32-normcoll uninorm/u32-normxfrm uninorm/u8-normalize uninorm/u8-normcmp uninorm/u8-normcoll uninorm/u8-normxfrm unistdio/base unistdio/u16-asnprintf unistdio/u16-asprintf unistdio/u16-snprintf unistdio/u16-sprintf unistdio/u16-u16-asnprintf unistdio/u16-u16-asprintf unistdio/u16-u16-snprintf unistdio/u16-u16-sprintf unistdio/u16-u16-vasnprintf unistdio/u16-u16-vasprintf unistdio/u16-u16-vsnprintf unistdio/u16-u16-vsprintf unistdio/u16-vasnprintf unistdio/u16-vasprintf unistdio/u16-vsnprintf unistdio/u16-vsprintf unistdio/u32-asnprintf unistdio/u32-asprintf unistdio/u32-snprintf unistdio/u32-sprintf unistdio/u32-u32-asnprintf unistdio/u32-u32-asprintf unistdio/u32-u32-snprintf unistdio/u32-u32-sprintf unistdio/u32-u32-vasnprintf unistdio/u32-u32-vasprintf unistdio/u32-u32-vsnprintf unistdio/u32-u32-vsprintf unistdio/u32-vasnprintf unistdio/u32-vasprintf unistdio/u32-vsnprintf unistdio/u32-vsprintf unistdio/u8-asnprintf unistdio/u8-asprintf unistdio/u8-snprintf unistdio/u8-sprintf unistdio/u8-u8-asnprintf unistdio/u8-u8-asprintf unistdio/u8-u8-snprintf unistdio/u8-u8-sprintf unistdio/u8-u8-vasnprintf unistdio/u8-u8-vasprintf unistdio/u8-u8-vsnprintf unistdio/u8-u8-vsprintf unistdio/u8-vasnprintf unistdio/u8-vasprintf unistdio/u8-vsnprintf unistdio/u8-vsprintf unistdio/ulc-asnprintf unistdio/ulc-asprintf unistdio/ulc-fprintf unistdio/ulc-snprintf unistdio/ulc-sprintf unistdio/ulc-vasnprintf unistdio/ulc-vasprintf unistdio/ulc-vfprintf unistdio/ulc-vsnprintf unistdio/ulc-vsprintf unistr/base unistr/u16-check unistr/u16-chr unistr/u16-cmp unistr/u16-cmp2 unistr/u16-cpy unistr/u16-cpy-alloc unistr/u16-endswith unistr/u16-mblen unistr/u16-mbsnlen unistr/u16-mbtouc unistr/u16-mbtouc-unsafe unistr/u16-mbtoucr unistr/u16-move unistr/u16-next unistr/u16-prev unistr/u16-set unistr/u16-startswith unistr/u16-stpcpy unistr/u16-stpncpy unistr/u16-strcat unistr/u16-strchr unistr/u16-strcmp unistr/u16-strcoll unistr/u16-strcpy unistr/u16-strcspn unistr/u16-strdup unistr/u16-strlen unistr/u16-strmblen unistr/u16-strmbtouc unistr/u16-strncat unistr/u16-strncmp unistr/u16-strncpy unistr/u16-strnlen unistr/u16-strpbrk unistr/u16-strrchr unistr/u16-strspn unistr/u16-strstr unistr/u16-strtok unistr/u16-to-u32 unistr/u16-to-u8 unistr/u16-uctomb unistr/u32-check unistr/u32-chr unistr/u32-cmp unistr/u32-cmp2 unistr/u32-cpy unistr/u32-cpy-alloc unistr/u32-endswith unistr/u32-mblen unistr/u32-mbsnlen unistr/u32-mbtouc unistr/u32-mbtouc-unsafe unistr/u32-mbtoucr unistr/u32-move unistr/u32-next unistr/u32-prev unistr/u32-set unistr/u32-startswith unistr/u32-stpcpy unistr/u32-stpncpy unistr/u32-strcat unistr/u32-strchr unistr/u32-strcmp unistr/u32-strcoll unistr/u32-strcpy unistr/u32-strcspn unistr/u32-strdup unistr/u32-strlen unistr/u32-strmblen unistr/u32-strmbtouc unistr/u32-strncat unistr/u32-strncmp unistr/u32-strncpy unistr/u32-strnlen unistr/u32-strpbrk unistr/u32-strrchr unistr/u32-strspn unistr/u32-strstr unistr/u32-strtok unistr/u32-to-u16 unistr/u32-to-u8 unistr/u32-uctomb unistr/u8-check unistr/u8-chr unistr/u8-cmp unistr/u8-cmp2 unistr/u8-cpy unistr/u8-cpy-alloc unistr/u8-endswith unistr/u8-mblen unistr/u8-mbsnlen unistr/u8-mbtouc unistr/u8-mbtouc-unsafe unistr/u8-mbtoucr unistr/u8-move unistr/u8-next unistr/u8-prev unistr/u8-set unistr/u8-startswith unistr/u8-stpcpy unistr/u8-stpncpy unistr/u8-strcat unistr/u8-strchr unistr/u8-strcmp unistr/u8-strcoll unistr/u8-strcpy unistr/u8-strcspn unistr/u8-strdup unistr/u8-strlen unistr/u8-strmblen unistr/u8-strmbtouc unistr/u8-strncat unistr/u8-strncmp unistr/u8-strncpy unistr/u8-strnlen unistr/u8-strpbrk unistr/u8-strrchr unistr/u8-strspn unistr/u8-strstr unistr/u8-strtok unistr/u8-to-u16 unistr/u8-to-u32 unistr/u8-uctomb unitypes uniwbrk/base uniwbrk/u16-wordbreaks uniwbrk/u32-wordbreaks uniwbrk/u8-wordbreaks uniwbrk/ulc-wordbreaks uniwbrk/wordbreak-property uniwidth/base uniwidth/u16-strwidth uniwidth/u16-width uniwidth/u32-strwidth uniwidth/u32-width uniwidth/u8-strwidth uniwidth/u8-width uniwidth/width +# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libunistring --source-base=lib --m4-base=gnulib-m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --lgpl --makefile-name=Makefile.gnulib --no-conditional-dependencies --libtool --macro-prefix=gl relocatable-lib-lgpl unicase/base unicase/empty-prefix-context unicase/empty-suffix-context unicase/locale-language unicase/tolower unicase/totitle unicase/toupper unicase/u16-casecmp unicase/u16-casecoll unicase/u16-casefold unicase/u16-casexfrm unicase/u16-ct-casefold unicase/u16-ct-tolower unicase/u16-ct-totitle unicase/u16-ct-toupper unicase/u16-is-cased unicase/u16-is-casefolded unicase/u16-is-lowercase unicase/u16-is-titlecase unicase/u16-is-uppercase unicase/u16-tolower unicase/u16-totitle unicase/u16-toupper unicase/u32-casecmp unicase/u32-casecoll unicase/u32-casefold unicase/u32-casexfrm unicase/u32-ct-casefold unicase/u32-ct-tolower unicase/u32-ct-totitle unicase/u32-ct-toupper unicase/u32-is-cased unicase/u32-is-casefolded unicase/u32-is-lowercase unicase/u32-is-titlecase unicase/u32-is-uppercase unicase/u32-tolower unicase/u32-totitle unicase/u32-toupper unicase/u8-casecmp unicase/u8-casecoll unicase/u8-casefold unicase/u8-casexfrm unicase/u8-ct-casefold unicase/u8-ct-tolower unicase/u8-ct-totitle unicase/u8-ct-toupper unicase/u8-is-cased unicase/u8-is-casefolded unicase/u8-is-lowercase unicase/u8-is-titlecase unicase/u8-is-uppercase unicase/u8-tolower unicase/u8-totitle unicase/u8-toupper unicase/ulc-casecmp unicase/ulc-casecoll unicase/ulc-casexfrm uniconv/base uniconv/u16-conv-from-enc uniconv/u16-conv-to-enc uniconv/u16-strconv-from-enc uniconv/u16-strconv-from-locale uniconv/u16-strconv-to-enc uniconv/u16-strconv-to-locale uniconv/u32-conv-from-enc uniconv/u32-conv-to-enc uniconv/u32-strconv-from-enc uniconv/u32-strconv-from-locale uniconv/u32-strconv-to-enc uniconv/u32-strconv-to-locale uniconv/u8-conv-from-enc uniconv/u8-conv-to-enc uniconv/u8-strconv-from-enc uniconv/u8-strconv-from-locale uniconv/u8-strconv-to-enc uniconv/u8-strconv-to-locale unictype/base unictype/bidiclass-all unictype/block-all unictype/category-all unictype/combining-class-all unictype/ctype-alnum unictype/ctype-alpha unictype/ctype-blank unictype/ctype-cntrl unictype/ctype-digit unictype/ctype-graph unictype/ctype-lower unictype/ctype-print unictype/ctype-punct unictype/ctype-space unictype/ctype-upper unictype/ctype-xdigit unictype/decimal-digit unictype/digit unictype/joininggroup-all unictype/joiningtype-all unictype/mirror unictype/numeric unictype/property-all unictype/scripts-all unictype/syntax-c-ident unictype/syntax-c-whitespace unictype/syntax-java-ident unictype/syntax-java-whitespace unigbrk/base unigbrk/u16-grapheme-breaks unigbrk/u16-grapheme-next unigbrk/u16-grapheme-prev unigbrk/u32-grapheme-breaks unigbrk/u32-grapheme-next unigbrk/u32-grapheme-prev unigbrk/u8-grapheme-breaks unigbrk/u8-grapheme-next unigbrk/u8-grapheme-prev unigbrk/uc-gbrk-prop unigbrk/uc-is-grapheme-break unigbrk/ulc-grapheme-breaks unilbrk/base unilbrk/u16-possible-linebreaks unilbrk/u16-width-linebreaks unilbrk/u32-possible-linebreaks unilbrk/u32-width-linebreaks unilbrk/u8-possible-linebreaks unilbrk/u8-width-linebreaks unilbrk/ulc-possible-linebreaks unilbrk/ulc-width-linebreaks uniname/base uniname/uniname uninorm/base uninorm/canonical-decomposition uninorm/composition uninorm/decomposition uninorm/filter uninorm/nfc uninorm/nfd uninorm/nfkc uninorm/nfkd uninorm/u16-normalize uninorm/u16-normcmp uninorm/u16-normcoll uninorm/u16-normxfrm uninorm/u32-normalize uninorm/u32-normcmp uninorm/u32-normcoll uninorm/u32-normxfrm uninorm/u8-normalize uninorm/u8-normcmp uninorm/u8-normcoll uninorm/u8-normxfrm unistdio/base unistdio/u16-asnprintf unistdio/u16-asprintf unistdio/u16-snprintf unistdio/u16-sprintf unistdio/u16-u16-asnprintf unistdio/u16-u16-asprintf unistdio/u16-u16-snprintf unistdio/u16-u16-sprintf unistdio/u16-u16-vasnprintf unistdio/u16-u16-vasprintf unistdio/u16-u16-vsnprintf unistdio/u16-u16-vsprintf unistdio/u16-vasnprintf unistdio/u16-vasprintf unistdio/u16-vsnprintf unistdio/u16-vsprintf unistdio/u32-asnprintf unistdio/u32-asprintf unistdio/u32-snprintf unistdio/u32-sprintf unistdio/u32-u32-asnprintf unistdio/u32-u32-asprintf unistdio/u32-u32-snprintf unistdio/u32-u32-sprintf unistdio/u32-u32-vasnprintf unistdio/u32-u32-vasprintf unistdio/u32-u32-vsnprintf unistdio/u32-u32-vsprintf unistdio/u32-vasnprintf unistdio/u32-vasprintf unistdio/u32-vsnprintf unistdio/u32-vsprintf unistdio/u8-asnprintf unistdio/u8-asprintf unistdio/u8-snprintf unistdio/u8-sprintf unistdio/u8-u8-asnprintf unistdio/u8-u8-asprintf unistdio/u8-u8-snprintf unistdio/u8-u8-sprintf unistdio/u8-u8-vasnprintf unistdio/u8-u8-vasprintf unistdio/u8-u8-vsnprintf unistdio/u8-u8-vsprintf unistdio/u8-vasnprintf unistdio/u8-vasprintf unistdio/u8-vsnprintf unistdio/u8-vsprintf unistdio/ulc-asnprintf unistdio/ulc-asprintf unistdio/ulc-fprintf unistdio/ulc-snprintf unistdio/ulc-sprintf unistdio/ulc-vasnprintf unistdio/ulc-vasprintf unistdio/ulc-vfprintf unistdio/ulc-vsnprintf unistdio/ulc-vsprintf unistr/base unistr/u16-check unistr/u16-chr unistr/u16-cmp unistr/u16-cmp2 unistr/u16-cpy unistr/u16-cpy-alloc unistr/u16-endswith unistr/u16-mblen unistr/u16-mbsnlen unistr/u16-mbtouc unistr/u16-mbtouc-unsafe unistr/u16-mbtoucr unistr/u16-move unistr/u16-next unistr/u16-prev unistr/u16-set unistr/u16-startswith unistr/u16-stpcpy unistr/u16-stpncpy unistr/u16-strcat unistr/u16-strchr unistr/u16-strcmp unistr/u16-strcoll unistr/u16-strcpy unistr/u16-strcspn unistr/u16-strdup unistr/u16-strlen unistr/u16-strmblen unistr/u16-strmbtouc unistr/u16-strncat unistr/u16-strncmp unistr/u16-strncpy unistr/u16-strnlen unistr/u16-strpbrk unistr/u16-strrchr unistr/u16-strspn unistr/u16-strstr unistr/u16-strtok unistr/u16-to-u32 unistr/u16-to-u8 unistr/u16-uctomb unistr/u32-check unistr/u32-chr unistr/u32-cmp unistr/u32-cmp2 unistr/u32-cpy unistr/u32-cpy-alloc unistr/u32-endswith unistr/u32-mblen unistr/u32-mbsnlen unistr/u32-mbtouc unistr/u32-mbtouc-unsafe unistr/u32-mbtoucr unistr/u32-move unistr/u32-next unistr/u32-prev unistr/u32-set unistr/u32-startswith unistr/u32-stpcpy unistr/u32-stpncpy unistr/u32-strcat unistr/u32-strchr unistr/u32-strcmp unistr/u32-strcoll unistr/u32-strcpy unistr/u32-strcspn unistr/u32-strdup unistr/u32-strlen unistr/u32-strmblen unistr/u32-strmbtouc unistr/u32-strncat unistr/u32-strncmp unistr/u32-strncpy unistr/u32-strnlen unistr/u32-strpbrk unistr/u32-strrchr unistr/u32-strspn unistr/u32-strstr unistr/u32-strtok unistr/u32-to-u16 unistr/u32-to-u8 unistr/u32-uctomb unistr/u8-check unistr/u8-chr unistr/u8-cmp unistr/u8-cmp2 unistr/u8-cpy unistr/u8-cpy-alloc unistr/u8-endswith unistr/u8-mblen unistr/u8-mbsnlen unistr/u8-mbtouc unistr/u8-mbtouc-unsafe unistr/u8-mbtoucr unistr/u8-move unistr/u8-next unistr/u8-prev unistr/u8-set unistr/u8-startswith unistr/u8-stpcpy unistr/u8-stpncpy unistr/u8-strcat unistr/u8-strchr unistr/u8-strcmp unistr/u8-strcoll unistr/u8-strcpy unistr/u8-strcspn unistr/u8-strdup unistr/u8-strlen unistr/u8-strmblen unistr/u8-strmbtouc unistr/u8-strncat unistr/u8-strncmp unistr/u8-strncpy unistr/u8-strnlen unistr/u8-strpbrk unistr/u8-strrchr unistr/u8-strspn unistr/u8-strstr unistr/u8-strtok unistr/u8-to-u16 unistr/u8-to-u32 unistr/u8-uctomb unitypes uniwbrk/base uniwbrk/u16-wordbreaks uniwbrk/u32-wordbreaks uniwbrk/u8-wordbreaks uniwbrk/ulc-wordbreaks uniwbrk/wordbreak-property uniwidth/base uniwidth/u16-strwidth uniwidth/u16-width uniwidth/u32-strwidth uniwidth/u32-width uniwidth/u8-strwidth uniwidth/u8-width uniwidth/width # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gnulib-local]) @@ -99,10 +111,10 @@ gl_MODULES([ uniconv/u8-strconv-to-enc uniconv/u8-strconv-to-locale unictype/base - unictype/bidicategory-all + unictype/bidiclass-all unictype/block-all unictype/category-all - unictype/combining-class + unictype/combining-class-all unictype/ctype-alnum unictype/ctype-alpha unictype/ctype-blank @@ -117,6 +129,8 @@ gl_MODULES([ unictype/ctype-xdigit unictype/decimal-digit unictype/digit + unictype/joininggroup-all + unictype/joiningtype-all unictype/mirror unictype/numeric unictype/property-all @@ -125,6 +139,19 @@ gl_MODULES([ unictype/syntax-c-whitespace unictype/syntax-java-ident unictype/syntax-java-whitespace + unigbrk/base + unigbrk/u16-grapheme-breaks + unigbrk/u16-grapheme-next + unigbrk/u16-grapheme-prev + unigbrk/u32-grapheme-breaks + unigbrk/u32-grapheme-next + unigbrk/u32-grapheme-prev + unigbrk/u8-grapheme-breaks + unigbrk/u8-grapheme-next + unigbrk/u8-grapheme-prev + unigbrk/uc-gbrk-prop + unigbrk/uc-is-grapheme-break + unigbrk/ulc-grapheme-breaks unilbrk/base unilbrk/u16-possible-linebreaks unilbrk/u16-width-linebreaks @@ -369,3 +396,4 @@ gl_MAKEFILE_NAME([Makefile.gnulib]) gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) +gl_WITNESS_C_MACRO([]) diff --git a/gnulib-m4/gnulib-common.m4 b/gnulib-m4/gnulib-common.m4 index 4c7ac30..40e82f6 100644 --- a/gnulib-m4/gnulib-common.m4 +++ b/gnulib-m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 20 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# gnulib-common.m4 serial 36 +dnl Copyright (C) 2007-2015 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,11 +12,25 @@ AC_DEFUN([gl_COMMON], [ AC_REQUIRE([gl_COMMON_BODY]) ]) AC_DEFUN([gl_COMMON_BODY], [ + 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) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif +]) AH_VERBATIM([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. - __APPLE__ && __MACH__ test for MacOS X. + __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ @@ -34,6 +48,30 @@ AC_DEFUN([gl_COMMON_BODY], [ /* 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 +#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 ]) dnl Preparation for running test programs: dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not @@ -47,16 +85,49 @@ AC_DEFUN([gl_COMMON_BODY], [ # expands to a C preprocessor expression that evaluates to 1 or 0, depending # whether a gnulib module that has been requested shall be considered present # or not. -AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1]) +m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) # gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) # sets the shell variable that indicates the presence of the given module to # a C preprocessor expression that will evaluate to 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], [ - GNULIB_[]m4_translit([[$1]], - [abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION + gl_MODULE_INDICATOR_SET_VARIABLE_AUX( + [GNULIB_[]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], + [gl_MODULE_INDICATOR_CONDITION]) +]) + +# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable]) +# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION. +# The shell variable's value is a C preprocessor expression that evaluates +# to 0 or 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], +[ + m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], + [ + dnl Simplify the expression VALUE || 1 to 1. + $1=1 + ], + [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], + [gl_MODULE_INDICATOR_CONDITION])]) +]) + +# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition]) +# modifies the shell variable to include the given condition. The shell +# variable's value is a C preprocessor expression that evaluates to 0 or 1. +AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], +[ + dnl Simplify the expression 1 || CONDITION to 1. + if test "$[]$1" != 1; then + dnl Simplify the expression 0 || CONDITION to CONDITION. + if test "$[]$1" = 0; then + $1=$2 + else + $1="($[]$1 || $2)" + fi + fi ]) # gl_MODULE_INDICATOR([modulename]) @@ -102,6 +173,40 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [Define to 1 when the gnulib module $1 should be tested.]) ]) +# gl_ASSERT_NO_GNULIB_POSIXCHECK +# asserts that there will never be a need to #define GNULIB_POSIXCHECK. +# and thereby enables an optimization of configure and config.h. +# Used by Emacs. +AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], +[ + dnl Override gl_WARN_ON_USE_PREPARE. + dnl But hide this definition from 'aclocal'. + AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) +]) + +# gl_ASSERT_NO_GNULIB_TESTS +# asserts that there will be no gnulib tests in the scope of the configure.ac +# and thereby enables an optimization of config.h. +# Used by Emacs. +AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS], +[ + dnl Override gl_MODULE_INDICATOR_FOR_TESTS. + AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], []) +]) + +# Test whether <features.h> exists. +# Set HAVE_FEATURES_H. +AC_DEFUN([gl_FEATURES_H], +[ + AC_CHECK_HEADERS_ONCE([features.h]) + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + 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. @@ -117,11 +222,90 @@ 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])]) +]) + +# gl_PROG_AR_RANLIB +# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. +# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override +# the values. +AC_DEFUN([gl_PROG_AR_RANLIB], +[ + dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler + dnl as "cc", and GCC as "gcc". They have different object file formats and + dnl library formats. In particular, the GNU binutils programs ar, ranlib + dnl produce libraries that work only with gcc, not with cc. + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], + [ + AC_EGREP_CPP([Amsterdam], + [ +#ifdef __ACK__ +Amsterdam +#endif + ], + [gl_cv_c_amsterdam_compiler=yes], + [gl_cv_c_amsterdam_compiler=no]) + ]) + if test -z "$AR"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + AR='cc -c.a' + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + dnl Use the Automake-documented default values for AR and ARFLAGS, + dnl but prefer ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + fi + else + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + fi + AC_SUBST([AR]) + AC_SUBST([ARFLAGS]) + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + dnl Use the ranlib program if it is available. + AC_PROG_RANLIB + fi + fi + 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], @@ -132,27 +316,31 @@ m4_ifdef([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 overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61, -# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++ -# works. -# This definition can be removed once autoconf >= 2.62 can be assumed. -m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[ +# 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. 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 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - }]], - [[int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t)]])], + 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); + ]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done @@ -162,21 +350,21 @@ AC_DEFUN([AC_C_RESTRICT], nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict -/* Work around a bug in Sun C++: it does not support _Restrict, even - though the corresponding Sun C compiler does, which causes - "#define restrict _Restrict" in the previous line. Perhaps some future - version of Sun C++ will work with _Restrict; if so, it'll probably - define __RESTRICT, just as Sun C does. */ +/* 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 # define _Restrict +# define __restrict__ #endif]) case $ac_cv_c_restrict in restrict) ;; no) AC_DEFINE([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. @@ -199,3 +387,63 @@ AC_DEFUN([gl_CACHE_VAL_SILENT], AC_CACHE_VAL([$1], [$2]) as_echo_n="$saved_as_echo_n" ]) + +# 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 +])])]) diff --git a/gnulib-m4/gnulib-comp.m4 b/gnulib-m4/gnulib-comp.m4 index 21284a4..cab72bd 100644 --- a/gnulib-m4/gnulib-comp.m4 +++ b/gnulib-m4/gnulib-comp.m4 @@ -1,10 +1,22 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2010 Free Software Foundation, Inc. +# Copyright (C) 2002-2015 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# 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 +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. @@ -12,7 +24,8 @@ # This file represents the compiled summary of the specification in # gnulib-cache.m4. It lists the computed macro invocations that need # to be invoked from configure.ac. -# In projects using CVS, this file can be treated like other built files. +# In projects that use version control, this file can be treated like +# other built files. # This macro should be invoked from ./configure.ac, in the section @@ -24,14 +37,16 @@ AC_DEFUN([gl_EARLY], m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable - AC_REQUIRE([AC_PROG_RANLIB]) + AC_REQUIRE([gl_PROG_AR_RANLIB]) AC_REQUIRE([AM_PROG_CC_C_O]) + # Code from module absolute-header: # Code from module alloca-opt: # Code from module alloca-opt-tests: - # Code from module arg-nonnull: + # Code from module amemxfrm: # Code from module array-mergesort: # Code from module array-mergesort-tests: - # Code from module c++defs: + # Code from module btowc: + # Code from module btowc-tests: # Code from module c-ctype: # Code from module c-ctype-tests: # Code from module c-strcase: @@ -46,14 +61,24 @@ AC_DEFUN([gl_EARLY], # Code from module exitfail: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + # Code from module extern-inline: + # Code from module fdopen: + # Code from module fdopen-tests: + # Code from module fgetc-tests: # Code from module float: + # Code from module float-tests: # Code from module fpieee: AC_REQUIRE([gl_FP_IEEE]) # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: + # Code from module frexp-nolibm: + # Code from module frexp-nolibm-tests: # Code from module frexpl-nolibm: # Code from module frexpl-nolibm-tests: # Code from module fseterr: # Code from module fseterr-tests: + # Code from module fwrite-tests: # Code from module getpagesize: # Code from module gettext-h: # Code from module gperf: @@ -66,12 +91,20 @@ AC_DEFUN([gl_EARLY], # Code from module include_next: # Code from module inline: # Code from module intprops: + # Code from module intprops-tests: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module inttypes-tests: # Code from module isnand-nolibm: # Code from module isnand-nolibm-tests: # Code from module isnanf-nolibm: # Code from module isnanf-nolibm-tests: # Code from module isnanl-nolibm: # Code from module isnanl-nolibm-tests: + # Code from module iswblank: + # Code from module iswblank-tests: + # Code from module langinfo: + # Code from module langinfo-tests: # Code from module localcharset: # Code from module locale: # Code from module locale-tests: @@ -91,11 +124,13 @@ AC_DEFUN([gl_EARLY], # Code from module mbsinit: # Code from module mbsinit-tests: # Code from module mbsnlen: + # Code from module mbtowc: # Code from module memchr: # Code from module memchr-tests: # Code from module memcmp2: - # Code from module memxfrm: # Code from module minmax: + # Code from module msvc-inval: + # Code from module msvc-nothrow: # Code from module multiarch: # Code from module nocrash: # Code from module printf-frexp: @@ -108,19 +143,32 @@ AC_DEFUN([gl_EARLY], # Code from module relocatable-lib-lgpl: # Code from module setenv: # Code from module setenv-tests: + # Code from module setlocale: + # Code from module setlocale-tests: # Code from module signbit: # Code from module signbit-tests: # Code from module size_max: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module ssize_t: + # Code from module stdalign: + # Code from module stdalign-tests: # Code from module stdbool: # Code from module stdbool-tests: # Code from module stddef: # Code from module stddef-tests: # Code from module stdint: # Code from module stdint-tests: + # Code from module stdio: + # Code from module stdio-tests: # Code from module stdlib: # Code from module stdlib-tests: # Code from module streq: # Code from module strerror: + # Code from module strerror-override: # Code from module strerror-tests: # Code from module striconveh: # Code from module striconveh-tests: @@ -130,7 +178,15 @@ AC_DEFUN([gl_EARLY], # Code from module string-tests: # Code from module strncat: # Code from module strncat-tests: + # Code from module strstr: + # Code from module strstr-simple: + # Code from module strstr-tests: + # Code from module sys_types: + # Code from module sys_types-tests: + # Code from module test-framework-sh: + # Code from module test-framework-sh-tests: # Code from module thread: + # Code from module thread-tests: # Code from module threadlib: gl_THREADLIB_EARLY # Code from module unicase/base: @@ -274,15 +330,17 @@ AC_DEFUN([gl_EARLY], # Code from module uniconv/u8-strconv-to-enc-tests: # Code from module uniconv/u8-strconv-to-locale: # Code from module unictype/base: - # Code from module unictype/bidicategory-all: - # Code from module unictype/bidicategory-byname: - # Code from module unictype/bidicategory-byname-tests: - # Code from module unictype/bidicategory-name: - # Code from module unictype/bidicategory-name-tests: - # Code from module unictype/bidicategory-of: - # Code from module unictype/bidicategory-of-tests: - # Code from module unictype/bidicategory-test: - # Code from module unictype/bidicategory-test-tests: + # Code from module unictype/bidiclass-all: + # Code from module unictype/bidiclass-byname: + # Code from module unictype/bidiclass-byname-tests: + # Code from module unictype/bidiclass-longname: + # Code from module unictype/bidiclass-longname-tests: + # Code from module unictype/bidiclass-name: + # Code from module unictype/bidiclass-name-tests: + # Code from module unictype/bidiclass-of: + # Code from module unictype/bidiclass-of-tests: + # Code from module unictype/bidiclass-test: + # Code from module unictype/bidiclass-test-tests: # Code from module unictype/block-all: # Code from module unictype/block-list: # Code from module unictype/block-list-tests: @@ -304,6 +362,8 @@ AC_DEFUN([gl_EARLY], # Code from module unictype/category-Cs-tests: # Code from module unictype/category-L: # Code from module unictype/category-L-tests: + # Code from module unictype/category-LC: + # Code from module unictype/category-LC-tests: # Code from module unictype/category-Ll: # Code from module unictype/category-Ll-tests: # Code from module unictype/category-Lm: @@ -371,6 +431,8 @@ AC_DEFUN([gl_EARLY], # Code from module unictype/category-and-tests: # Code from module unictype/category-byname: # Code from module unictype/category-byname-tests: + # Code from module unictype/category-longname: + # Code from module unictype/category-longname-tests: # Code from module unictype/category-name: # Code from module unictype/category-name-tests: # Code from module unictype/category-none: @@ -383,6 +445,13 @@ AC_DEFUN([gl_EARLY], # Code from module unictype/category-test-withtable: # Code from module unictype/category-test-withtable-tests: # Code from module unictype/combining-class: + # Code from module unictype/combining-class-all: + # Code from module unictype/combining-class-byname: + # Code from module unictype/combining-class-byname-tests: + # Code from module unictype/combining-class-longname: + # Code from module unictype/combining-class-longname-tests: + # Code from module unictype/combining-class-name: + # Code from module unictype/combining-class-name-tests: # Code from module unictype/combining-class-tests: # Code from module unictype/ctype-alnum: # Code from module unictype/ctype-alnum-tests: @@ -412,6 +481,22 @@ AC_DEFUN([gl_EARLY], # Code from module unictype/decimal-digit-tests: # Code from module unictype/digit: # Code from module unictype/digit-tests: + # Code from module unictype/joininggroup-all: + # Code from module unictype/joininggroup-byname: + # Code from module unictype/joininggroup-byname-tests: + # Code from module unictype/joininggroup-name: + # Code from module unictype/joininggroup-name-tests: + # Code from module unictype/joininggroup-of: + # Code from module unictype/joininggroup-of-tests: + # Code from module unictype/joiningtype-all: + # Code from module unictype/joiningtype-byname: + # Code from module unictype/joiningtype-byname-tests: + # Code from module unictype/joiningtype-longname: + # Code from module unictype/joiningtype-longname-tests: + # Code from module unictype/joiningtype-name: + # Code from module unictype/joiningtype-name-tests: + # Code from module unictype/joiningtype-of: + # Code from module unictype/joiningtype-of-tests: # Code from module unictype/mirror: # Code from module unictype/mirror-tests: # Code from module unictype/numeric: @@ -457,6 +542,20 @@ AC_DEFUN([gl_EARLY], # Code from module unictype/property-bidi-whitespace-tests: # Code from module unictype/property-byname: # Code from module unictype/property-byname-tests: + # Code from module unictype/property-case-ignorable: + # Code from module unictype/property-case-ignorable-tests: + # Code from module unictype/property-cased: + # Code from module unictype/property-cased-tests: + # Code from module unictype/property-changes-when-casefolded: + # Code from module unictype/property-changes-when-casefolded-tests: + # Code from module unictype/property-changes-when-casemapped: + # Code from module unictype/property-changes-when-casemapped-tests: + # Code from module unictype/property-changes-when-lowercased: + # Code from module unictype/property-changes-when-lowercased-tests: + # Code from module unictype/property-changes-when-titlecased: + # Code from module unictype/property-changes-when-titlecased-tests: + # Code from module unictype/property-changes-when-uppercased: + # Code from module unictype/property-changes-when-uppercased-tests: # Code from module unictype/property-combining: # Code from module unictype/property-combining-tests: # Code from module unictype/property-composite: @@ -590,6 +689,31 @@ AC_DEFUN([gl_EARLY], # Code from module unictype/syntax-java-ident-tests: # Code from module unictype/syntax-java-whitespace: # Code from module unictype/syntax-java-whitespace-tests: + # Code from module unigbrk/base: + # Code from module unigbrk/u16-grapheme-breaks: + # Code from module unigbrk/u16-grapheme-breaks-tests: + # Code from module unigbrk/u16-grapheme-next: + # Code from module unigbrk/u16-grapheme-next-tests: + # Code from module unigbrk/u16-grapheme-prev: + # Code from module unigbrk/u16-grapheme-prev-tests: + # Code from module unigbrk/u32-grapheme-breaks: + # Code from module unigbrk/u32-grapheme-breaks-tests: + # Code from module unigbrk/u32-grapheme-next: + # Code from module unigbrk/u32-grapheme-next-tests: + # Code from module unigbrk/u32-grapheme-prev: + # Code from module unigbrk/u32-grapheme-prev-tests: + # Code from module unigbrk/u8-grapheme-breaks: + # Code from module unigbrk/u8-grapheme-breaks-tests: + # Code from module unigbrk/u8-grapheme-next: + # Code from module unigbrk/u8-grapheme-next-tests: + # Code from module unigbrk/u8-grapheme-prev: + # Code from module unigbrk/u8-grapheme-prev-tests: + # Code from module unigbrk/uc-gbrk-prop: + # Code from module unigbrk/uc-gbrk-prop-tests: + # Code from module unigbrk/uc-is-grapheme-break: + # Code from module unigbrk/uc-is-grapheme-break-tests: + # Code from module unigbrk/ulc-grapheme-breaks: + # Code from module unigbrk/ulc-grapheme-breaks-tests: # Code from module unilbrk/base: # Code from module unilbrk/tables: # Code from module unilbrk/u16-possible-linebreaks: @@ -779,6 +903,7 @@ AC_DEFUN([gl_EARLY], # Code from module unistr/u16-strcat: # Code from module unistr/u16-strcat-tests: # Code from module unistr/u16-strchr: + # Code from module unistr/u16-strchr-tests: # Code from module unistr/u16-strcmp: # Code from module unistr/u16-strcmp-tests: # Code from module unistr/u16-strcoll: @@ -806,7 +931,9 @@ AC_DEFUN([gl_EARLY], # Code from module unistr/u16-strrchr: # Code from module unistr/u16-strspn: # Code from module unistr/u16-strstr: + # Code from module unistr/u16-strstr-tests: # Code from module unistr/u16-strtok: + # Code from module unistr/u16-strtok-tests: # Code from module unistr/u16-to-u32: # Code from module unistr/u16-to-u32-tests: # Code from module unistr/u16-to-u8: @@ -852,6 +979,7 @@ AC_DEFUN([gl_EARLY], # Code from module unistr/u32-strcat: # Code from module unistr/u32-strcat-tests: # Code from module unistr/u32-strchr: + # Code from module unistr/u32-strchr-tests: # Code from module unistr/u32-strcmp: # Code from module unistr/u32-strcmp-tests: # Code from module unistr/u32-strcoll: @@ -879,7 +1007,9 @@ AC_DEFUN([gl_EARLY], # Code from module unistr/u32-strrchr: # Code from module unistr/u32-strspn: # Code from module unistr/u32-strstr: + # Code from module unistr/u32-strstr-tests: # Code from module unistr/u32-strtok: + # Code from module unistr/u32-strtok-tests: # Code from module unistr/u32-to-u16: # Code from module unistr/u32-to-u16-tests: # Code from module unistr/u32-to-u8: @@ -925,6 +1055,7 @@ AC_DEFUN([gl_EARLY], # Code from module unistr/u8-strcat: # Code from module unistr/u8-strcat-tests: # Code from module unistr/u8-strchr: + # Code from module unistr/u8-strchr-tests: # Code from module unistr/u8-strcmp: # Code from module unistr/u8-strcmp-tests: # Code from module unistr/u8-strcoll: @@ -952,7 +1083,9 @@ AC_DEFUN([gl_EARLY], # Code from module unistr/u8-strrchr: # Code from module unistr/u8-strspn: # Code from module unistr/u8-strstr: + # Code from module unistr/u8-strstr-tests: # Code from module unistr/u8-strtok: + # Code from module unistr/u8-strtok-tests: # Code from module unistr/u8-to-u16: # Code from module unistr/u8-to-u16-tests: # Code from module unistr/u8-to-u32: @@ -988,19 +1121,22 @@ AC_DEFUN([gl_EARLY], # Code from module uniwidth/width-tests: # Code from module unsetenv: # Code from module unsetenv-tests: - # Code from module unused-parameter: # Code from module verify: - # Code from module warn-on-use: + # Code from module verify-tests: # Code from module wchar: # Code from module wchar-tests: + # Code from module wcrtomb: + # Code from module wcrtomb-tests: # Code from module wctob: - # Code from module wctype: - # Code from module wctype-tests: + # Code from module wctomb: + # Code from module wctype-h: + # Code from module wctype-h-tests: # Code from module wcwidth: # Code from module wcwidth-tests: # Code from module xalloc: # Code from module xalloc-die: # Code from module xalloc-die-tests: + # Code from module xalloc-oversized: # Code from module xsize: # Code from module yield: ]) @@ -1019,750 +1155,797 @@ AC_DEFUN([gl_INIT], m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='lib' - # Code from module alloca-opt: gl_FUNC_ALLOCA - # Code from module arg-nonnull: - # Code from module array-mergesort: - # Code from module c++defs: - # Code from module c-ctype: - # Code from module c-strcase: - # Code from module c-strcaseeq: - # Code from module configmake: - # Code from module errno: + gl_CONFIGMAKE_PREP gl_HEADER_ERRNO_H - # Code from module extensions: - # Code from module float: + AC_REQUIRE([gl_EXTERN_INLINE]) gl_FLOAT_H - # Code from module fpieee: - # Code from module fpucw: - # Code from module frexpl-nolibm: + if test $REPLACE_FLOAT_LDBL = 1; then + AC_LIBOBJ([float]) + fi + if test $REPLACE_ITOLD = 1; then + AC_LIBOBJ([itold]) + fi + gl_FUNC_FREXP_NO_LIBM + if test $gl_func_frexp_no_libm != yes; then + AC_LIBOBJ([frexp]) + fi + gl_MATH_MODULE_INDICATOR([frexp]) gl_FUNC_FREXPL_NO_LIBM + if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then + AC_LIBOBJ([frexpl]) + fi gl_MATH_MODULE_INDICATOR([frexpl]) - # Code from module fseterr: - # Code from module gperf: - # Code from module havelib: - # Code from module iconv: + gl_FUNC_FSETERR + if test $ac_cv_func___fseterr = no; then + AC_LIBOBJ([fseterr]) + fi AM_ICONV - # Code from module iconv-h: + m4_ifdef([gl_ICONV_MODULE_INDICATOR], + [gl_ICONV_MODULE_INDICATOR([iconv])]) gl_ICONV_H - # Code from module iconv_open: gl_FUNC_ICONV_OPEN - # Code from module include_next: - # Code from module inline: + if test $REPLACE_ICONV_OPEN = 1; then + AC_LIBOBJ([iconv_open]) + fi + if test $REPLACE_ICONV = 1; then + AC_LIBOBJ([iconv]) + AC_LIBOBJ([iconv_close]) + fi gl_INLINE - # Code from module isnand-nolibm: gl_FUNC_ISNAND_NO_LIBM - # Code from module isnanf-nolibm: + if test $gl_func_isnand_no_libm != yes; then + AC_LIBOBJ([isnand]) + gl_PREREQ_ISNAND + fi gl_FUNC_ISNANF_NO_LIBM - # Code from module isnanl-nolibm: + if test $gl_func_isnanf_no_libm != yes; then + AC_LIBOBJ([isnanf]) + gl_PREREQ_ISNANF + fi gl_FUNC_ISNANL_NO_LIBM - # Code from module localcharset: + if test $gl_func_isnanl_no_libm != yes; then + AC_LIBOBJ([isnanl]) + gl_PREREQ_ISNANL + fi + gl_FUNC_ISWBLANK + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + AC_LIBOBJ([iswblank]) + fi + fi + gl_WCTYPE_MODULE_INDICATOR([iswblank]) + gl_LANGINFO_H gl_LOCALCHARSET - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) - # Code from module localename: gl_LOCALENAME - # Code from module lock: gl_LOCK - # Code from module malloc-posix: + gl_MODULE_INDICATOR([lock]) gl_FUNC_MALLOC_POSIX + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi gl_STDLIB_MODULE_INDICATOR([malloc-posix]) - # Code from module malloca: gl_MALLOCA - # Code from module math: gl_MATH_H - # Code from module mbchar: gl_MBCHAR - # Code from module mbiter: gl_MBITER - # Code from module mbrtowc: gl_FUNC_MBRTOWC + if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then + AC_LIBOBJ([mbrtowc]) + gl_PREREQ_MBRTOWC + fi gl_WCHAR_MODULE_INDICATOR([mbrtowc]) - # Code from module mbsinit: gl_FUNC_MBSINIT + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + AC_LIBOBJ([mbsinit]) + gl_PREREQ_MBSINIT + fi gl_WCHAR_MODULE_INDICATOR([mbsinit]) - # Code from module mbsnlen: gl_STRING_MODULE_INDICATOR([mbsnlen]) - # Code from module memchr: gl_FUNC_MEMCHR + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + AC_LIBOBJ([memchr]) + gl_PREREQ_MEMCHR + fi gl_STRING_MODULE_INDICATOR([memchr]) - # Code from module memcmp2: - # Code from module memxfrm: - # Code from module minmax: gl_MINMAX - # Code from module multiarch: gl_MULTIARCH - # Code from module nocrash: - # Code from module printf-frexp: gl_FUNC_PRINTF_FREXP - # Code from module printf-frexpl: gl_FUNC_PRINTF_FREXPL - # Code from module printf-safe: m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) - # Code from module relocatable-lib-lgpl: gl_RELOCATABLE_LIBRARY - # Code from module signbit: gl_SIGNBIT + if test $REPLACE_SIGNBIT = 1; then + AC_LIBOBJ([signbitf]) + AC_LIBOBJ([signbitd]) + AC_LIBOBJ([signbitl]) + fi gl_MATH_MODULE_INDICATOR([signbit]) - # Code from module size_max: gl_SIZE_MAX - # Code from module stdbool: + gt_TYPE_SSIZE_T AM_STDBOOL_H - # Code from module stddef: gl_STDDEF_H - # Code from module stdint: gl_STDINT_H - # Code from module stdlib: gl_STDLIB_H - # Code from module streq: - # Code from module striconveh: if test $gl_cond_libtool = false; then gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" gl_libdeps="$gl_libdeps $LIBICONV" fi - # Code from module striconveha: - # Code from module string: gl_HEADER_STRING_H - # Code from module strncat: gl_FUNC_STRNCAT + if test $REPLACE_STRNCAT = 1; then + AC_LIBOBJ([strncat]) + gl_PREREQ_STRNCAT + fi gl_STRING_MODULE_INDICATOR([strncat]) - # Code from module threadlib: + gl_FUNC_STRSTR + if test $REPLACE_STRSTR = 1; then + AC_LIBOBJ([strstr]) + fi + gl_FUNC_STRSTR_SIMPLE + if test $REPLACE_STRSTR = 1; then + AC_LIBOBJ([strstr]) + fi + gl_STRING_MODULE_INDICATOR([strstr]) + gl_SYS_TYPES_H + AC_PROG_MKDIR_P gl_THREADLIB - # Code from module unicase/base: - # Code from module unicase/cased: - AC_REQUIRE([AC_C_INLINE]) - # Code from module unicase/empty-prefix-context: - # Code from module unicase/empty-suffix-context: - # Code from module unicase/ignorable: - AC_REQUIRE([AC_C_INLINE]) - # Code from module unicase/locale-language: - # Code from module unicase/special-casing: - # Code from module unicase/tocasefold: - # Code from module unicase/tolower: - # Code from module unicase/totitle: - # Code from module unicase/toupper: - # Code from module unicase/u16-casecmp: - # Code from module unicase/u16-casecoll: - # Code from module unicase/u16-casefold: - # Code from module unicase/u16-casemap: - # Code from module unicase/u16-casexfrm: - # Code from module unicase/u16-ct-casefold: - # Code from module unicase/u16-ct-tolower: - # Code from module unicase/u16-ct-totitle: - # Code from module unicase/u16-ct-toupper: - # Code from module unicase/u16-is-cased: - # Code from module unicase/u16-is-casefolded: - # Code from module unicase/u16-is-invariant: - # Code from module unicase/u16-is-lowercase: - # Code from module unicase/u16-is-titlecase: - # Code from module unicase/u16-is-uppercase: - # Code from module unicase/u16-tolower: - # Code from module unicase/u16-totitle: - # Code from module unicase/u16-toupper: - # Code from module unicase/u32-casecmp: - # Code from module unicase/u32-casecoll: - # Code from module unicase/u32-casefold: - # Code from module unicase/u32-casemap: - # Code from module unicase/u32-casexfrm: - # Code from module unicase/u32-ct-casefold: - # Code from module unicase/u32-ct-tolower: - # Code from module unicase/u32-ct-totitle: - # Code from module unicase/u32-ct-toupper: - # Code from module unicase/u32-is-cased: - # Code from module unicase/u32-is-casefolded: - # Code from module unicase/u32-is-invariant: - # Code from module unicase/u32-is-lowercase: - # Code from module unicase/u32-is-titlecase: - # Code from module unicase/u32-is-uppercase: - # Code from module unicase/u32-tolower: - # Code from module unicase/u32-totitle: - # Code from module unicase/u32-toupper: - # Code from module unicase/u8-casecmp: - # Code from module unicase/u8-casecoll: - # Code from module unicase/u8-casefold: - # Code from module unicase/u8-casemap: - # Code from module unicase/u8-casexfrm: - # Code from module unicase/u8-ct-casefold: - # Code from module unicase/u8-ct-tolower: - # Code from module unicase/u8-ct-totitle: - # Code from module unicase/u8-ct-toupper: - # Code from module unicase/u8-is-cased: - # Code from module unicase/u8-is-casefolded: - # Code from module unicase/u8-is-invariant: - # Code from module unicase/u8-is-lowercase: - # Code from module unicase/u8-is-titlecase: - # Code from module unicase/u8-is-uppercase: - # Code from module unicase/u8-tolower: - # Code from module unicase/u8-totitle: - # Code from module unicase/u8-toupper: - # Code from module unicase/ulc-casecmp: - # Code from module unicase/ulc-casecoll: - # Code from module unicase/ulc-casexfrm: - # Code from module uniconv/base: - # Code from module uniconv/u16-conv-from-enc: + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unicase.h]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.1], [unicase/empty-prefix-context]) + gl_LIBUNISTRING_MODULE([0.9.1], [unicase/empty-suffix-context]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.3], [unicase/locale-language]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-casecmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-casecoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-casefold]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-casexfrm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-ct-casefold]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-ct-tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-ct-totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-ct-toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-is-cased]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-is-casefolded]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-is-lowercase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-is-titlecase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-is-uppercase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u16-toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-casecmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-casecoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-casefold]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-casexfrm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-ct-casefold]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-ct-tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-ct-totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-ct-toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-is-cased]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-is-casefolded]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-is-lowercase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-is-titlecase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-is-uppercase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u32-toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-casecmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-casecoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-casefold]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-casexfrm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-ct-casefold]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-ct-tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-ct-totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-ct-toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-is-cased]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-is-casefolded]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-is-lowercase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-is-titlecase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-is-uppercase]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-tolower]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-totitle]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/u8-toupper]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/ulc-casecmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/ulc-casecoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [unicase/ulc-casexfrm]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniconv.h]) AC_REQUIRE([gl_BIGENDIAN]) - # Code from module uniconv/u16-conv-to-enc: + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u16-conv-from-enc]) AC_REQUIRE([gl_BIGENDIAN]) - # Code from module uniconv/u16-strconv-from-enc: - # Code from module uniconv/u16-strconv-from-locale: - # Code from module uniconv/u16-strconv-to-enc: + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u16-conv-to-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u16-strconv-from-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u16-strconv-from-locale]) AC_REQUIRE([gl_BIGENDIAN]) - # Code from module uniconv/u16-strconv-to-locale: - # Code from module uniconv/u32-conv-from-enc: - # Code from module uniconv/u32-conv-to-enc: - # Code from module uniconv/u32-strconv-from-enc: - # Code from module uniconv/u32-strconv-from-locale: - # Code from module uniconv/u32-strconv-to-enc: - # Code from module uniconv/u32-strconv-to-locale: - # Code from module uniconv/u8-conv-from-enc: - # Code from module uniconv/u8-conv-to-enc: - # Code from module uniconv/u8-strconv-from-enc: - # Code from module uniconv/u8-strconv-from-locale: - # Code from module uniconv/u8-strconv-to-enc: - # Code from module uniconv/u8-strconv-to-locale: - # Code from module unictype/base: - # Code from module unictype/bidicategory-all: - # Code from module unictype/bidicategory-byname: - # Code from module unictype/bidicategory-name: - # Code from module unictype/bidicategory-of: - # Code from module unictype/bidicategory-test: - # Code from module unictype/block-all: - # Code from module unictype/block-list: - # Code from module unictype/block-of: - # Code from module unictype/block-test: - # Code from module unictype/category-C: - # Code from module unictype/category-Cc: - # Code from module unictype/category-Cf: - # Code from module unictype/category-Cn: - # Code from module unictype/category-Co: - # Code from module unictype/category-Cs: - # Code from module unictype/category-L: - # Code from module unictype/category-Ll: - # Code from module unictype/category-Lm: - # Code from module unictype/category-Lo: - # Code from module unictype/category-Lt: - # Code from module unictype/category-Lu: - # Code from module unictype/category-M: - # Code from module unictype/category-Mc: - # Code from module unictype/category-Me: - # Code from module unictype/category-Mn: - # Code from module unictype/category-N: - # Code from module unictype/category-Nd: - # Code from module unictype/category-Nl: - # Code from module unictype/category-No: - # Code from module unictype/category-P: - # Code from module unictype/category-Pc: - # Code from module unictype/category-Pd: - # Code from module unictype/category-Pe: - # Code from module unictype/category-Pf: - # Code from module unictype/category-Pi: - # Code from module unictype/category-Po: - # Code from module unictype/category-Ps: - # Code from module unictype/category-S: - # Code from module unictype/category-Sc: - # Code from module unictype/category-Sk: - # Code from module unictype/category-Sm: - # Code from module unictype/category-So: - # Code from module unictype/category-Z: - # Code from module unictype/category-Zl: - # Code from module unictype/category-Zp: - # Code from module unictype/category-Zs: - # Code from module unictype/category-all: - # Code from module unictype/category-and: - # Code from module unictype/category-and-not: - # Code from module unictype/category-byname: - # Code from module unictype/category-name: - # Code from module unictype/category-none: - # Code from module unictype/category-of: + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u16-strconv-to-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u16-strconv-to-locale]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u32-conv-from-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u32-conv-to-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u32-strconv-from-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u32-strconv-from-locale]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u32-strconv-to-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u32-strconv-to-locale]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u8-conv-from-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u8-conv-to-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u8-strconv-from-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u8-strconv-from-locale]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u8-strconv-to-enc]) + gl_LIBUNISTRING_MODULE([0.9], [uniconv/u8-strconv-to-locale]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unictype.h]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/bidiclass-byname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/bidiclass-longname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/bidiclass-name]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/bidiclass-of]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/bidiclass-test]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/block-list]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/block-test]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-C]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cf]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cn]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Co]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cs]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-L]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-LC]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Ll]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lo]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lt]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lu]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-M]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Mc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Me]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Mn]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-N]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Nd]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Nl]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-No]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-P]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pd]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pe]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pf]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pi]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Po]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Ps]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-S]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Sc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Sk]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Sm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-So]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Z]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Zl]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Zp]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Zs]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-and]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-and-not]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-byname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/category-longname]) + gl_LIBUNISTRING_MODULE([0.9], [unictype/category-name]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/category-none]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/category-or: - # Code from module unictype/category-test: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-of]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-or]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/category-test-withtable: - # Code from module unictype/combining-class: - # Code from module unictype/ctype-alnum: + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/category-test]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/combining-class]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/combining-class-byname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/combining-class-longname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/combining-class-name]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-alpha: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-alnum]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-blank: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-alpha]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-cntrl: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-blank]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-digit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-cntrl]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-graph: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-digit]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-lower: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-graph]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-print: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-lower]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-punct: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-print]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-space: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-punct]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-upper: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-space]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/ctype-xdigit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-upper]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/decimal-digit: - # Code from module unictype/digit: - # Code from module unictype/mirror: - # Code from module unictype/numeric: - # Code from module unictype/property-all: - # Code from module unictype/property-alphabetic: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/ctype-xdigit]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/decimal-digit]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/digit]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/joininggroup-byname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/joininggroup-name]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/joininggroup-of]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/joiningtype-byname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/joiningtype-longname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/joiningtype-name]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/joiningtype-of]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/mirror]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/numeric]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-ascii-hex-digit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-alphabetic]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-arabic-digit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-ascii-hex-digit]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-arabic-right-to-left: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-arabic-digit]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-block-separator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-arabic-right-to-left]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-boundary-neutral: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-block-separator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-common-separator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-boundary-neutral]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-control: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-common-separator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-embedding-or-override: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-control]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-eur-num-separator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-embedding-or-override]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-eur-num-terminator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-eur-num-separator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-european-digit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-eur-num-terminator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-hebrew-right-to-left: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-european-digit]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-left-to-right: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-hebrew-right-to-left]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-non-spacing-mark: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-left-to-right]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-other-neutral: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-non-spacing-mark]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-pdf: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-other-neutral]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-segment-separator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-pdf]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-bidi-whitespace: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-segment-separator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-byname: - # Code from module unictype/property-combining: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-bidi-whitespace]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-byname]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-composite: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-case-ignorable]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-currency-symbol: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-cased]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-dash: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-changes-when-casefolded]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-decimal-digit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-changes-when-casemapped]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-default-ignorable-code-point: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-changes-when-lowercased]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-deprecated: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-changes-when-titlecased]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-diacritic: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-changes-when-uppercased]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-extender: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-combining]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-format-control: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-composite]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-grapheme-base: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-currency-symbol]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-grapheme-extend: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-dash]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-grapheme-link: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-decimal-digit]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-hex-digit: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-default-ignorable-code-point]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-hyphen: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-deprecated]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-id-continue: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-diacritic]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-id-start: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-extender]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-ideographic: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-format-control]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-ids-binary-operator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-grapheme-base]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-ids-trinary-operator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-grapheme-extend]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-ignorable-control: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-grapheme-link]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-iso-control: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-hex-digit]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-join-control: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-hyphen]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-left-of-pair: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-id-continue]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-line-separator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-id-start]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-logical-order-exception: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-ideographic]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-lowercase: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-ids-binary-operator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-math: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-ids-trinary-operator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-non-break: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-ignorable-control]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-not-a-character: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-iso-control]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-numeric: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-join-control]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-alphabetic: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-left-of-pair]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-default-ignorable-code-point: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-line-separator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-grapheme-extend: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-logical-order-exception]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-id-continue: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-lowercase]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-id-start: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-math]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-lowercase: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-non-break]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-math: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-not-a-character]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-other-uppercase: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-numeric]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-paired-punctuation: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-alphabetic]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-paragraph-separator: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-default-ignorable-code-point]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-pattern-syntax: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-grapheme-extend]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-pattern-white-space: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-id-continue]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-private-use: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-id-start]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-punctuation: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-lowercase]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-quotation-mark: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-math]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-radical: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-other-uppercase]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-sentence-terminal: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-paired-punctuation]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-soft-dotted: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-paragraph-separator]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-space: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-pattern-syntax]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-terminal-punctuation: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-pattern-white-space]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-test: - # Code from module unictype/property-titlecase: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-private-use]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-unassigned-code-value: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-punctuation]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-unified-ideograph: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-quotation-mark]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-uppercase: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-radical]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-variation-selector: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-sentence-terminal]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-white-space: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-soft-dotted]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-xid-continue: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-space]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-xid-start: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-terminal-punctuation]) + gl_LIBUNISTRING_MODULE([0.9], [unictype/property-test]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/property-zero-width: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-titlecase]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/scripts: - # Code from module unictype/scripts-all: - # Code from module unictype/syntax-c-ident: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-unassigned-code-value]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/syntax-c-whitespace: - # Code from module unictype/syntax-java-ident: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-unified-ideograph]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unictype/syntax-java-whitespace: - # Code from module unilbrk/base: - # Code from module unilbrk/tables: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-uppercase]) AC_REQUIRE([AC_C_INLINE]) - # Code from module unilbrk/u16-possible-linebreaks: - # Code from module unilbrk/u16-width-linebreaks: - # Code from module unilbrk/u32-possible-linebreaks: - # Code from module unilbrk/u32-width-linebreaks: - # Code from module unilbrk/u8-possible-linebreaks: - # Code from module unilbrk/u8-width-linebreaks: - # Code from module unilbrk/ulc-common: - # Code from module unilbrk/ulc-possible-linebreaks: - # Code from module unilbrk/ulc-width-linebreaks: - # Code from module uniname/base: - # Code from module uniname/uniname: - # Code from module uninorm/base: - # Code from module uninorm/canonical-decomposition: - # Code from module uninorm/compat-decomposition: - # Code from module uninorm/composition: - # Code from module uninorm/decompose-internal: - # Code from module uninorm/decomposing-form: - # Code from module uninorm/decomposition: - # Code from module uninorm/decomposition-table: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-variation-selector]) AC_REQUIRE([AC_C_INLINE]) - # Code from module uninorm/filter: - # Code from module uninorm/nfc: - # Code from module uninorm/nfd: - # Code from module uninorm/nfkc: - # Code from module uninorm/nfkd: - # Code from module uninorm/u16-normalize: + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-white-space]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-xid-continue]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-xid-start]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/property-zero-width]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/scripts]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/syntax-c-ident]) + gl_LIBUNISTRING_MODULE([0.9], [unictype/syntax-c-whitespace]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/syntax-java-ident]) + gl_LIBUNISTRING_MODULE([0.9], [unictype/syntax-java-whitespace]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unigbrk.h]) + gl_MODULE_INDICATOR([unigbrk/u16-grapheme-breaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u16-grapheme-breaks]) + gl_MODULE_INDICATOR([unigbrk/u16-grapheme-next]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u16-grapheme-next]) + gl_MODULE_INDICATOR([unigbrk/u16-grapheme-prev]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u16-grapheme-prev]) + gl_MODULE_INDICATOR([unigbrk/u32-grapheme-breaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u32-grapheme-breaks]) + gl_MODULE_INDICATOR([unigbrk/u32-grapheme-next]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u32-grapheme-next]) + gl_MODULE_INDICATOR([unigbrk/u32-grapheme-prev]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u32-grapheme-prev]) + gl_MODULE_INDICATOR([unigbrk/u8-grapheme-breaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u8-grapheme-breaks]) + gl_MODULE_INDICATOR([unigbrk/u8-grapheme-next]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u8-grapheme-next]) + gl_MODULE_INDICATOR([unigbrk/u8-grapheme-prev]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/u8-grapheme-prev]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/uc-gbrk-prop]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/uc-is-grapheme-break]) + gl_MODULE_INDICATOR([unigbrk/ulc-grapheme-breaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unigbrk/ulc-grapheme-breaks]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unilbrk.h]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/u16-possible-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/u16-width-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/u32-possible-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/u32-width-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/u8-possible-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/u8-width-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/ulc-possible-linebreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [unilbrk/ulc-width-linebreaks]) + gl_LIBUNISTRING_LIBHEADER([0.9.5], [uniname.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniname/uniname]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [uninorm.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/canonical-decomposition]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/composition]) + gl_LIBUNISTRING_MODULE([0.9.5], [uninorm/decomposing-form]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/decomposition]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/filter]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfc]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfd]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfkc]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfkd]) gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u16-normalize]) - # Code from module uninorm/u16-normcmp: - # Code from module uninorm/u16-normcoll: - # Code from module uninorm/u16-normxfrm: - # Code from module uninorm/u32-normalize: + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u16-normalize]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u16-normcmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u16-normcoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u16-normxfrm]) gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u32-normalize]) - # Code from module uninorm/u32-normcmp: - # Code from module uninorm/u32-normcoll: - # Code from module uninorm/u32-normxfrm: - # Code from module uninorm/u8-normalize: + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u32-normalize]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u32-normcmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u32-normcoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u32-normxfrm]) gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u8-normalize]) - # Code from module uninorm/u8-normcmp: - # Code from module uninorm/u8-normcoll: - # Code from module uninorm/u8-normxfrm: - # Code from module unistd: + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u8-normalize]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u8-normcmp]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u8-normcoll]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u8-normxfrm]) gl_UNISTD_H - # Code from module unistdio/base: - # Code from module unistdio/u-printf-args: + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistdio.h]) gl_PREREQ_PRINTF_ARGS - # Code from module unistdio/u16-asnprintf: - # Code from module unistdio/u16-asprintf: - # Code from module unistdio/u16-printf-parse: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-asprintf]) gl_PREREQ_PRINTF_PARSE - # Code from module unistdio/u16-snprintf: - # Code from module unistdio/u16-sprintf: - # Code from module unistdio/u16-u16-asnprintf: - # Code from module unistdio/u16-u16-asprintf: - # Code from module unistdio/u16-u16-snprintf: - # Code from module unistdio/u16-u16-sprintf: - # Code from module unistdio/u16-u16-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-sprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-asprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-sprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/u16-u16-vasprintf: - # Code from module unistdio/u16-u16-vsnprintf: - # Code from module unistdio/u16-u16-vsprintf: - # Code from module unistdio/u16-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-u16-vsprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/u16-vasprintf: - # Code from module unistdio/u16-vsnprintf: - # Code from module unistdio/u16-vsprintf: - # Code from module unistdio/u32-asnprintf: - # Code from module unistdio/u32-asprintf: - # Code from module unistdio/u32-printf-parse: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u16-vsprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-asprintf]) gl_PREREQ_PRINTF_PARSE - # Code from module unistdio/u32-snprintf: - # Code from module unistdio/u32-sprintf: - # Code from module unistdio/u32-u32-asnprintf: - # Code from module unistdio/u32-u32-asprintf: - # Code from module unistdio/u32-u32-snprintf: - # Code from module unistdio/u32-u32-sprintf: - # Code from module unistdio/u32-u32-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-sprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-asprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-sprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/u32-u32-vasprintf: - # Code from module unistdio/u32-u32-vsnprintf: - # Code from module unistdio/u32-u32-vsprintf: - # Code from module unistdio/u32-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-u32-vsprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/u32-vasprintf: - # Code from module unistdio/u32-vsnprintf: - # Code from module unistdio/u32-vsprintf: - # Code from module unistdio/u8-asnprintf: - # Code from module unistdio/u8-asprintf: - # Code from module unistdio/u8-printf-parse: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u32-vsprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-asprintf]) gl_PREREQ_PRINTF_PARSE - # Code from module unistdio/u8-snprintf: - # Code from module unistdio/u8-sprintf: - # Code from module unistdio/u8-u8-asnprintf: - # Code from module unistdio/u8-u8-asprintf: - # Code from module unistdio/u8-u8-snprintf: - # Code from module unistdio/u8-u8-sprintf: - # Code from module unistdio/u8-u8-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-sprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-asprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-sprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/u8-u8-vasprintf: - # Code from module unistdio/u8-u8-vsnprintf: - # Code from module unistdio/u8-u8-vsprintf: - # Code from module unistdio/u8-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-u8-vsprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/u8-vasprintf: - # Code from module unistdio/u8-vsnprintf: - # Code from module unistdio/u8-vsprintf: - # Code from module unistdio/ulc-asnprintf: - # Code from module unistdio/ulc-asprintf: - # Code from module unistdio/ulc-fprintf: - # Code from module unistdio/ulc-printf-parse: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/u8-vsprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-asnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-asprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-fprintf]) gl_PREREQ_PRINTF_PARSE - # Code from module unistdio/ulc-snprintf: - # Code from module unistdio/ulc-sprintf: - # Code from module unistdio/ulc-vasnprintf: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-snprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-sprintf]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS - # Code from module unistdio/ulc-vasprintf: - # Code from module unistdio/ulc-vfprintf: - # Code from module unistdio/ulc-vsnprintf: - # Code from module unistdio/ulc-vsprintf: - # Code from module unistr/base: - # Code from module unistr/u16-check: - # Code from module unistr/u16-chr: - # Code from module unistr/u16-cmp: - # Code from module unistr/u16-cmp2: - # Code from module unistr/u16-cpy: - # Code from module unistr/u16-cpy-alloc: - # Code from module unistr/u16-endswith: - # Code from module unistr/u16-mblen: - # Code from module unistr/u16-mbsnlen: - # Code from module unistr/u16-mbtouc: + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-vasnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-vasprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-vfprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-vsnprintf]) + gl_LIBUNISTRING_MODULE([0.9], [unistdio/ulc-vsprintf]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistr.h]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-check]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-chr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-cmp]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-cmp2]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-cpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-cpy-alloc]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-endswith]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-mblen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-mbsnlen]) gl_MODULE_INDICATOR([unistr/u16-mbtouc]) - # Code from module unistr/u16-mbtouc-unsafe: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-mbtouc]) gl_MODULE_INDICATOR([unistr/u16-mbtouc-unsafe]) - # Code from module unistr/u16-mbtoucr: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-mbtouc-unsafe]) gl_MODULE_INDICATOR([unistr/u16-mbtoucr]) - # Code from module unistr/u16-move: - # Code from module unistr/u16-next: - # Code from module unistr/u16-prev: - # Code from module unistr/u16-set: - # Code from module unistr/u16-startswith: - # Code from module unistr/u16-stpcpy: - # Code from module unistr/u16-stpncpy: - # Code from module unistr/u16-strcat: - # Code from module unistr/u16-strchr: - # Code from module unistr/u16-strcmp: - # Code from module unistr/u16-strcoll: - # Code from module unistr/u16-strcpy: - # Code from module unistr/u16-strcspn: - # Code from module unistr/u16-strdup: - # Code from module unistr/u16-strlen: - # Code from module unistr/u16-strmblen: - # Code from module unistr/u16-strmbtouc: - # Code from module unistr/u16-strncat: - # Code from module unistr/u16-strncmp: - # Code from module unistr/u16-strncpy: - # Code from module unistr/u16-strnlen: - # Code from module unistr/u16-strpbrk: - # Code from module unistr/u16-strrchr: - # Code from module unistr/u16-strspn: - # Code from module unistr/u16-strstr: - # Code from module unistr/u16-strtok: - # Code from module unistr/u16-to-u32: - # Code from module unistr/u16-to-u8: - # Code from module unistr/u16-uctomb: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-mbtoucr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-move]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-next]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-prev]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-set]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-startswith]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-stpcpy]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u16-stpncpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strcat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strchr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strcmp]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u16-strcoll]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strcpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strcspn]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strdup]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strlen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strmblen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strmbtouc]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strncat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strncmp]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strncpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strnlen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strpbrk]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strrchr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strspn]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u16-strstr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-strtok]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u16-to-u32]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u16-to-u8]) gl_MODULE_INDICATOR([unistr/u16-uctomb]) - # Code from module unistr/u32-check: - # Code from module unistr/u32-chr: - # Code from module unistr/u32-cmp: - # Code from module unistr/u32-cmp2: - # Code from module unistr/u32-cpy: - # Code from module unistr/u32-cpy-alloc: - # Code from module unistr/u32-endswith: - # Code from module unistr/u32-mblen: - # Code from module unistr/u32-mbsnlen: - # Code from module unistr/u32-mbtouc: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-uctomb]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-check]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-chr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-cmp]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-cmp2]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-cpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-cpy-alloc]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-endswith]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-mblen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-mbsnlen]) gl_MODULE_INDICATOR([unistr/u32-mbtouc]) - # Code from module unistr/u32-mbtouc-unsafe: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-mbtouc]) gl_MODULE_INDICATOR([unistr/u32-mbtouc-unsafe]) - # Code from module unistr/u32-mbtoucr: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-mbtouc-unsafe]) gl_MODULE_INDICATOR([unistr/u32-mbtoucr]) - # Code from module unistr/u32-move: - # Code from module unistr/u32-next: - # Code from module unistr/u32-prev: - # Code from module unistr/u32-set: - # Code from module unistr/u32-startswith: - # Code from module unistr/u32-stpcpy: - # Code from module unistr/u32-stpncpy: - # Code from module unistr/u32-strcat: - # Code from module unistr/u32-strchr: - # Code from module unistr/u32-strcmp: - # Code from module unistr/u32-strcoll: - # Code from module unistr/u32-strcpy: - # Code from module unistr/u32-strcspn: - # Code from module unistr/u32-strdup: - # Code from module unistr/u32-strlen: - # Code from module unistr/u32-strmblen: - # Code from module unistr/u32-strmbtouc: - # Code from module unistr/u32-strncat: - # Code from module unistr/u32-strncmp: - # Code from module unistr/u32-strncpy: - # Code from module unistr/u32-strnlen: - # Code from module unistr/u32-strpbrk: - # Code from module unistr/u32-strrchr: - # Code from module unistr/u32-strspn: - # Code from module unistr/u32-strstr: - # Code from module unistr/u32-strtok: - # Code from module unistr/u32-to-u16: - # Code from module unistr/u32-to-u8: - # Code from module unistr/u32-uctomb: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-mbtoucr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-move]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-next]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-prev]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-set]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-startswith]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-stpcpy]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u32-stpncpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strcat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strchr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strcmp]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u32-strcoll]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strcpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strcspn]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strdup]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strlen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strmblen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strmbtouc]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strncat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strncmp]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strncpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strnlen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strpbrk]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strrchr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strspn]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u32-strstr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strtok]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-to-u16]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-to-u8]) gl_MODULE_INDICATOR([unistr/u32-uctomb]) - # Code from module unistr/u8-check: - # Code from module unistr/u8-chr: - # Code from module unistr/u8-cmp: - # Code from module unistr/u8-cmp2: - # Code from module unistr/u8-cpy: - # Code from module unistr/u8-cpy-alloc: - # Code from module unistr/u8-endswith: - # Code from module unistr/u8-mblen: - # Code from module unistr/u8-mbsnlen: - # Code from module unistr/u8-mbtouc: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-uctomb]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-check]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-chr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-cmp]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-cmp2]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-cpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-cpy-alloc]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-endswith]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mblen]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbsnlen]) gl_MODULE_INDICATOR([unistr/u8-mbtouc]) - # Code from module unistr/u8-mbtouc-unsafe: + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc]) gl_MODULE_INDICATOR([unistr/u8-mbtouc-unsafe]) - # Code from module unistr/u8-mbtoucr: + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc-unsafe]) gl_MODULE_INDICATOR([unistr/u8-mbtoucr]) - # Code from module unistr/u8-move: - # Code from module unistr/u8-next: - # Code from module unistr/u8-prev: - # Code from module unistr/u8-set: - # Code from module unistr/u8-startswith: - # Code from module unistr/u8-stpcpy: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-move]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-next]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-prev]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-set]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-startswith]) AC_CHECK_FUNCS_ONCE([stpcpy]) - # Code from module unistr/u8-stpncpy: - # Code from module unistr/u8-strcat: - # Code from module unistr/u8-strchr: - # Code from module unistr/u8-strcmp: - # Code from module unistr/u8-strcoll: - # Code from module unistr/u8-strcpy: - # Code from module unistr/u8-strcspn: - # Code from module unistr/u8-strdup: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-stpcpy]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u8-stpncpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strcat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strchr]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-strcmp]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-strcoll]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strcpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strcspn]) AC_CHECK_FUNCS_ONCE([strdup]) - # Code from module unistr/u8-strlen: - # Code from module unistr/u8-strmblen: - # Code from module unistr/u8-strmbtouc: - # Code from module unistr/u8-strncat: - # Code from module unistr/u8-strncmp: - # Code from module unistr/u8-strncpy: - # Code from module unistr/u8-strnlen: - # Code from module unistr/u8-strpbrk: - # Code from module unistr/u8-strrchr: - # Code from module unistr/u8-strspn: - # Code from module unistr/u8-strstr: - # Code from module unistr/u8-strtok: - # Code from module unistr/u8-to-u16: - # Code from module unistr/u8-to-u32: - # Code from module unistr/u8-uctomb: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strdup]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strlen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strmblen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strmbtouc]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strncat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strncmp]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strncpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strnlen]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strpbrk]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strrchr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strspn]) + gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-strstr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-strtok]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u8-to-u16]) + gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u8-to-u32]) gl_MODULE_INDICATOR([unistr/u8-uctomb]) - # Code from module unitypes: - # Code from module uniwbrk/base: - # Code from module uniwbrk/table: - # Code from module uniwbrk/u16-wordbreaks: - # Code from module uniwbrk/u32-wordbreaks: - # Code from module uniwbrk/u8-wordbreaks: - # Code from module uniwbrk/ulc-wordbreaks: - # Code from module uniwbrk/wordbreak-property: - # Code from module uniwidth/base: - # Code from module uniwidth/u16-strwidth: - # Code from module uniwidth/u16-width: - # Code from module uniwidth/u32-strwidth: - # Code from module uniwidth/u32-width: - # Code from module uniwidth/u8-strwidth: - # Code from module uniwidth/u8-width: - # Code from module uniwidth/width: - # Code from module unused-parameter: - # Code from module verify: - # Code from module warn-on-use: - # Code from module wchar: + gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [unitypes.h]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwbrk.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwbrk/u16-wordbreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwbrk/u32-wordbreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwbrk/u8-wordbreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwbrk/ulc-wordbreaks]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwbrk/wordbreak-property]) + gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/u16-strwidth]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/u16-width]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/u32-strwidth]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/u32-width]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/u8-strwidth]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/u8-width]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width]) gl_WCHAR_H - # Code from module wctype: gl_WCTYPE_H - # Code from module wcwidth: gl_FUNC_WCWIDTH + if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then + AC_LIBOBJ([wcwidth]) + fi gl_WCHAR_MODULE_INDICATOR([wcwidth]) - # Code from module xsize: gl_XSIZE # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ @@ -1810,21 +1993,45 @@ changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) + gl_FUNC_BTOWC + if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then + AC_LIBOBJ([btowc]) + gl_PREREQ_BTOWC + fi + gl_WCHAR_MODULE_INDICATOR([btowc]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 gt_LOCALE_FR gt_LOCALE_TR_UTF8 gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) gl_ERROR + if test $ac_cv_lib_error_at_line = no; then + AC_LIBOBJ([error]) + gl_PREREQ_ERROR + fi m4_ifdef([AM_XGETTEXT_OPTION], [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + gl_FUNC_FDOPEN + if test $REPLACE_FDOPEN = 1; then + AC_LIBOBJ([fdopen]) + gl_PREREQ_FDOPEN + fi + gl_STDIO_MODULE_INDICATOR([fdopen]) gl_FUNC_GETPAGESIZE + if test $REPLACE_GETPAGESIZE = 1; then + AC_LIBOBJ([getpagesize]) + fi gl_UNISTD_MODULE_INDICATOR([getpagesize]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) + gl_INTTYPES_H + gl_INTTYPES_INCOMPLETE gl_DOUBLE_EXPONENT_LOCATION gl_FLOAT_EXPONENT_LOCATION gl_LONG_DOUBLE_EXPONENT_LOCATION + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) gl_LOCALE_H AC_CHECK_FUNCS_ONCE([newlocale]) AC_CHECK_FUNCS_ONCE([newlocale]) @@ -1833,19 +2040,70 @@ changequote([, ])dnl gt_LOCALE_JA gt_LOCALE_ZH_CN gt_LOCALE_FR_UTF8 + gl_FUNC_MBTOWC + if test $REPLACE_MBTOWC = 1; then + AC_LIBOBJ([mbtowc]) + gl_PREREQ_MBTOWC + fi + gl_STDLIB_MODULE_INDICATOR([mbtowc]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_MSVC_INVAL + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) + fi + gl_MSVC_NOTHROW + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) + fi AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>]) gl_FUNC_PUTENV + if test $REPLACE_PUTENV = 1; then + AC_LIBOBJ([putenv]) + gl_PREREQ_PUTENV + fi gl_STDLIB_MODULE_INDICATOR([putenv]) gl_FUNC_SETENV + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + AC_LIBOBJ([setenv]) + fi gl_STDLIB_MODULE_INDICATOR([setenv]) + gl_FUNC_SETLOCALE + if test $REPLACE_SETLOCALE = 1; then + AC_LIBOBJ([setlocale]) + gl_PREREQ_SETLOCALE + fi + gl_LOCALE_MODULE_INDICATOR([setlocale]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) - gt_TYPE_WCHAR_T - gt_TYPE_WINT_T + gl_STDALIGN_H + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + gl_STDIO_H gl_FUNC_STRERROR + if test $REPLACE_STRERROR = 1; then + AC_LIBOBJ([strerror]) + fi + gl_MODULE_INDICATOR([strerror]) gl_STRING_MODULE_INDICATOR([strerror]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + AC_LIBOBJ([strerror-override]) + gl_PREREQ_SYS_H_WINSOCK2 + fi + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + AC_CHECK_DECLS_ONCE([alarm]) gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) @@ -1859,6 +2117,7 @@ changequote([, ])dnl gt_LOCALE_FR_UTF8 gt_LOCALE_FR gt_LOCALE_FR_UTF8 + gt_LOCALE_AR AC_CHECK_DECLS_ONCE([alarm]) AC_CHECK_DECLS_ONCE([alarm]) AC_CHECK_DECLS_ONCE([alarm]) @@ -1892,6 +2151,7 @@ changequote([, ])dnl gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) + AC_CHECK_DECLS_ONCE([alarm]) gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) @@ -1913,6 +2173,16 @@ changequote([, ])dnl gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) @@ -1925,11 +2195,36 @@ changequote([, ])dnl gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) + AC_CHECK_DECLS_ONCE([alarm]) gt_LOCALE_FR gl_FUNC_UNSETENV + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + fi gl_STDLIB_MODULE_INDICATOR([unsetenv]) + gl_FUNC_WCRTOMB + if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then + AC_LIBOBJ([wcrtomb]) + gl_PREREQ_WCRTOMB + fi + gl_WCHAR_MODULE_INDICATOR([wcrtomb]) + gt_LOCALE_FR + gt_LOCALE_FR_UTF8 + gt_LOCALE_JA + gt_LOCALE_ZH_CN gl_FUNC_WCTOB + if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then + AC_LIBOBJ([wctob]) + gl_PREREQ_WCTOB + fi gl_WCHAR_MODULE_INDICATOR([wctob]) + gl_FUNC_WCTOMB + if test $REPLACE_WCTOMB = 1; then + AC_LIBOBJ([wctomb]) + gl_PREREQ_WCTOMB + fi + gl_STDLIB_MODULE_INDICATOR([wctomb]) gl_XALLOC gl_YIELD m4_popdef([gl_MODULE_INDICATOR_CONDITION]) @@ -2024,13 +2319,16 @@ AC_DEFUN([gltests_LIBSOURCES], [ # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ - build-aux/arg-nonnull.h - build-aux/c++defs.h build-aux/config.rpath - build-aux/unused-parameter.h - build-aux/warn-on-use.h + build-aux/snippet/_Noreturn.h + build-aux/snippet/arg-nonnull.h + build-aux/snippet/c++defs.h + build-aux/snippet/unused-parameter.h + build-aux/snippet/warn-on-use.h doc/relocatable.texi lib/alloca.in.h + lib/amemxfrm.c + lib/amemxfrm.h lib/array-mergesort.h lib/c-ctype.c lib/c-ctype.h @@ -2041,6 +2339,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/config.charset lib/errno.in.h lib/float+.h + lib/float.c lib/float.in.h lib/fpucw.h lib/frexp.c @@ -2050,7 +2349,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/glthread/lock.c lib/glthread/lock.h lib/glthread/threadlib.c + lib/iconv.c lib/iconv.in.h + lib/iconv_close.c lib/iconv_open-aix.gperf lib/iconv_open-hpux.gperf lib/iconv_open-irix.gperf @@ -2065,6 +2366,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/isnanf.c lib/isnanl-nolibm.h lib/isnanl.c + lib/iswblank.c + lib/itold.c + lib/langinfo.in.h lib/localcharset.c lib/localcharset.h lib/localename.c @@ -2073,9 +2377,11 @@ AC_DEFUN([gl_FILE_LIST], [ lib/malloca.c lib/malloca.h lib/malloca.valgrind + lib/math.c lib/math.in.h lib/mbchar.c lib/mbchar.h + lib/mbiter.c lib/mbiter.h lib/mbrtowc.c lib/mbsinit.c @@ -2084,8 +2390,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/memchr.valgrind lib/memcmp2.c lib/memcmp2.h - lib/memxfrm.c - lib/memxfrm.h lib/minmax.h lib/printf-args.c lib/printf-args.h @@ -2108,6 +2412,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/stdint.in.h lib/stdio-impl.h lib/stdlib.in.h + lib/str-kmp.h + lib/str-two-way.h lib/streq.h lib/striconveh.c lib/striconveh.h @@ -2115,7 +2421,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/striconveha.h lib/string.in.h lib/strncat.c - lib/unicase.h + lib/strstr.c + lib/sys_types.in.h + lib/unicase.in.h lib/unicase/cased.c lib/unicase/cased.h lib/unicase/casefold.h @@ -2208,7 +2516,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unicase/ulc-casecoll.c lib/unicase/ulc-casexfrm.c lib/unicase/unicasemap.h - lib/uniconv.h + lib/uniconv.in.h lib/uniconv/u-conv-from-enc.h lib/uniconv/u-conv-to-enc.h lib/uniconv/u-strconv-from-enc.h @@ -2231,8 +2539,10 @@ AC_DEFUN([gl_FILE_LIST], [ lib/uniconv/u8-strconv-from-locale.c lib/uniconv/u8-strconv-to-enc.c lib/uniconv/u8-strconv-to-locale.c - lib/unictype.h + lib/unictype.in.h lib/unictype/bidi_byname.c + lib/unictype/bidi_byname.gperf + lib/unictype/bidi_longname.c lib/unictype/bidi_name.c lib/unictype/bidi_of.c lib/unictype/bidi_of.h @@ -2255,6 +2565,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unictype/categ_Cs.h lib/unictype/categ_L.c lib/unictype/categ_L.h + lib/unictype/categ_LC.c + lib/unictype/categ_LC.h lib/unictype/categ_Ll.c lib/unictype/categ_Ll.h lib/unictype/categ_Lm.c @@ -2318,14 +2630,20 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unictype/categ_and.c lib/unictype/categ_and_not.c lib/unictype/categ_byname.c + lib/unictype/categ_byname.gperf + lib/unictype/categ_longname.c lib/unictype/categ_name.c lib/unictype/categ_none.c lib/unictype/categ_of.c lib/unictype/categ_of.h lib/unictype/categ_or.c lib/unictype/categ_test.c - lib/unictype/combining.c - lib/unictype/combining.h + lib/unictype/combiningclass.c + lib/unictype/combiningclass.h + lib/unictype/combiningclass_byname.c + lib/unictype/combiningclass_byname.gperf + lib/unictype/combiningclass_longname.c + lib/unictype/combiningclass_name.c lib/unictype/ctype_alnum.c lib/unictype/ctype_alnum.h lib/unictype/ctype_alpha.c @@ -2355,6 +2673,18 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unictype/digit.c lib/unictype/digit.h lib/unictype/identsyntaxmap.h + lib/unictype/joininggroup_byname.c + lib/unictype/joininggroup_byname.gperf + lib/unictype/joininggroup_name.c + lib/unictype/joininggroup_name.h + lib/unictype/joininggroup_of.c + lib/unictype/joininggroup_of.h + lib/unictype/joiningtype_byname.c + lib/unictype/joiningtype_byname.gperf + lib/unictype/joiningtype_longname.c + lib/unictype/joiningtype_name.c + lib/unictype/joiningtype_of.c + lib/unictype/joiningtype_of.h lib/unictype/mirror.c lib/unictype/mirror.h lib/unictype/numeric.c @@ -2399,6 +2729,20 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unictype/pr_bidi_whitespace.h lib/unictype/pr_byname.c lib/unictype/pr_byname.gperf + lib/unictype/pr_case_ignorable.c + lib/unictype/pr_case_ignorable.h + lib/unictype/pr_cased.c + lib/unictype/pr_cased.h + lib/unictype/pr_changes_when_casefolded.c + lib/unictype/pr_changes_when_casefolded.h + lib/unictype/pr_changes_when_casemapped.c + lib/unictype/pr_changes_when_casemapped.h + lib/unictype/pr_changes_when_lowercased.c + lib/unictype/pr_changes_when_lowercased.h + lib/unictype/pr_changes_when_titlecased.c + lib/unictype/pr_changes_when_titlecased.h + lib/unictype/pr_changes_when_uppercased.c + lib/unictype/pr_changes_when_uppercased.h lib/unictype/pr_combining.c lib/unictype/pr_combining.h lib/unictype/pr_composite.c @@ -2529,7 +2873,21 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unictype/sy_java_ident.c lib/unictype/sy_java_ident.h lib/unictype/sy_java_whitespace.c - lib/unilbrk.h + lib/unigbrk.in.h + lib/unigbrk/gbrkprop.h + lib/unigbrk/u16-grapheme-breaks.c + lib/unigbrk/u16-grapheme-next.c + lib/unigbrk/u16-grapheme-prev.c + lib/unigbrk/u32-grapheme-breaks.c + lib/unigbrk/u32-grapheme-next.c + lib/unigbrk/u32-grapheme-prev.c + lib/unigbrk/u8-grapheme-breaks.c + lib/unigbrk/u8-grapheme-next.c + lib/unigbrk/u8-grapheme-prev.c + lib/unigbrk/uc-gbrk-prop.c + lib/unigbrk/uc-is-grapheme-break.c + lib/unigbrk/ulc-grapheme-breaks.c + lib/unilbrk.in.h lib/unilbrk/lbrkprop1.h lib/unilbrk/lbrkprop2.h lib/unilbrk/lbrktables.c @@ -2544,11 +2902,11 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unilbrk/ulc-common.h lib/unilbrk/ulc-possible-linebreaks.c lib/unilbrk/ulc-width-linebreaks.c - lib/uniname.h + lib/uniname.in.h lib/uniname/gen-uninames.lisp lib/uniname/uniname.c lib/uniname/uninames.h - lib/uninorm.h + lib/uninorm.in.h lib/uninorm/canonical-decomposition.c lib/uninorm/compat-decomposition.c lib/uninorm/composition-table.gperf @@ -2583,8 +2941,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/uninorm/u8-normcoll.c lib/uninorm/u8-normxfrm.c lib/uninorm/uninorm-filter.c + lib/unistd.c lib/unistd.in.h - lib/unistdio.h + lib/unistdio.in.h lib/unistdio/u-asnprintf.h lib/unistdio/u-asprintf.h lib/unistdio/u-printf-args.c @@ -2657,7 +3016,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unistdio/ulc-vfprintf.c lib/unistdio/ulc-vsnprintf.c lib/unistdio/ulc-vsprintf.c - lib/unistr.h + lib/unistr.in.h lib/unistr/u-cmp2.h lib/unistr/u-cpy-alloc.h lib/unistr/u-cpy.h @@ -2809,8 +3168,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unistr/u8-to-u32.c lib/unistr/u8-uctomb-aux.c lib/unistr/u8-uctomb.c - lib/unitypes.h - lib/uniwbrk.h + lib/unitypes.in.h + lib/uniwbrk.in.h lib/uniwbrk/u-wordbreaks.h lib/uniwbrk/u16-wordbreaks.c lib/uniwbrk/u32-wordbreaks.c @@ -2820,7 +3179,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/uniwbrk/wbrktable.c lib/uniwbrk/wbrktable.h lib/uniwbrk/wordbreak-property.c - lib/uniwidth.h + lib/uniwidth.in.h lib/uniwidth/cjk.h lib/uniwidth/u16-strwidth.c lib/uniwidth/u16-width.c @@ -2832,12 +3191,17 @@ AC_DEFUN([gl_FILE_LIST], [ lib/vasnprintf.c lib/verify.h lib/wchar.in.h + lib/wctype-h.c lib/wctype.in.h lib/wcwidth.c + lib/xsize.c lib/xsize.h m4/00gnulib.m4 + m4/absolute-header.m4 m4/alloca.m4 + m4/btowc.m4 m4/codeset.m4 + m4/configmake.m4 m4/eealloc.m4 m4/environ.m4 m4/errno_h.m4 @@ -2846,11 +3210,14 @@ AC_DEFUN([gl_FILE_LIST], [ m4/exponentf.m4 m4/exponentl.m4 m4/extensions.m4 + m4/extern-inline.m4 m4/fcntl-o.m4 + m4/fdopen.m4 m4/float_h.m4 m4/fpieee.m4 m4/frexp.m4 m4/frexpl.m4 + m4/fseterr.m4 m4/getpagesize.m4 m4/glibc21.m4 m4/gnulib-common.m4 @@ -2861,16 +3228,22 @@ AC_DEFUN([gl_FILE_LIST], [ m4/inline.m4 m4/intlmacosx.m4 m4/intmax_t.m4 + m4/inttypes-pri.m4 + m4/inttypes.m4 m4/inttypes_h.m4 m4/isnand.m4 m4/isnanf.m4 m4/isnanl.m4 + m4/iswblank.m4 + m4/langinfo_h.m4 m4/lcmessage.m4 m4/ldexpl.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 + m4/libunistring-base.m4 m4/localcharset.m4 + m4/locale-ar.m4 m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-tr.m4 @@ -2887,27 +3260,38 @@ AC_DEFUN([gl_FILE_LIST], [ m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbstate_t.m4 + m4/mbtowc.m4 m4/memchr.m4 m4/minmax.m4 m4/mmap-anon.m4 + m4/msvc-inval.m4 + m4/msvc-nothrow.m4 m4/multiarch.m4 m4/nocrash.m4 + m4/off_t.m4 m4/printf-frexp.m4 m4/printf-frexpl.m4 m4/printf.m4 m4/putenv.m4 m4/relocatable-lib.m4 m4/setenv.m4 + m4/setlocale.m4 m4/signbit.m4 m4/size_max.m4 + m4/ssize_t.m4 + m4/stdalign.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdint_h.m4 + m4/stdio_h.m4 m4/stdlib_h.m4 m4/strerror.m4 m4/string_h.m4 m4/strncat.m4 + m4/strstr.m4 + m4/sys_socket_h.m4 + m4/sys_types_h.m4 m4/thread.m4 m4/threadlib.m4 m4/unistd_h.m4 @@ -2915,40 +3299,68 @@ AC_DEFUN([gl_FILE_LIST], [ m4/warn-on-use.m4 m4/wchar_h.m4 m4/wchar_t.m4 + m4/wcrtomb.m4 m4/wctob.m4 + m4/wctomb.m4 m4/wctype_h.m4 m4/wcwidth.m4 m4/wint_t.m4 m4/xalloc.m4 m4/xsize.m4 m4/yield.m4 + tests/infinity.h tests/init.sh tests/macros.h + tests/minus-zero.h tests/nan.h + tests/randomd.c + tests/randoml.c tests/signature.h tests/test-alloca-opt.c tests/test-array-mergesort.c + tests/test-btowc.c + tests/test-btowc1.sh + tests/test-btowc2.sh tests/test-c-ctype.c tests/test-c-strcase.sh tests/test-c-strcasecmp.c tests/test-c-strncasecmp.c tests/test-environ.c tests/test-errno.c + tests/test-fdopen.c + tests/test-fgetc.c + tests/test-float.c + tests/test-fputc.c + tests/test-fread.c + tests/test-frexp.c + tests/test-frexp.h tests/test-frexpl.c tests/test-fseterr.c + tests/test-fwrite.c tests/test-iconv-h.c tests/test-iconv.c + tests/test-init.sh + tests/test-intprops.c + tests/test-inttypes.c tests/test-isnand-nolibm.c tests/test-isnand.h tests/test-isnanf-nolibm.c tests/test-isnanf.h tests/test-isnanl-nolibm.c tests/test-isnanl.h + tests/test-iswblank.c + tests/test-langinfo.c tests/test-locale.c tests/test-localename.c tests/test-lock.c tests/test-malloca.c tests/test-math.c + tests/test-mbrtowc-w32-1.sh + tests/test-mbrtowc-w32-2.sh + tests/test-mbrtowc-w32-3.sh + tests/test-mbrtowc-w32-4.sh + tests/test-mbrtowc-w32-5.sh + tests/test-mbrtowc-w32.c tests/test-mbrtowc.c tests/test-mbrtowc1.sh tests/test-mbrtowc2.sh @@ -2960,20 +3372,41 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-printf-frexp.c tests/test-printf-frexpl.c tests/test-setenv.c + tests/test-setlocale1.c + tests/test-setlocale1.sh + tests/test-setlocale2.c + tests/test-setlocale2.sh tests/test-signbit.c + tests/test-stdalign.c tests/test-stdbool.c tests/test-stddef.c tests/test-stdint.c + tests/test-stdio.c tests/test-stdlib.c tests/test-strerror.c tests/test-striconveh.c tests/test-striconveha.c tests/test-string.c tests/test-strncat.c + tests/test-strstr.c + tests/test-sys_types.c + tests/test-sys_wait.h + tests/test-thread_create.c + tests/test-thread_self.c tests/test-unistd.c tests/test-unsetenv.c + tests/test-verify.c + tests/test-verify.sh tests/test-wchar.c - tests/test-wctype.c + tests/test-wcrtomb-w32-1.sh + tests/test-wcrtomb-w32-2.sh + tests/test-wcrtomb-w32-3.sh + tests/test-wcrtomb-w32-4.sh + tests/test-wcrtomb-w32-5.sh + tests/test-wcrtomb-w32.c + tests/test-wcrtomb.c + tests/test-wcrtomb.sh + tests/test-wctype-h.c tests/test-wcwidth.c tests/test-xalloc-die.c tests/test-xalloc-die.sh @@ -3046,6 +3479,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/uniconv/test-u8-strconv-from-enc.c tests/uniconv/test-u8-strconv-to-enc.c tests/unictype/test-bidi_byname.c + tests/unictype/test-bidi_longname.c tests/unictype/test-bidi_name.c tests/unictype/test-bidi_of.c tests/unictype/test-bidi_test.c @@ -3059,6 +3493,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unictype/test-categ_Co.c tests/unictype/test-categ_Cs.c tests/unictype/test-categ_L.c + tests/unictype/test-categ_LC.c tests/unictype/test-categ_Ll.c tests/unictype/test-categ_Lm.c tests/unictype/test-categ_Lo.c @@ -3092,12 +3527,16 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unictype/test-categ_and.c tests/unictype/test-categ_and_not.c tests/unictype/test-categ_byname.c + tests/unictype/test-categ_longname.c tests/unictype/test-categ_name.c tests/unictype/test-categ_none.c tests/unictype/test-categ_of.c tests/unictype/test-categ_or.c tests/unictype/test-categ_test_withtable.c - tests/unictype/test-combining.c + tests/unictype/test-combiningclass.c + tests/unictype/test-combiningclass_byname.c + tests/unictype/test-combiningclass_longname.c + tests/unictype/test-combiningclass_name.c tests/unictype/test-ctype_alnum.c tests/unictype/test-ctype_alpha.c tests/unictype/test-ctype_blank.c @@ -3114,6 +3553,15 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unictype/test-decdigit.h tests/unictype/test-digit.c tests/unictype/test-digit.h + tests/unictype/test-joininggroup_byname.c + tests/unictype/test-joininggroup_name.c + tests/unictype/test-joininggroup_of.c + tests/unictype/test-joininggroup_of.h + tests/unictype/test-joiningtype_byname.c + tests/unictype/test-joiningtype_longname.c + tests/unictype/test-joiningtype_name.c + tests/unictype/test-joiningtype_of.c + tests/unictype/test-joiningtype_of.h tests/unictype/test-mirror.c tests/unictype/test-numeric.c tests/unictype/test-numeric.h @@ -3137,6 +3585,13 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unictype/test-pr_bidi_segment_separator.c tests/unictype/test-pr_bidi_whitespace.c tests/unictype/test-pr_byname.c + tests/unictype/test-pr_case_ignorable.c + tests/unictype/test-pr_cased.c + tests/unictype/test-pr_changes_when_casefolded.c + tests/unictype/test-pr_changes_when_casemapped.c + tests/unictype/test-pr_changes_when_lowercased.c + tests/unictype/test-pr_changes_when_titlecased.c + tests/unictype/test-pr_changes_when_uppercased.c tests/unictype/test-pr_combining.c tests/unictype/test-pr_composite.c tests/unictype/test-pr_currency_symbol.c @@ -3205,6 +3660,22 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unictype/test-sy_c_whitespace.c tests/unictype/test-sy_java_ident.c tests/unictype/test-sy_java_whitespace.c + tests/unigbrk/GraphemeBreakTest.txt + tests/unigbrk/test-u16-grapheme-breaks.c + tests/unigbrk/test-u16-grapheme-next.c + tests/unigbrk/test-u16-grapheme-prev.c + tests/unigbrk/test-u32-grapheme-breaks.c + tests/unigbrk/test-u32-grapheme-next.c + tests/unigbrk/test-u32-grapheme-prev.c + tests/unigbrk/test-u8-grapheme-breaks.c + tests/unigbrk/test-u8-grapheme-next.c + tests/unigbrk/test-u8-grapheme-prev.c + tests/unigbrk/test-uc-gbrk-prop.c + tests/unigbrk/test-uc-gbrk-prop.h + tests/unigbrk/test-uc-is-grapheme-break.c + tests/unigbrk/test-uc-is-grapheme-break.sh + tests/unigbrk/test-ulc-grapheme-breaks.c + tests/unigbrk/test-ulc-grapheme-breaks.sh tests/unilbrk/test-u16-possible-linebreaks.c tests/unilbrk/test-u16-width-linebreaks.c tests/unilbrk/test-u32-possible-linebreaks.c @@ -3213,7 +3684,9 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unilbrk/test-u8-width-linebreaks.c tests/unilbrk/test-ulc-possible-linebreaks.c tests/unilbrk/test-ulc-width-linebreaks.c - tests/uniname/UnicodeDataNames.txt + tests/uniname/HangulSyllableNames.txt + tests/uniname/NameAliases.txt + tests/uniname/UnicodeData.txt tests/uniname/test-uninames.c tests/uniname/test-uninames.sh tests/uninorm/NormalizationTest.txt @@ -3312,6 +3785,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-stpcpy.h tests/unistr/test-stpncpy.h tests/unistr/test-strcat.h + tests/unistr/test-strchr.h tests/unistr/test-strcmp.h tests/unistr/test-strcpy.h tests/unistr/test-strdup.h @@ -3319,6 +3793,8 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-strncmp.h tests/unistr/test-strncpy.h tests/unistr/test-strnlen.h + tests/unistr/test-u-strstr.h + tests/unistr/test-u-strtok.h tests/unistr/test-u16-check.c tests/unistr/test-u16-chr.c tests/unistr/test-u16-cmp.c @@ -3338,6 +3814,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-u16-stpcpy.c tests/unistr/test-u16-stpncpy.c tests/unistr/test-u16-strcat.c + tests/unistr/test-u16-strchr.c tests/unistr/test-u16-strcmp.c tests/unistr/test-u16-strcmp.h tests/unistr/test-u16-strcoll.c @@ -3350,6 +3827,8 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-u16-strncmp.c tests/unistr/test-u16-strncpy.c tests/unistr/test-u16-strnlen.c + tests/unistr/test-u16-strstr.c + tests/unistr/test-u16-strtok.c tests/unistr/test-u16-to-u32.c tests/unistr/test-u16-to-u8.c tests/unistr/test-u16-uctomb.c @@ -3372,6 +3851,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-u32-stpcpy.c tests/unistr/test-u32-stpncpy.c tests/unistr/test-u32-strcat.c + tests/unistr/test-u32-strchr.c tests/unistr/test-u32-strcmp.c tests/unistr/test-u32-strcmp.h tests/unistr/test-u32-strcoll.c @@ -3384,6 +3864,8 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-u32-strncmp.c tests/unistr/test-u32-strncpy.c tests/unistr/test-u32-strnlen.c + tests/unistr/test-u32-strstr.c + tests/unistr/test-u32-strtok.c tests/unistr/test-u32-to-u16.c tests/unistr/test-u32-to-u8.c tests/unistr/test-u32-uctomb.c @@ -3406,6 +3888,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-u8-stpcpy.c tests/unistr/test-u8-stpncpy.c tests/unistr/test-u8-strcat.c + tests/unistr/test-u8-strchr.c tests/unistr/test-u8-strcmp.c tests/unistr/test-u8-strcmp.h tests/unistr/test-u8-strcoll.c @@ -3418,12 +3901,17 @@ AC_DEFUN([gl_FILE_LIST], [ tests/unistr/test-u8-strncmp.c tests/unistr/test-u8-strncpy.c tests/unistr/test-u8-strnlen.c + tests/unistr/test-u8-strstr.c + tests/unistr/test-u8-strtok.c tests/unistr/test-u8-to-u16.c tests/unistr/test-u8-to-u32.c tests/unistr/test-u8-uctomb.c + tests/uniwbrk/WordBreakTest.txt tests/uniwbrk/test-u16-wordbreaks.c tests/uniwbrk/test-u32-wordbreaks.c tests/uniwbrk/test-u8-wordbreaks.c + tests/uniwbrk/test-uc-wordbreaks.c + tests/uniwbrk/test-uc-wordbreaks.sh tests/uniwbrk/test-ulc-wordbreaks.c tests/uniwbrk/test-ulc-wordbreaks.sh tests/uniwidth/test-u16-strwidth.c @@ -3436,25 +3924,43 @@ AC_DEFUN([gl_FILE_LIST], [ tests/uniwidth/test-uc_width2.c tests/uniwidth/test-uc_width2.sh tests/zerosize-ptr.h + tests=lib/btowc.c tests=lib/error.c tests=lib/error.h tests=lib/exitfail.c tests=lib/exitfail.h + tests=lib/fdopen.c tests=lib/getpagesize.c tests=lib/gettext.h tests=lib/glthread/thread.c tests=lib/glthread/thread.h tests=lib/glthread/yield.h tests=lib/intprops.h + tests=lib/inttypes.in.h tests=lib/locale.in.h + tests=lib/mbtowc-impl.h + tests=lib/mbtowc.c + tests=lib/msvc-inval.c + tests=lib/msvc-inval.h + tests=lib/msvc-nothrow.c + tests=lib/msvc-nothrow.h tests=lib/progname.c tests=lib/progname.h tests=lib/putenv.c tests=lib/setenv.c + tests=lib/setlocale.c + tests=lib/stdalign.in.h + tests=lib/stdio.in.h + tests=lib/strerror-override.c + tests=lib/strerror-override.h tests=lib/strerror.c tests=lib/unsetenv.c + tests=lib/wcrtomb.c tests=lib/wctob.c + tests=lib/wctomb-impl.h + tests=lib/wctomb.c tests=lib/xalloc-die.c + tests=lib/xalloc-oversized.h tests=lib/xalloc.h tests=lib/xmalloc.c ]) diff --git a/gnulib-m4/iconv.m4 b/gnulib-m4/iconv.m4 index f46ff14..4e37363 100644 --- a/gnulib-m4/iconv.m4 +++ b/gnulib-m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial 9 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. +# iconv.m4 serial 19 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2007-2014 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. @@ -30,27 +30,35 @@ AC_DEFUN([AM_ICONV_LINK], dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - AC_TRY_LINK([#include <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" @@ -58,33 +66,43 @@ AC_DEFUN([AM_ICONV_LINK], ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ - dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - AC_TRY_RUN([ + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ #include <iconv.h> #include <string.h> -int main () -{ + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -93,17 +111,37 @@ int main () iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -112,17 +150,18 @@ int main () iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -136,13 +175,16 @@ int main () && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], - [case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac]) + result |= 16; + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in @@ -170,30 +212,60 @@ int main () AC_SUBST([LTLIBICONV]) ]) -AC_DEFUN([AM_ICONV], +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl 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. +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], [ 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_TRY_COMPILE([ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include <stdlib.h> #include <iconv.h> extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(__cplusplus) +#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_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]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_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 + ICONV_CONST="const" + fi + ]) fi ]) diff --git a/gnulib-m4/iconv_h.m4 b/gnulib-m4/iconv_h.m4 index 7366cb9..c6878fa 100644 --- a/gnulib-m4/iconv_h.m4 +++ b/gnulib-m4/iconv_h.m4 @@ -1,5 +1,5 @@ -# iconv_h.m4 serial 6 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# iconv_h.m4 serial 8 +dnl Copyright (C) 2007-2015 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. @@ -18,6 +18,7 @@ AC_DEFUN([gl_REPLACE_ICONV_H], [ AC_REQUIRE([gl_ICONV_H_DEFAULTS]) ICONV_H='iconv.h' + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) ]) AC_DEFUN([gl_ICONV_MODULE_INDICATOR], @@ -29,9 +30,12 @@ AC_DEFUN([gl_ICONV_MODULE_INDICATOR], AC_DEFUN([gl_ICONV_H_DEFAULTS], [ + GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV]) dnl Assume proper GNU behavior unless another module says otherwise. + ICONV_CONST=; AC_SUBST([ICONV_CONST]) REPLACE_ICONV=0; AC_SUBST([REPLACE_ICONV]) REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN]) REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF]) ICONV_H=''; AC_SUBST([ICONV_H]) + AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"]) ]) diff --git a/gnulib-m4/iconv_open.m4 b/gnulib-m4/iconv_open.m4 index 60f62ca..177fccb 100644 --- a/gnulib-m4/iconv_open.m4 +++ b/gnulib-m4/iconv_open.m4 @@ -1,5 +1,5 @@ -# iconv_open.m4 serial 7 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# iconv_open.m4 serial 14 +dnl Copyright (C) 2007-2015 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,7 +16,7 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN], dnl We know that GNU libiconv and GNU libc do. AC_EGREP_CPP([gnu_iconv], [ #include <iconv.h> - #if defined _LIBICONV_VERSION || defined __GLIBC__ + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) gnu_iconv #endif ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no]) @@ -36,6 +36,16 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN], gl_REPLACE_ICONV_OPEN fi 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 + ]) fi ]) @@ -43,198 +53,4 @@ AC_DEFUN([gl_REPLACE_ICONV_OPEN], [ gl_REPLACE_ICONV_H REPLACE_ICONV_OPEN=1 - AC_LIBOBJ([iconv_open]) -]) - -AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF], -[ - AC_REQUIRE([gl_FUNC_ICONV_OPEN]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - AC_REQUIRE([gl_ICONV_H_DEFAULTS]) - if test "$am_cv_func_iconv" = yes; then - if test -n "$am_cv_proto_iconv_arg1"; then - ICONV_CONST="const" - else - ICONV_CONST= - fi - AC_SUBST([ICONV_CONST]) - AC_CACHE_CHECK([whether iconv supports conversion between UTF-8 and UTF-{16,32}{BE,LE}], - [gl_cv_func_iconv_supports_utf], - [ - save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - AC_TRY_RUN([ -#include <iconv.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#define ASSERT(expr) if (!(expr)) return 1; -int main () -{ - /* Test conversion from UTF-8 to UTF-16BE with no errors. */ - { - static const char input[] = - "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]"; - static const char expected[] = - "\000J\000a\000p\000a\000n\000e\000s\000e\000 \000(\145\345\147\054\212\236\000)\000 \000[\330\065\335\015\330\065\335\036\330\065\335\055\000]"; - iconv_t cd; - char buf[100]; - const char *inptr; - size_t inbytesleft; - char *outptr; - size_t outbytesleft; - size_t res; - cd = iconv_open ("UTF-16BE", "UTF-8"); - ASSERT (cd != (iconv_t)(-1)); - inptr = input; - inbytesleft = sizeof (input) - 1; - outptr = buf; - outbytesleft = sizeof (buf); - res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - ASSERT (res == 0 && inbytesleft == 0); - ASSERT (outptr == buf + (sizeof (expected) - 1)); - ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); - ASSERT (iconv_close (cd) == 0); - } - /* Test conversion from UTF-8 to UTF-16LE with no errors. */ - { - static const char input[] = - "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]"; - static const char expected[] = - "J\000a\000p\000a\000n\000e\000s\000e\000 \000(\000\345\145\054\147\236\212)\000 \000[\000\065\330\015\335\065\330\036\335\065\330\055\335]\000"; - iconv_t cd; - char buf[100]; - const char *inptr; - size_t inbytesleft; - char *outptr; - size_t outbytesleft; - size_t res; - cd = iconv_open ("UTF-16LE", "UTF-8"); - ASSERT (cd != (iconv_t)(-1)); - inptr = input; - inbytesleft = sizeof (input) - 1; - outptr = buf; - outbytesleft = sizeof (buf); - res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - ASSERT (res == 0 && inbytesleft == 0); - ASSERT (outptr == buf + (sizeof (expected) - 1)); - ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); - ASSERT (iconv_close (cd) == 0); - } - /* Test conversion from UTF-8 to UTF-32BE with no errors. */ - { - static const char input[] = - "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]"; - static const char expected[] = - "\000\000\000J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000 \000\000\000(\000\000\145\345\000\000\147\054\000\000\212\236\000\000\000)\000\000\000 \000\000\000[\000\001\325\015\000\001\325\036\000\001\325\055\000\000\000]"; - iconv_t cd; - char buf[100]; - const char *inptr; - size_t inbytesleft; - char *outptr; - size_t outbytesleft; - size_t res; - cd = iconv_open ("UTF-32BE", "UTF-8"); - ASSERT (cd != (iconv_t)(-1)); - inptr = input; - inbytesleft = sizeof (input) - 1; - outptr = buf; - outbytesleft = sizeof (buf); - res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - ASSERT (res == 0 && inbytesleft == 0); - ASSERT (outptr == buf + (sizeof (expected) - 1)); - ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); - ASSERT (iconv_close (cd) == 0); - } - /* Test conversion from UTF-8 to UTF-32LE with no errors. */ - { - static const char input[] = - "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]"; - static const char expected[] = - "J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000 \000\000\000(\000\000\000\345\145\000\000\054\147\000\000\236\212\000\000)\000\000\000 \000\000\000[\000\000\000\015\325\001\000\036\325\001\000\055\325\001\000]\000\000\000"; - iconv_t cd; - char buf[100]; - const char *inptr; - size_t inbytesleft; - char *outptr; - size_t outbytesleft; - size_t res; - cd = iconv_open ("UTF-32LE", "UTF-8"); - ASSERT (cd != (iconv_t)(-1)); - inptr = input; - inbytesleft = sizeof (input) - 1; - outptr = buf; - outbytesleft = sizeof (buf); - res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - ASSERT (res == 0 && inbytesleft == 0); - ASSERT (outptr == buf + (sizeof (expected) - 1)); - ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); - ASSERT (iconv_close (cd) == 0); - } - /* Test conversion from UTF-16BE to UTF-8 with no errors. - This test fails on NetBSD 3.0. */ - { - static const char input[] = - "\000J\000a\000p\000a\000n\000e\000s\000e\000 \000(\145\345\147\054\212\236\000)\000 \000[\330\065\335\015\330\065\335\036\330\065\335\055\000]"; - static const char expected[] = - "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]"; - iconv_t cd; - char buf[100]; - const char *inptr; - size_t inbytesleft; - char *outptr; - size_t outbytesleft; - size_t res; - cd = iconv_open ("UTF-8", "UTF-16BE"); - ASSERT (cd != (iconv_t)(-1)); - inptr = input; - inbytesleft = sizeof (input) - 1; - outptr = buf; - outbytesleft = sizeof (buf); - res = iconv (cd, - (ICONV_CONST char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - ASSERT (res == 0 && inbytesleft == 0); - ASSERT (outptr == buf + (sizeof (expected) - 1)); - ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0); - ASSERT (iconv_close (cd) == 0); - } - return 0; -}], [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 OSF/1 5.1 has these encodings, but inserts a BOM in the "to" - dnl direction. - gl_cv_func_iconv_supports_utf=no - if test $gl_func_iconv_gnu = yes; then - gl_cv_func_iconv_supports_utf=yes - else -changequote(,)dnl - case "$host_os" in - solaris2.9 | solaris2.1[0-9]) gl_cv_func_iconv_supports_utf=yes ;; - esac -changequote([,])dnl - fi - ]) - LIBS="$save_LIBS" - ]) - 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 - AC_LIBOBJ([iconv]) - AC_LIBOBJ([iconv_close]) - fi - fi ]) diff --git a/gnulib-m4/include_next.m4 b/gnulib-m4/include_next.m4 index c7e0672..233d254 100644 --- a/gnulib-m4/include_next.m4 +++ b/gnulib-m4/include_next.m4 @@ -1,5 +1,5 @@ -# include_next.m4 serial 14 -dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. +# include_next.m4 serial 23 +dnl Copyright (C) 2006-2015 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,13 @@ dnl does not warn about some things, and on some systems (Solaris and Interix) dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead dnl of plain '__STDC__'. +dnl +dnl PRAGMA_COLUMNS can be used in files that override system header files, so +dnl as to avoid compilation errors on HP NonStop systems when the gnulib file +dnl is included by a system header file that does a "#pragma COLUMNS 80" (which +dnl has the effect of truncating the lines of that file and all files that it +dnl includes to 80 columns) and the gnulib file has lines longer than 80 +dnl columns. AC_DEFUN([gl_INCLUDE_NEXT], [ @@ -68,10 +75,11 @@ EOF EOF gl_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" - AC_COMPILE_IFELSE([#include <conftest.h>], +dnl We intentionally avoid using AC_LANG_SOURCE here. + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], [gl_cv_have_include_next=yes], [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" - AC_COMPILE_IFELSE([#include <conftest.h>], + AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], [gl_cv_have_include_next=buggy], [gl_cv_have_include_next=no]) ]) @@ -97,6 +105,24 @@ EOF 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], + [ +#ifdef __TANDEM +choke me +#endif + ], + [gl_cv_pragma_columns=yes], + [gl_cv_pragma_columns=no]) + ]) + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + AC_SUBST([PRAGMA_COLUMNS]) ]) # gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) @@ -117,71 +143,81 @@ EOF # even if the compiler does not support include_next. # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". -# Use `""', not `<>', so that the /// cannot be confused with a C99 comment. +# Use '""', not '<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. +# +# This macro also checks whether each header exists, by invoking +# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument. AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ + gl_NEXT_HEADERS_INTERNAL([$1], [check]) +]) + +# gl_NEXT_HEADERS(HEADER1 HEADER2 ...) +# ------------------------------------ +# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist. +# This is suitable for headers like <stddef.h> that are standardized by C89 +# and therefore can be assumed to exist. +AC_DEFUN([gl_NEXT_HEADERS], +[ + gl_NEXT_HEADERS_INTERNAL([$1], [assume]) +]) + +# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS. +AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], +[ AC_REQUIRE([gl_INCLUDE_NEXT]) AC_REQUIRE([AC_CANONICAL_HOST]) - AC_CHECK_HEADERS_ONCE([$1]) + m4_if([$2], [check], + [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]), - [AS_VAR_PUSHDEF([gl_header_exists], - [ac_cv_header_]m4_defn([gl_HEADER_NAME])) - if test AS_VAR_GET(gl_header_exists) = yes; then - AC_LANG_CONFTEST( - [AC_LANG_SOURCE( - [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] - )]) - dnl AIX "xlc -E" and "cc -E" omit #line directives for header files - dnl that contain only a #include of other header files and no - dnl non-comment tokens of their own. This leads to a failure to - dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h> - dnl and others. The workaround is to force preservation of comments - dnl through option -C. This ensures all necessary #line directives - dnl are present. GCC supports option -C as well. - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - dnl eval is necessary to expand gl_absname_cpp. - dnl Ultrix and Pyramid sh refuse to redirect output of eval, - dnl so use subshell. - AS_VAR_SET([gl_next_header], - ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | - sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{ - s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1# - s#^/[^/]#//&# - p - q - }'`'"']) - else - AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) - fi - AS_VAR_POPDEF([gl_header_exists])]) + [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 + 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'"']) + m4_if([$2], [check], + [else + 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])), [$gl_next_as_first_directive]) AS_VAR_POPDEF([gl_next_header])]) ]) + +# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE; +# this fallback is safe for all earlier autoconf versions. +m4_define_default([AC_LANG_DEFINES_PROVIDED]) diff --git a/gnulib-m4/inline.m4 b/gnulib-m4/inline.m4 index 4ef768d..dc7063e 100644 --- a/gnulib-m4/inline.m4 +++ b/gnulib-m4/inline.m4 @@ -1,5 +1,5 @@ # inline.m4 serial 4 -dnl Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2015 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. diff --git a/gnulib-m4/intlmacosx.m4 b/gnulib-m4/intlmacosx.m4 index dd91025..8a045f6 100644 --- a/gnulib-m4/intlmacosx.m4 +++ b/gnulib-m4/intlmacosx.m4 @@ -1,5 +1,5 @@ -# intlmacosx.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. +# intlmacosx.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2004-2014 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. @@ -13,35 +13,40 @@ dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. -dnl Checks for special options needed on MacOS X. +dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ - dnl Check for API introduced in MacOS X 10.2. + dnl Check for API introduced in Mac OS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], - [CFPreferencesCopyAppValue(NULL, NULL)], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <CoreFoundation/CFPreferences.h>]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], - [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi - dnl Check for API introduced in MacOS X 10.3. + dnl Check for API introduced in Mac OS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <CoreFoundation/CFLocale.h>]], + [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], - [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then diff --git a/gnulib-m4/intmax_t.m4 b/gnulib-m4/intmax_t.m4 index 975caac..4bd8155 100644 --- a/gnulib-m4/intmax_t.m4 +++ b/gnulib-m4/intmax_t.m4 @@ -1,5 +1,5 @@ -# intmax_t.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation, +# intmax_t.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2015 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,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. -AC_PREREQ([2.13]) +AC_PREREQ([2.53]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in <stdint.h> or <inttypes.h>. @@ -38,7 +38,9 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include <stddef.h> #include <stdlib.h> #if HAVE_STDINT_H_WITH_UINTMAX @@ -47,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #if HAVE_INTTYPES_H_WITH_UINTMAX #include <inttypes.h> #endif -], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) + ]], + [[intmax_t x = -1; return !x;]])], + [gt_cv_c_intmax_t=yes], + [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) diff --git a/gnulib-m4/inttypes-pri.m4 b/gnulib-m4/inttypes-pri.m4 new file mode 100644 index 0000000..0884e71 --- /dev/null +++ b/gnulib-m4/inttypes-pri.m4 @@ -0,0 +1,42 @@ +# inttypes-pri.m4 serial 7 (gettext-0.18.2) +dnl Copyright (C) 1997-2002, 2006, 2008-2015 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.53]) + +# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* +# macros to non-string values. This is the case on AIX 4.3.3. + +AC_DEFUN([gt_INTTYPES_PRI], +[ + AC_CHECK_HEADERS([inttypes.h]) + if test $ac_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + [gt_cv_inttypes_pri_broken], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + ]], + [[]])], + [gt_cv_inttypes_pri_broken=no], + [gt_cv_inttypes_pri_broken=yes]) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], + [Define if <inttypes.h> exists and defines unusable PRI* macros.]) + PRI_MACROS_BROKEN=1 + else + PRI_MACROS_BROKEN=0 + fi + AC_SUBST([PRI_MACROS_BROKEN]) +]) diff --git a/gnulib-m4/inttypes.m4 b/gnulib-m4/inttypes.m4 new file mode 100644 index 0000000..4209ffd --- /dev/null +++ b/gnulib-m4/inttypes.m4 @@ -0,0 +1,158 @@ +# inttypes.m4 serial 26 +dnl Copyright (C) 2006-2015 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]) +]) + +# Ensure that the PRI* and SCN* macros are defined appropriately. +AC_DEFUN([gl_INTTYPES_PRI_SCN], +[ + AC_REQUIRE([gt_INTTYPES_PRI]) + + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'. + PRIPTR_PREFIX='"l"' + 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) + #elif HAVE_LONG_LONG_INT + #define CONDITION ($4) + #else + #define CONDITION 0 + #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]) + 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]) + PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) + 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]) +]) diff --git a/gnulib-m4/inttypes_h.m4 b/gnulib-m4/inttypes_h.m4 index 782d77e..d0b5f5d 100644 --- a/gnulib-m4/inttypes_h.m4 +++ b/gnulib-m4/inttypes_h.m4 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 9 -dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. +# inttypes_h.m4 serial 10 +dnl Copyright (C) 1997-2004, 2006, 2008-2015 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,12 +12,15 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], - [AC_TRY_COMPILE( - [#include <sys/types.h> -#include <inttypes.h>], - [uintmax_t i = (uintmax_t) -1; return !i;], - [gl_cv_header_inttypes_h=yes], - [gl_cv_header_inttypes_h=no])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <sys/types.h> +#include <inttypes.h> + ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_inttypes_h=yes], + [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, diff --git a/gnulib-m4/isnand.m4 b/gnulib-m4/isnand.m4 index cd91628..4d5c615 100644 --- a/gnulib-m4/isnand.m4 +++ b/gnulib-m4/isnand.m4 @@ -1,5 +1,5 @@ -# isnand.m4 serial 6 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# isnand.m4 serial 11 +dnl Copyright (C) 2007-2015 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,7 +24,6 @@ AC_DEFUN([gl_FUNC_ISNAND], else gl_func_isnand=no HAVE_ISNAND=0 - gl_BUILD_ISNAND fi AC_SUBST([ISNAND_LIBM]) ]) @@ -34,19 +33,17 @@ dnl Check how to get or define isnand() without linking with libm. AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM], [ gl_HAVE_ISNAND_NO_LIBM + gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm if test $gl_cv_func_isnand_no_libm = yes; then AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1], [Define if the isnan(double) function is available in libc.]) - else - gl_BUILD_ISNAND fi ]) -dnl Pull in replacement isnand definition. It does not need -lm. -AC_DEFUN([gl_BUILD_ISNAND], +dnl Prerequisites of replacement isnand definition. It does not need -lm. +AC_DEFUN([gl_PREREQ_ISNAND], [ - AC_LIBOBJ([isnand]) - gl_DOUBLE_EXPONENT_LOCATION + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) ]) dnl Test whether isnand() can be used with libm. @@ -58,16 +55,18 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include <math.h> - #if __GNUC__ >= 4 - # undef isnand - # define isnand(x) __builtin_isnand ((double)(x)) - #elif defined isnan - # undef isnand - # define isnand(x) isnan ((double)(x)) - #endif - double x;], - [return isnand (x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #elif defined isnan + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x;]], + [[return isnand (x);]])], [gl_cv_func_isnand_in_libm=yes], [gl_cv_func_isnand_in_libm=no]) LIBS="$save_LIBS" @@ -79,16 +78,18 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM], AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm], [gl_cv_func_isnand_no_libm], [ - AC_TRY_LINK([#include <math.h> - #if __GNUC__ >= 4 - # undef isnand - # define isnand(x) __builtin_isnan ((double)(x)) - #else - # undef isnand - # define isnand(x) isnan ((double)(x)) - #endif - double x;], - [return isnand (x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + #if __GNUC__ >= 4 + # undef isnand + # define isnand(x) __builtin_isnan ((double)(x)) + #else + # undef isnand + # define isnand(x) isnan ((double)(x)) + #endif + double x;]], + [[return isnand (x);]])], [gl_cv_func_isnand_no_libm=yes], [gl_cv_func_isnand_no_libm=no]) ]) diff --git a/gnulib-m4/isnanf.m4 b/gnulib-m4/isnanf.m4 index 1509fb4..09c3e5e 100644 --- a/gnulib-m4/isnanf.m4 +++ b/gnulib-m4/isnanf.m4 @@ -1,5 +1,5 @@ -# isnanf.m4 serial 10 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# isnanf.m4 serial 14 +dnl Copyright (C) 2007-2015 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,6 +17,7 @@ AC_DEFUN([gl_FUNC_ISNANF], ISNANF_LIBM=-lm fi fi + dnl The variable gl_func_isnanf set here is used by isnan.m4. if test $gl_cv_func_isnanf_no_libm = yes \ || test $gl_cv_func_isnanf_in_libm = yes; then save_LIBS="$LIBS" @@ -32,7 +33,6 @@ AC_DEFUN([gl_FUNC_ISNANF], fi if test $gl_func_isnanf != yes; then HAVE_ISNANF=0 - gl_BUILD_ISNANF fi AC_SUBST([ISNANF_LIBM]) ]) @@ -51,17 +51,17 @@ AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM], *) false;; esac }; then + gl_func_isnanf_no_libm=yes AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1], [Define if the isnan(float) function is available in libc.]) else - gl_BUILD_ISNANF + gl_func_isnanf_no_libm=no fi ]) -dnl Pull in replacement isnanf definition. It does not need -lm. -AC_DEFUN([gl_BUILD_ISNANF], +dnl Prerequisites of replacement isnanf definition. It does not need -lm. +AC_DEFUN([gl_PREREQ_ISNANF], [ - AC_LIBOBJ([isnanf]) gl_FLOAT_EXPONENT_LOCATION ]) @@ -71,16 +71,18 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM], AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm], [gl_cv_func_isnanf_no_libm], [ - AC_TRY_LINK([#include <math.h> - #if __GNUC__ >= 4 - # undef isnanf - # define isnanf(x) __builtin_isnanf ((float)(x)) - #elif defined isnan - # undef isnanf - # define isnanf(x) isnan ((float)(x)) - #endif - float x;], - [return isnanf (x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x;]], + [[return isnanf (x);]])], [gl_cv_func_isnanf_no_libm=yes], [gl_cv_func_isnanf_no_libm=no]) ]) @@ -94,16 +96,18 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include <math.h> - #if __GNUC__ >= 4 - # undef isnanf - # define isnanf(x) __builtin_isnanf ((float)(x)) - #elif defined isnan - # undef isnanf - # define isnanf(x) isnan ((float)(x)) - #endif - float x;], - [return isnanf (x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + #if __GNUC__ >= 4 + # undef isnanf + # define isnanf(x) __builtin_isnanf ((float)(x)) + #elif defined isnan + # undef isnanf + # define isnanf(x) isnan ((float)(x)) + #endif + float x;]], + [[return isnanf (x);]])], [gl_cv_func_isnanf_in_libm=yes], [gl_cv_func_isnanf_in_libm=no]) LIBS="$save_LIBS" @@ -120,7 +124,8 @@ AC_DEFUN([gl_ISNANF_WORKS], AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <math.h> #if __GNUC__ >= 4 # undef isnanf @@ -145,13 +150,13 @@ NaN () typedef union { unsigned int word[NWORDS]; float value; } memory_float; int main() { - memory_float m; + int result = 0; if (isnanf (1.0f / 0.0f)) - return 1; + result |= 1; if (!isnanf (NaN ())) - return 1; + result |= 2; #if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT /* The isnanf function should be immune against changes in the sign bit and @@ -159,17 +164,21 @@ int main() a sign bit or a mantissa bit. */ if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0) { + memory_float m; + 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; if (!isnanf (m.value)) - return 1; + result |= 4; } #endif - return 0; -}], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no], + return result; +}]])], + [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";; diff --git a/gnulib-m4/isnanl.m4 b/gnulib-m4/isnanl.m4 index 25daeca..b86ca9e 100644 --- a/gnulib-m4/isnanl.m4 +++ b/gnulib-m4/isnanl.m4 @@ -1,5 +1,5 @@ -# isnanl.m4 serial 12 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# isnanl.m4 serial 19 +dnl Copyright (C) 2007-2015 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. @@ -15,6 +15,7 @@ AC_DEFUN([gl_FUNC_ISNANL], ISNANL_LIBM=-lm fi fi + dnl The variable gl_func_isnanl set here is used by isnan.m4. if test $gl_cv_func_isnanl_no_libm = yes \ || test $gl_cv_func_isnanl_in_libm = yes; then save_LIBS="$LIBS" @@ -30,7 +31,6 @@ AC_DEFUN([gl_FUNC_ISNANL], fi if test $gl_func_isnanl != yes; then HAVE_ISNANL=0 - gl_BUILD_ISNANL fi AC_SUBST([ISNANL_LIBM]) ]) @@ -49,16 +49,14 @@ AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM], if test $gl_func_isnanl_no_libm = yes; then AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1], [Define if the isnan(long double) function is available in libc.]) - else - gl_BUILD_ISNANL fi ]) -dnl Pull in replacement isnanl definition. It does not need -lm. -AC_DEFUN([gl_BUILD_ISNANL], +dnl Prerequisites of replacement isnanl definition. It does not need -lm. +AC_DEFUN([gl_PREREQ_ISNANL], [ - AC_LIBOBJ([isnanl]) gl_LONG_DOUBLE_EXPONENT_LOCATION + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) ]) dnl Test whether isnanl() can be used without libm. @@ -67,16 +65,18 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM], AC_CACHE_CHECK([whether isnan(long double) can be used without linking with libm], [gl_cv_func_isnanl_no_libm], [ - AC_TRY_LINK([#include <math.h> - #if __GNUC__ >= 4 - # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) - #elif defined isnan - # undef isnanl - # define isnanl(x) isnan ((long double)(x)) - #endif - long double x;], - [return isnanl (x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x;]], + [[return isnanl (x);]])], [gl_cv_func_isnanl_no_libm=yes], [gl_cv_func_isnanl_no_libm=no]) ]) @@ -90,35 +90,36 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include <math.h> - #if __GNUC__ >= 4 - # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) - #elif defined isnan - # undef isnanl - # define isnanl(x) isnan ((long double)(x)) - #endif - long double x;], - [return isnanl (x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + #if __GNUC__ >= 4 + # undef isnanl + # define isnanl(x) __builtin_isnanl ((long double)(x)) + #elif defined isnan + # undef isnanl + # define isnanl(x) isnan ((long double)(x)) + #endif + long double x;]], + [[return isnanl (x);]])], [gl_cv_func_isnanl_in_libm=yes], [gl_cv_func_isnanl_in_libm=no]) LIBS="$save_LIBS" ]) ]) -dnl Test whether isnanl() recognizes all numbers which are neither finite nor -dnl infinite. This test fails e.g. on NetBSD/i386 and on glibc/ia64. -dnl Also, the GCC >= 4.0 built-in __builtin_isnanl does not pass the tests -dnl - for pseudo-denormals on i686 and x86_64, -dnl - for pseudo-zeroes, unnormalized numbers, and pseudo-denormals on ia64. +dnl Test whether isnanl() recognizes all canonical numbers which are neither +dnl finite nor infinite. AC_DEFUN([gl_FUNC_ISNANL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <float.h> #include <limits.h> #include <math.h> @@ -146,30 +147,34 @@ static long double NaNl () #endif int main () { - memory_long_double m; - unsigned int i; + int result = 0; if (!isnanl (NaNl ())) - return 1; + result |= 1; - /* The isnanl function should be immune against changes in the sign bit and - in the mantissa bits. The xor operation twiddles a bit that can only be - a sign bit or a mantissa bit (since the exponent never extends to - bit 31). */ - m.value = NaNl (); - m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); - for (i = 0; i < NWORDS; i++) - m.word[i] |= 1; - if (!isnanl (m.value)) - return 1; + { + memory_long_double m; + unsigned int i; -#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) + /* The isnanl function should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (!isnanl (m.value)) + result |= 1; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else @@ -180,66 +185,52 @@ int main () static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (!isnanl (x.value)) - return 1; + result |= 2; } { /* Signalling NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (!isnanl (x.value)) - return 1; + result |= 2; } - /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, - Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in - Intel IA-64 Architecture Software Developer's Manual, Volume 1: - Application Architecture. - Table 5-2 "Floating-Point Register Encodings" - Figure 5-6 "Memory to Floating-Point Register Data Translation" - */ + /* isnanl should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + if (isnanl (x.value) && !isnanl (x.value)) + result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + if (isnanl (x.value) && !isnanl (x.value)) + result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + if (isnanl (x.value) && !isnanl (x.value)) + result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + if (isnanl (x.value) && !isnanl (x.value)) + result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (!isnanl (x.value)) - return 1; + if (isnanl (x.value) && !isnanl (x.value)) + result |= 64; } #endif - return 0; -}], [gl_cv_func_isnanl_works=yes], [gl_cv_func_isnanl_works=no], - [case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; - *) - case "$host_os" in - netbsd*) gl_cv_func_isnanl_works="guessing no";; - *) gl_cv_func_isnanl_works="guessing yes";; - esac - ;; - esac - ]) + return result; +}]])], + [gl_cv_func_isnanl_works=yes], + [gl_cv_func_isnanl_works=no], + [gl_cv_func_isnanl_works="guessing yes"]) ]) ]) diff --git a/gnulib-m4/iswblank.m4 b/gnulib-m4/iswblank.m4 new file mode 100644 index 0000000..bb74808 --- /dev/null +++ b/gnulib-m4/iswblank.m4 @@ -0,0 +1,41 @@ +# iswblank.m4 serial 4 +dnl Copyright (C) 2011-2015 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_ISWBLANK], +[ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H]) + dnl Persuade glibc <wctype.h> to declare iswblank(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([iswblank]) + AC_CHECK_DECLS([iswblank], , , [[ +/* 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 <wctype.h> +]]) + if test $ac_cv_func_iswblank = no; then + HAVE_ISWBLANK=0 + if test $ac_cv_have_decl_iswblank = yes; then + REPLACE_ISWBLANK=1 + fi + fi + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>. + : + else + if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then + dnl Redefine only iswblank. + : + fi + fi + +]) diff --git a/gnulib-m4/langinfo_h.m4 b/gnulib-m4/langinfo_h.m4 new file mode 100644 index 0000000..c3ecba6 --- /dev/null +++ b/gnulib-m4/langinfo_h.m4 @@ -0,0 +1,105 @@ +# langinfo_h.m4 serial 7 +dnl Copyright (C) 2009-2015 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_LANGINFO_H], +[ + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + + dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl <langinfo.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([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_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. + AC_CACHE_CHECK([whether langinfo.h defines CODESET], + [gl_cv_header_langinfo_codeset], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = CODESET; +]])], + [gl_cv_header_langinfo_codeset=yes], + [gl_cv_header_langinfo_codeset=no]) + ]) + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], + [gl_cv_header_langinfo_t_fmt_ampm], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = T_FMT_AMPM; +]])], + [gl_cv_header_langinfo_t_fmt_ampm=yes], + [gl_cv_header_langinfo_t_fmt_ampm=no]) + ]) + 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 ERA], + [gl_cv_header_langinfo_era], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = ERA; +]])], + [gl_cv_header_langinfo_era=yes], + [gl_cv_header_langinfo_era=no]) + ]) + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], + [gl_cv_header_langinfo_yesexpr], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <langinfo.h> +int a = YESEXPR; +]])], + [gl_cv_header_langinfo_yesexpr=yes], + [gl_cv_header_langinfo_yesexpr=no]) + ]) + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + AC_SUBST([HAVE_LANGINFO_H]) + AC_SUBST([HAVE_LANGINFO_CODESET]) + AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) + AC_SUBST([HAVE_LANGINFO_ERA]) + AC_SUBST([HAVE_LANGINFO_YESEXPR]) + + 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 <langinfo.h> + ]], [nl_langinfo]) +]) + +AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_LANGINFO_H_DEFAULTS], +[ + GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) + REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) +]) diff --git a/gnulib-m4/lcmessage.m4 b/gnulib-m4/lcmessage.m4 index 1a70543..7470ec5 100644 --- a/gnulib-m4/lcmessage.m4 +++ b/gnulib-m4/lcmessage.m4 @@ -1,5 +1,5 @@ -# lcmessage.m4 serial 6 (gettext-0.18) -dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation, +# lcmessage.m4 serial 7 (gettext-0.18.2) +dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014 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, @@ -22,8 +22,12 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995. AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], - [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], - [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h>]], + [[return LC_MESSAGES]])], + [gt_cv_val_LC_MESSAGES=yes], + [gt_cv_val_LC_MESSAGES=no])]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE([HAVE_LC_MESSAGES], [1], [Define if your <locale.h> file defines LC_MESSAGES.]) diff --git a/gnulib-m4/ldexpl.m4 b/gnulib-m4/ldexpl.m4 index d84b50f..30547db 100644 --- a/gnulib-m4/ldexpl.m4 +++ b/gnulib-m4/ldexpl.m4 @@ -1,5 +1,5 @@ -# ldexpl.m4 serial 5 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# ldexpl.m4 serial 16 +dnl Copyright (C) 2007-2015 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,29 +7,30 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_LDEXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([gl_FUNC_ISNANL]) dnl for ISNANL_LIBM + + dnl Persuade glibc <math.h> to declare ldexpl(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Check whether it's declared. - dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>. - AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>]) + dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>. + AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]]) + LDEXPL_LIBM= if test $HAVE_DECL_LDEXPL = 1; then - AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm], - [gl_cv_func_ldexpl_no_libm], - [ - AC_TRY_LINK([#include <math.h> - long double x;], - [return ldexpl (x, -1) > 0;], - [gl_cv_func_ldexpl_no_libm=yes], - [gl_cv_func_ldexpl_no_libm=no]) - ]) + gl_CHECK_LDEXPL_NO_LIBM if test $gl_cv_func_ldexpl_no_libm = no; then AC_CACHE_CHECK([whether ldexpl() can be used with libm], [gl_cv_func_ldexpl_in_libm], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include <math.h> - long double x;], - [return ldexpl (x, -1) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + long double x;]], + [[return ldexpl (x, -1) > 0;]])], [gl_cv_func_ldexpl_in_libm=yes], [gl_cv_func_ldexpl_in_libm=no]) LIBS="$save_LIBS" @@ -46,7 +47,7 @@ AC_DEFUN([gl_FUNC_LDEXPL], LIBS="$save_LIBS" case "$gl_cv_func_ldexpl_works" in *yes) gl_func_ldexpl=yes ;; - *) gl_func_ldexpl=no; REPLACE_LDEXPL=1; LDEXPL_LIBM= ;; + *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;; esac else gl_func_ldexpl=no @@ -57,34 +58,76 @@ AC_DEFUN([gl_FUNC_LDEXPL], fi fi if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then - AC_LIBOBJ([ldexpl]) + dnl Find libraries needed to link lib/ldexpl.c. + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + AC_REQUIRE([gl_FUNC_LDEXP]) + LDEXPL_LIBM="$LDEXP_LIBM" + else + LDEXPL_LIBM="$ISNANL_LIBM" + fi fi AC_SUBST([LDEXPL_LIBM]) ]) +dnl Test whether ldexpl() can be used without linking with libm. +dnl Set gl_cv_func_ldexpl_no_libm to 'yes' or 'no' accordingly. +AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM], +[ + AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm], + [gl_cv_func_ldexpl_no_libm], + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + long double x;]], + [[return ldexpl (x, -1) > 0;]])], + [gl_cv_func_ldexpl_no_libm=yes], + [gl_cv_func_ldexpl_no_libm=no]) + ]) +]) + dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1 -dnl and MacOS X 10.4/PowerPC). +dnl and Mac OS X 10.4/PowerPC). AC_DEFUN([gl_FUNC_LDEXPL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether ldexpl works], [gl_cv_func_ldexpl_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <math.h> -extern long double ldexpl (long double, int); +extern +#ifdef __cplusplus +"C" +#endif +long double ldexpl (long double, int); int main() { - volatile long double x1 = 1.0; - volatile long double y1 = ldexpl (x1, -1); - volatile long double x2 = 1.73205L; - volatile long double y2 = ldexpl (x2, 0); - return (y1 != 0.5L) || (y2 != x2); -}], [gl_cv_func_ldexpl_works=yes], [gl_cv_func_ldexpl_works=no], - [case "$host_os" in - aix*) gl_cv_func_ldexpl_works="guessing no";; - *) gl_cv_func_ldexpl_works="guessing yes";; - esac - ]) + int result = 0; + { + volatile long double x = 1.0; + volatile long double y = ldexpl (x, -1); + if (y != 0.5L) + result |= 1; + } + { + volatile long double x = 1.73205L; + volatile long double y = ldexpl (x, 0); + if (y != x) + result |= 2; + } + return result; +}]])], + [gl_cv_func_ldexpl_works=yes], + [gl_cv_func_ldexpl_works=no], + [ +changequote(,)dnl + case "$host_os" in + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac +changequote([,])dnl + ]) ]) ]) diff --git a/gnulib-m4/lib-ld.m4 b/gnulib-m4/lib-ld.m4 index ebb3052..91ca911 100644 --- a/gnulib-m4/lib-ld.m4 +++ b/gnulib-m4/lib-ld.m4 @@ -1,50 +1,56 @@ -# lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. +# lib-ld.m4 serial 6 +dnl Copyright (C) 1996-2003, 2009-2015 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 Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; + acl_cv_prog_gnu_ld=yes + ;; *) - acl_cv_prog_gnu_ld=no ;; + acl_cv_prog_gnu_ld=no + ;; esac]) with_gnu_ld=$acl_cv_prog_gnu_ld ]) -dnl From libtool-1.4. Sets the variable LD. +dnl From libtool-2.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl +[AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld [default=no]])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -54,11 +60,11 @@ if test "$GCC" = yes; then esac case $ac_prog in # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + [[\\/]]* | ?:[[\\/]]*) + 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" @@ -79,23 +85,26 @@ else fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + 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 GNU ld's only accept -v. + # 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 + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; + test "$with_gnu_ld" != no && break + ;; *) - test "$with_gnu_ld" != yes && break ;; + test "$with_gnu_ld" != yes && break + ;; esac fi done - IFS="$ac_save_ifs" + IFS="$acl_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) diff --git a/gnulib-m4/lib-link.m4 b/gnulib-m4/lib-link.m4 index c73bd8e..d8d5d1f 100644 --- a/gnulib-m4/lib-link.m4 +++ b/gnulib-m4/lib-link.m4 @@ -1,5 +1,5 @@ -# lib-link.m4 serial 21 (gettext-0.18) -dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. +# lib-link.m4 serial 26 (gettext-0.18.2) +dnl Copyright (C) 2001-2015 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. @@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) - pushdef([Name],[translit([$1],[./-], [___])]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([Name],[m4_translit([$1],[./+-], [____])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" @@ -58,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) - pushdef([Name],[translit([$1],[./-], [___])]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([Name],[m4_translit([$1],[./+-], [____])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. @@ -85,7 +85,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac - AC_TRY_LINK([$3], [$4], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[$3]], [[$4]])], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" @@ -115,6 +116,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, +dnl acl_libname_spec, +dnl acl_library_names_spec, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, @@ -157,15 +160,15 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, - m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) @@ -178,14 +181,14 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + 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],[translit(PACK,[.],[_])],PACK)]) + 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([ @@ -242,7 +245,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then diff --git a/gnulib-m4/lib-prefix.m4 b/gnulib-m4/lib-prefix.m4 index 1601cea..0465f47 100644 --- a/gnulib-m4/lib-prefix.m4 +++ b/gnulib-m4/lib-prefix.m4 @@ -1,5 +1,5 @@ # lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2005, 2008-2015 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. diff --git a/gnulib-m4/libunistring-base.m4 b/gnulib-m4/libunistring-base.m4 new file mode 100644 index 0000000..cb8ae8a --- /dev/null +++ b/gnulib-m4/libunistring-base.m4 @@ -0,0 +1,141 @@ +# libunistring-base.m4 serial 5 +dnl Copyright (C) 2010-2015 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 Paolo Bonzini and Bruno Haible. + +dnl gl_LIBUNISTRING_MODULE([VERSION], [Module]) +dnl Declares that the source files of Module should be compiled, unless we +dnl are linking with libunistring and its version is >= the given VERSION. +dnl Defines an automake conditional LIBUNISTRING_COMPILE_$MODULE that is +dnl true if the source files of Module should be compiled. +dnl This macro is to be used for public libunistring API, not for +dnl undocumented API. +dnl +dnl You have to bump the VERSION argument to the next projected version +dnl number each time you make a change that affects the behaviour of the +dnl functions defined in Module (even if the sources of Module itself do not +dnl change). + +AC_DEFUN([gl_LIBUNISTRING_MODULE], +[ + AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) + dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from + dnl gl_LIBUNISTRING_CORE if that macro has been run. + AM_CONDITIONAL(AS_TR_CPP([LIBUNISTRING_COMPILE_$2]), + [gl_LIBUNISTRING_VERSION_CMP([$1])]) +]) + +dnl gl_LIBUNISTRING_LIBHEADER([VERSION], [HeaderFile]) +dnl Declares that HeaderFile should be created, unless we are linking +dnl with libunistring and its version is >= the given VERSION. +dnl HeaderFile should be relative to the lib directory and end in '.h'. +dnl Prepares for substituting LIBUNISTRING_HEADERFILE (to HeaderFile or empty). +dnl +dnl When we are linking with the already installed libunistring and its version +dnl is < VERSION, we create HeaderFile here, because we may compile functions +dnl (via gl_LIBUNISTRING_MODULE above) that are not contained in the installed +dnl version. +dnl When we are linking with the already installed libunistring and its version +dnl is > VERSION, we don't create HeaderFile here: it could cause compilation +dnl errors in other libunistring header files if some types are missing. +dnl +dnl You have to bump the VERSION argument to the next projected version +dnl number each time you make a non-comment change to the HeaderFile. + +AC_DEFUN([gl_LIBUNISTRING_LIBHEADER], +[ + AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) + dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from + dnl gl_LIBUNISTRING_CORE if that macro has been run. + if gl_LIBUNISTRING_VERSION_CMP([$1]); then + LIBUNISTRING_[]AS_TR_CPP([$2])='$2' + else + LIBUNISTRING_[]AS_TR_CPP([$2])= + fi + AC_SUBST([LIBUNISTRING_]AS_TR_CPP([$2])) +]) + +dnl Miscellaneous preparations/initializations. + +AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE], +[ + dnl Ensure that HAVE_LIBUNISTRING is fully determined at this point. + m4_ifdef([gl_LIBUNISTRING], [AC_REQUIRE([gl_LIBUNISTRING])]) + + AC_REQUIRE([AC_PROG_AWK]) + +dnl Sed expressions to extract the parts of a version number. +changequote(,) +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +changequote([,]) + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi +]) + +dnl gl_LIBUNISTRING_VERSION_CMP([VERSION]) +dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION +dnl is less than the VERSION argument. +AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP], +[ { test "$HAVE_LIBUNISTRING" != yes \ + || { + dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least. + AS_LITERAL_IF([$1], + [dnl This is the optimized variant, that assumes the argument is a literal: + m4_pushdef([requested_version_major], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])]) + m4_pushdef([requested_version_minor], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) + m4_pushdef([requested_version_subminor], + [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) + test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \ + && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \ + || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor + } + } + } + m4_popdef([requested_version_subminor]) + m4_popdef([requested_version_minor]) + m4_popdef([requested_version_major]) + ], + [dnl This is the unoptimized variant: + requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"` + requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"` + requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"` + test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \ + || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \ + && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \ + || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \ + && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor + } + } + } + ]) + } + }]) + +dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the +dnl same as ORIG, otherwise to 0. +m4_define([gl_LIBUNISTRING_ARG_OR_ZERO], [m4_if([$1], [$2], [0], [$1])]) diff --git a/gnulib-m4/localcharset.m4 b/gnulib-m4/localcharset.m4 index ee2e801..f03916c 100644 --- a/gnulib-m4/localcharset.m4 +++ b/gnulib-m4/localcharset.m4 @@ -1,5 +1,5 @@ # localcharset.m4 serial 7 -dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2015 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. diff --git a/gnulib-m4/locale-ar.m4 b/gnulib-m4/locale-ar.m4 new file mode 100644 index 0000000..fd16338 --- /dev/null +++ b/gnulib-m4/locale-ar.m4 @@ -0,0 +1,99 @@ +# locale-ar.m4 serial 6 +dnl Copyright (C) 2003, 2005-2015 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 Ben Pfaff, based on locale-fr.m4 by Bruno Haible. + +dnl Determine the name of an Arabic locale with traditional encoding. +AC_DEFUN([gt_LOCALE_AR], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional Arabic locale], [gt_cv_locale_ar], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([ +changequote(,)dnl +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || 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 + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check that nl_langinfo(CODESET) is nonempty and not "ASCII" or "646" + and ends in "6". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || cs[strlen (cs) - 1] != '6') + return 1; + } +#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 + 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 + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Arabic locale is + # "Arabic_Saudi Arabia.1256", and CP1256 is very different from + # ISO-8859-6, so we cannot use it here. + gt_cv_locale_ar=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Values tested: + # - The usual locale name: ar_SA + # - The locale name with explicit encoding suffix: ar_SA.ISO-8859-6 + # - The HP-UX locale name: ar_SA.iso88596 + # - The Solaris 7 locale name: ar + # Also try ar_EG instead of ar_SA because Egypt is a large country too. + for gt_cv_locale_ar in ar_SA ar_SA.ISO-8859-6 ar_SA.iso88596 ar_EG ar_EG.ISO-8859-6 ar_EG.iso88596 ar none; do + if test $gt_cv_locale_ar = none; then + break + fi + if (LC_ALL=$gt_cv_locale_ar LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + break + fi + done + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_AR=$gt_cv_locale_ar + AC_SUBST([LOCALE_AR]) +]) diff --git a/gnulib-m4/locale-fr.m4 b/gnulib-m4/locale-fr.m4 index 001f539..92ff552 100644 --- a/gnulib-m4/locale-fr.m4 +++ b/gnulib-m4/locale-fr.m4 @@ -1,5 +1,5 @@ -# locale-fr.m4 serial 11 -dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc. +# locale-fr.m4 serial 17 +dnl Copyright (C) 2003, 2005-2015 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. @@ -25,17 +25,30 @@ struct tm t; char buf[16]; int main () { /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || 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 + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + 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. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. */ + 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 { const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) return 1; } #endif @@ -50,46 +63,67 @@ int main () { 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. */ /* 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 return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO-8859-1 - else - # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. - if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO8859-1 + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 else - # Test for the HP-UX locale name. - if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.iso88591 + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 else - # None found. - gt_cv_locale_fr=none + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi fi fi fi - fi - fi + ;; + esac fi rm -fr conftest* ]) @@ -119,9 +153,19 @@ 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__ + /* 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 + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else if (setlocale (LC_ALL, "") == NULL) return 1; +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + 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. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -147,36 +191,57 @@ int main () { || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') return 1; #endif +#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 return 0; } changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR.UTF-8 - else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr.UTF-8 + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 else # None found. gt_cv_locale_fr_utf8=none fi - fi - fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac fi rm -fr conftest* ]) diff --git a/gnulib-m4/locale-ja.m4 b/gnulib-m4/locale-ja.m4 index 0eedaf1..a3abef8 100644 --- a/gnulib-m4/locale-ja.m4 +++ b/gnulib-m4/locale-ja.m4 @@ -1,5 +1,5 @@ -# locale-ja.m4 serial 7 -dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc. +# locale-ja.m4 serial 12 +dnl Copyright (C) 2003, 2005-2015 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,17 +27,30 @@ int main () { const char *p; /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || 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 + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + 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. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. */ + 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 { const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) return 1; } #endif @@ -52,7 +65,7 @@ int main () 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. */ + 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++) @@ -63,42 +76,58 @@ int main () changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the AIX locale name. - if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC-JP - else - # Test for the HP-UX, OSF/1, NetBSD locale name. - if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.eucJP + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP else - # Test for the IRIX, FreeBSD locale name. - if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP else - # Test for the Solaris 7 locale name. - if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP else - # Special test for NetBSD 1.6. - if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then - gt_cv_locale_ja=ja_JP.eucJP + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC else - # None found. - gt_cv_locale_ja=none + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi fi fi fi fi - fi - fi + ;; + esac fi rm -fr conftest* ]) diff --git a/gnulib-m4/locale-tr.m4 b/gnulib-m4/locale-tr.m4 index 404c063..655c1ec 100644 --- a/gnulib-m4/locale-tr.m4 +++ b/gnulib-m4/locale-tr.m4 @@ -1,5 +1,5 @@ -# locale-tr.m4 serial 6 -dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc. +# locale-tr.m4 serial 10 +dnl Copyright (C) 2003, 2005-2015 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. @@ -9,6 +9,7 @@ dnl From Bruno Haible. dnl Determine the name of a turkish locale with UTF-8 encoding. AC_DEFUN([gt_LOCALE_TR_UTF8], [ + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a turkish Unicode locale], [gt_cv_locale_tr_utf8], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([ @@ -29,9 +30,19 @@ int main () { implement the Turkish upper-/lowercase mappings. Therefore, let this program return 1 on BeOS. */ /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || 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 + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) + On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, @@ -66,27 +77,46 @@ int main () { changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_tr_utf8=tr_TR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_tr_utf8=tr_TR.UTF-8 - else - # Test for the Solaris 7 locale name. - if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_tr_utf8=tr.UTF-8 + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=Turkish_Turkey.65001 else # None found. gt_cv_locale_tr_utf8=none fi - fi - fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr_TR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_tr_utf8=tr.UTF-8 + else + # None found. + gt_cv_locale_tr_utf8=none + fi + fi + fi + ;; + esac else gt_cv_locale_tr_utf8=none fi diff --git a/gnulib-m4/locale-zh.m4 b/gnulib-m4/locale-zh.m4 index 777fd14..c5c4ef6 100644 --- a/gnulib-m4/locale-zh.m4 +++ b/gnulib-m4/locale-zh.m4 @@ -1,5 +1,5 @@ -# locale-zh.m4 serial 6 -dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc. +# locale-zh.m4 serial 12 +dnl Copyright (C) 2003, 2005-2015 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. @@ -28,17 +28,30 @@ int main () { const char *p; /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || 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 + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else if (setlocale (LC_ALL, "") == NULL) return 1; +#endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + 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. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. */ + 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 { const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) return 1; } #endif @@ -49,7 +62,7 @@ int main () if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; #endif /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. - This excludes the UTF-8 encoding. */ + 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++) @@ -64,22 +77,47 @@ int main () changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the locale name without encoding suffix. - if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN.GB18030 - else - # None found. + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. gt_cv_locale_zh_CN=none - fi - fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac else # If there was a link error, due to mblen(), the system is so old that # it certainly doesn't have a chinese locale. diff --git a/gnulib-m4/locale_h.m4 b/gnulib-m4/locale_h.m4 index 18a119b..0d7bb34 100644 --- a/gnulib-m4/locale_h.m4 +++ b/gnulib-m4/locale_h.m4 @@ -1,5 +1,5 @@ -# locale_h.m4 serial 10 -dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. +# locale_h.m4 serial 19 +dnl Copyright (C) 2007, 2009-2015 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,16 +10,30 @@ AC_DEFUN([gl_LOCALE_H], dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) - dnl Persuade glibc <locale.h> to define locale_t. + dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_* + dnl members of 'struct lconv'. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 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' + dnl only if _LCONV_C99 is defined. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + solaris*) + AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.]) + ;; + esac + AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], [gl_cv_header_locale_h_posix2001], - [AC_TRY_COMPILE([#include <locale.h> -int x = LC_MESSAGES;], [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h> + int x = LC_MESSAGES; + int y = sizeof (((struct lconv *) 0)->decimal_point);]], + [[]])], [gl_cv_header_locale_h_posix2001=yes], [gl_cv_header_locale_h_posix2001=no])]) @@ -28,12 +42,15 @@ int x = LC_MESSAGES;], [], 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 MacOS X 10.5. If <locale.h> does not define locale_t by + 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_TRY_COMPILE([#include <locale.h> -locale_t x;], [], + [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]) ]) @@ -48,15 +65,29 @@ locale_t x;], [], fi AC_SUBST([HAVE_XLOCALE_H]) - dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK. - gl_CHECK_NEXT_HEADERS([locale.h]) - - if test -n "$STDDEF_H" \ - || test $gl_cv_header_locale_h_posix2001 = no \ - || test $gl_cv_header_locale_h_needs_xlocale_h = yes; then - gl_REPLACE_LOCALE_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, + dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members. + AC_CACHE_CHECK([whether struct lconv is properly defined], + [gl_cv_sys_struct_lconv_ok], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h> + struct lconv l; + int x = sizeof (l.decimal_point); + int y = sizeof (l.int_p_cs_precedes);]], + [[]])], + [gl_cv_sys_struct_lconv_ok=yes], + [gl_cv_sys_struct_lconv_ok=no]) + ]) + if test $gl_cv_sys_struct_lconv_ok = no; then + REPLACE_STRUCT_LCONV=1 fi + dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([locale.h]) + 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 <locale.h> @@ -64,14 +95,8 @@ locale_t x;], [], #if HAVE_XLOCALE_H # include <xlocale.h> #endif - ]], [duplocale]) -]) - -dnl Unconditionally enables the replacement of <locale.h>. -AC_DEFUN([gl_REPLACE_LOCALE_H], -[ - dnl This is a no-op, because <locale.h> is always overridden. - : + ]], + [setlocale duplocale]) ]) AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], @@ -85,8 +110,13 @@ 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]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) - REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) + HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) + REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) + REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) + REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) + REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) ]) diff --git a/gnulib-m4/localename.m4 b/gnulib-m4/localename.m4 index 9ff5eea..2bdf31e 100644 --- a/gnulib-m4/localename.m4 +++ b/gnulib-m4/localename.m4 @@ -1,5 +1,5 @@ # localename.m4 serial 2 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2015 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. @@ -9,4 +9,9 @@ AC_DEFUN([gl_LOCALENAME], AC_REQUIRE([gt_LC_MESSAGES]) AC_REQUIRE([gt_INTL_MACOSX]) AC_CHECK_FUNCS([setlocale uselocale]) + dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have + dnl it nor the equivalent. + if test $ac_cv_func_uselocale = yes; then + AC_CHECK_FUNCS([getlocalename_l]) + fi ]) diff --git a/gnulib-m4/lock.m4 b/gnulib-m4/lock.m4 index 9da8465..9fd4aa7 100644 --- a/gnulib-m4/lock.m4 +++ b/gnulib-m4/lock.m4 @@ -1,5 +1,5 @@ -# lock.m4 serial 10 (gettext-0.18) -dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. +# lock.m4 serial 13 (gettext-0.18.2) +dnl Copyright (C) 2005-2015 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_LOCK], [ AC_REQUIRE([gl_THREADLIB]) if test "$gl_threads_api" = posix; then - # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the + # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], @@ -18,20 +18,25 @@ AC_DEFUN([gl_LOCK], [], [#include <pthread.h>]) # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. - AC_TRY_COMPILE([#include <pthread.h>], - [#if __FreeBSD__ == 4 + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[#include <pthread.h>]], + [[ +#if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." +#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) +error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; -#endif], +#endif + ]])], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) fi gl_PREREQ_LOCK ]) -# Prerequisites of lib/lock.c. -AC_DEFUN([gl_PREREQ_LOCK], [ - AC_REQUIRE([AC_C_INLINE]) -]) +# Prerequisites of lib/glthread/lock.c. +AC_DEFUN([gl_PREREQ_LOCK], [:]) diff --git a/gnulib-m4/longlong.m4 b/gnulib-m4/longlong.m4 index cca3c1a..d57bc70 100644 --- a/gnulib-m4/longlong.m4 +++ b/gnulib-m4/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 14 -dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc. +# longlong.m4 serial 17 +dnl Copyright (C) 1999-2007, 2009-2015 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. -# This fixes a bug in Autoconf 2.61, but can be removed once we -# assume 2.62 everywhere. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be @@ -16,44 +16,48 @@ dnl From Paul Eggert. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], - [AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. - dnl If cross compiling, assume the bug isn't important, since - dnl nobody cross compiles for this platform as far as we know. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include <limits.h> - @%:@ifndef LLONG_MAX - @%:@ define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - @%:@ define LLONG_MAX (HALF - 1 + HALF) - @%:@endif]], - [[long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0;]])], - [ac_cv_type_long_long_int=yes], - [ac_cv_type_long_long_int=no], - [ac_cv_type_long_long_int=yes])], - [ac_cv_type_long_long_int=no])]) + [ac_cv_type_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug is not important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include <limits.h> + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [], + [ac_cv_type_long_long_int=no], + [:]) + fi + fi]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], [1], - [Define to 1 if the system has the type `long long int'.]) + [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, but can be removed once we -# assume 2.62 everywhere. +# This fixes a bug in Autoconf 2.61, and can be faster +# than what's in Autoconf 2.62 through 2.68. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT @@ -64,13 +68,16 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], - [AC_LINK_IFELSE( - [_AC_TYPE_LONG_LONG_SNIPPET], - [ac_cv_type_unsigned_long_long_int=yes], - [ac_cv_type_unsigned_long_long_int=no])]) + [ac_cv_type_unsigned_long_long_int=yes + if test "x${ac_cv_prog_cc_c99-no}" = xno; then + AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [], + [ac_cv_type_unsigned_long_long_int=no]) + fi]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], - [Define to 1 if the system has the type `unsigned long long int'.]) + [Define to 1 if the system has the type 'unsigned long long int'.]) fi ]) diff --git a/gnulib-m4/malloc.m4 b/gnulib-m4/malloc.m4 index 910ac92..31368ab 100644 --- a/gnulib-m4/malloc.m4 +++ b/gnulib-m4/malloc.m4 @@ -1,25 +1,78 @@ -# malloc.m4 serial 9 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# malloc.m4 serial 14 +dnl Copyright (C) 2007, 2009-2015 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 taken from the following Autoconf patch: +# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 +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 + ]], + [[return ! malloc (0);]]) + ], + [ac_cv_func_malloc_0_nonnull=yes], + [ac_cv_func_malloc_0_nonnull=no], + [case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | 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 ;; + esac + ]) + ]) + AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2]) +])# _AC_FUNC_MALLOC_IF + +]) + +# gl_FUNC_MALLOC_GNU +# ------------------ +# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if +# it is not. +AC_DEFUN([gl_FUNC_MALLOC_GNU], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl _AC_FUNC_MALLOC_IF is defined in Autoconf. + _AC_FUNC_MALLOC_IF( + [AC_DEFINE([HAVE_MALLOC_GNU], [1], + [Define to 1 if your system has a GNU libc compatible 'malloc' + function, and to 0 otherwise.])], + [AC_DEFINE([HAVE_MALLOC_GNU], [0]) + REPLACE_MALLOC=1 + ]) +]) + # gl_FUNC_MALLOC_POSIX # -------------------- # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it # fails), and replace malloc if it is not. AC_DEFUN([gl_FUNC_MALLOC_POSIX], [ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then - HAVE_MALLOC_POSIX=1 AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else - AC_LIBOBJ([malloc]) - HAVE_MALLOC_POSIX=0 + REPLACE_MALLOC=1 fi - AC_SUBST([HAVE_MALLOC_POSIX]) ]) # Test whether malloc, realloc, calloc are POSIX compliant, @@ -32,10 +85,14 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX], dnl It is too dangerous to try to allocate a large amount of memory: dnl some systems go to their knees when you do that. So assume that dnl all Unix implementations of the function are POSIX compliant. - AC_TRY_COMPILE([], - [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - choke me - #endif - ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[]], + [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + ]])], + [gl_cv_func_malloc_posix=yes], + [gl_cv_func_malloc_posix=no]) ]) ]) diff --git a/gnulib-m4/malloca.m4 b/gnulib-m4/malloca.m4 index e07c6d9..7248951 100644 --- a/gnulib-m4/malloca.m4 +++ b/gnulib-m4/malloca.m4 @@ -1,5 +1,5 @@ # malloca.m4 serial 1 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2010 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2015 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, diff --git a/gnulib-m4/math_h.m4 b/gnulib-m4/math_h.m4 index 2d89ca3..7d0f583 100644 --- a/gnulib-m4/math_h.m4 +++ b/gnulib-m4/math_h.m4 @@ -1,5 +1,5 @@ -# math_h.m4 serial 21 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# math_h.m4 serial 114 +dnl Copyright (C) 2007-2015 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_MATH_H], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([math.h]) - AC_REQUIRE([AC_C_INLINE]) AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]], @@ -38,9 +37,20 @@ AC_DEFUN([gl_MATH_H], 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 <math.h> - ]], [acosl asinl atanl ceilf ceill cosl expl floorf floorl frexpl - ldexpl logb logl round roundf roundl sinl sqrtl tanl trunc truncf truncl]) + gl_WARN_ON_USE_PREPARE([[#include <math.h>]], + [acosf acosl asinf asinl atanf atanl + cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf + expf expl exp2 exp2f exp2l expm1 expm1f expm1l + fabsf fabsl floorf floorl fma fmaf fmal + fmod fmodf fmodl frexpf frexpl hypotf hypotl + ilogb ilogbf ilogbl + ldexpf ldexpl + log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l + logb logbf logbl + modf modff modfl powf + remainder remainderf remainderl + rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl + tanf tanl tanhf trunc truncf truncl]) ]) AC_DEFUN([gl_MATH_MODULE_INDICATOR], @@ -54,62 +64,189 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR], AC_DEFUN([gl_MATH_H_DEFAULTS], [ - GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL]) - GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL]) - GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL]) - GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF]) - GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL]) - GNULIB_COSL=0; AC_SUBST([GNULIB_COSL]) - GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL]) - GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) - GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) - GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) - GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) - GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) - GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF]) - GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN]) - GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF]) - GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND]) - GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL]) - GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) - GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB]) - GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL]) - GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) - GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF]) - GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL]) - GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT]) - GNULIB_SINL=0; AC_SUBST([GNULIB_SINL]) - GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL]) - GNULIB_TANL=0; AC_SUBST([GNULIB_TANL]) - GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) - GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) - GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) + GNULIB_ACOSF=0; AC_SUBST([GNULIB_ACOSF]) + GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL]) + GNULIB_ASINF=0; AC_SUBST([GNULIB_ASINF]) + GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL]) + GNULIB_ATANF=0; AC_SUBST([GNULIB_ATANF]) + GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL]) + GNULIB_ATAN2F=0; AC_SUBST([GNULIB_ATAN2F]) + GNULIB_CBRT=0; AC_SUBST([GNULIB_CBRT]) + GNULIB_CBRTF=0; AC_SUBST([GNULIB_CBRTF]) + GNULIB_CBRTL=0; AC_SUBST([GNULIB_CBRTL]) + GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL]) + GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF]) + GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL]) + GNULIB_COPYSIGN=0; AC_SUBST([GNULIB_COPYSIGN]) + GNULIB_COPYSIGNF=0; AC_SUBST([GNULIB_COPYSIGNF]) + GNULIB_COPYSIGNL=0; AC_SUBST([GNULIB_COPYSIGNL]) + GNULIB_COSF=0; AC_SUBST([GNULIB_COSF]) + GNULIB_COSL=0; AC_SUBST([GNULIB_COSL]) + GNULIB_COSHF=0; AC_SUBST([GNULIB_COSHF]) + GNULIB_EXPF=0; AC_SUBST([GNULIB_EXPF]) + GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL]) + GNULIB_EXP2=0; AC_SUBST([GNULIB_EXP2]) + GNULIB_EXP2F=0; AC_SUBST([GNULIB_EXP2F]) + GNULIB_EXP2L=0; AC_SUBST([GNULIB_EXP2L]) + GNULIB_EXPM1=0; AC_SUBST([GNULIB_EXPM1]) + GNULIB_EXPM1F=0; AC_SUBST([GNULIB_EXPM1F]) + GNULIB_EXPM1L=0; AC_SUBST([GNULIB_EXPM1L]) + GNULIB_FABSF=0; AC_SUBST([GNULIB_FABSF]) + GNULIB_FABSL=0; AC_SUBST([GNULIB_FABSL]) + GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR]) + GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) + GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) + GNULIB_FMA=0; AC_SUBST([GNULIB_FMA]) + GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF]) + GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL]) + GNULIB_FMOD=0; AC_SUBST([GNULIB_FMOD]) + GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF]) + GNULIB_FMODL=0; AC_SUBST([GNULIB_FMODL]) + GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF]) + GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) + GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) + GNULIB_HYPOT=0; AC_SUBST([GNULIB_HYPOT]) + GNULIB_HYPOTF=0; AC_SUBST([GNULIB_HYPOTF]) + GNULIB_HYPOTL=0; AC_SUBST([GNULIB_HYPOTL]) + GNULIB_ILOGB=0; AC_SUBST([GNULIB_ILOGB]) + GNULIB_ILOGBF=0; AC_SUBST([GNULIB_ILOGBF]) + GNULIB_ILOGBL=0; AC_SUBST([GNULIB_ILOGBL]) + GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) + GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF]) + GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN]) + GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF]) + GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND]) + GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL]) + GNULIB_LDEXPF=0; AC_SUBST([GNULIB_LDEXPF]) + GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) + GNULIB_LOG=0; AC_SUBST([GNULIB_LOG]) + GNULIB_LOGF=0; AC_SUBST([GNULIB_LOGF]) + GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL]) + GNULIB_LOG10=0; AC_SUBST([GNULIB_LOG10]) + GNULIB_LOG10F=0; AC_SUBST([GNULIB_LOG10F]) + GNULIB_LOG10L=0; AC_SUBST([GNULIB_LOG10L]) + GNULIB_LOG1P=0; AC_SUBST([GNULIB_LOG1P]) + GNULIB_LOG1PF=0; AC_SUBST([GNULIB_LOG1PF]) + GNULIB_LOG1PL=0; AC_SUBST([GNULIB_LOG1PL]) + GNULIB_LOG2=0; AC_SUBST([GNULIB_LOG2]) + GNULIB_LOG2F=0; AC_SUBST([GNULIB_LOG2F]) + GNULIB_LOG2L=0; AC_SUBST([GNULIB_LOG2L]) + GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB]) + GNULIB_LOGBF=0; AC_SUBST([GNULIB_LOGBF]) + GNULIB_LOGBL=0; AC_SUBST([GNULIB_LOGBL]) + GNULIB_MODF=0; AC_SUBST([GNULIB_MODF]) + GNULIB_MODFF=0; AC_SUBST([GNULIB_MODFF]) + GNULIB_MODFL=0; AC_SUBST([GNULIB_MODFL]) + GNULIB_POWF=0; AC_SUBST([GNULIB_POWF]) + GNULIB_REMAINDER=0; AC_SUBST([GNULIB_REMAINDER]) + GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF]) + GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL]) + GNULIB_RINT=0; AC_SUBST([GNULIB_RINT]) + GNULIB_RINTF=0; AC_SUBST([GNULIB_RINTF]) + GNULIB_RINTL=0; AC_SUBST([GNULIB_RINTL]) + GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) + GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF]) + GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL]) + GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT]) + GNULIB_SINF=0; AC_SUBST([GNULIB_SINF]) + GNULIB_SINL=0; AC_SUBST([GNULIB_SINL]) + GNULIB_SINHF=0; AC_SUBST([GNULIB_SINHF]) + GNULIB_SQRTF=0; AC_SUBST([GNULIB_SQRTF]) + GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL]) + GNULIB_TANF=0; AC_SUBST([GNULIB_TANF]) + GNULIB_TANL=0; AC_SUBST([GNULIB_TANL]) + GNULIB_TANHF=0; AC_SUBST([GNULIB_TANHF]) + GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) + GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) + GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) 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_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) 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]) @@ -119,22 +256,98 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], 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_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_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_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) + 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 +# determines whether 'long double' and 'double' have the same representation. +# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines +# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly. +# The currently known platforms where this is the case are: +# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9. +AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE], +[ + AC_CACHE_CHECK([whether long double and double are the same], + [gl_cv_long_double_equals_double], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <float.h>]], + [[typedef int check[sizeof (long double) == sizeof (double) + && LDBL_MANT_DIG == DBL_MANT_DIG + && LDBL_MAX_EXP == DBL_MAX_EXP + && LDBL_MIN_EXP == DBL_MIN_EXP + ? 1 : -1]; + ]])], + [gl_cv_long_double_equals_double=yes], + [gl_cv_long_double_equals_double=no]) + ]) + if test $gl_cv_long_double_equals_double = yes; then + AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1], + [Define to 1 if 'long double' and 'double' have the same representation.]) + HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 + else + HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 + fi + AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]) +]) diff --git a/gnulib-m4/mbchar.m4 b/gnulib-m4/mbchar.m4 index 116ce7e..3f721c9 100644 --- a/gnulib-m4/mbchar.m4 +++ b/gnulib-m4/mbchar.m4 @@ -1,5 +1,5 @@ -# mbchar.m4 serial 8 -dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc. +# mbchar.m4 serial 9 +dnl Copyright (C) 2005-2007, 2009-2015 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,5 +10,4 @@ dnl From Bruno Haible. AC_DEFUN([gl_MBCHAR], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([AC_C_INLINE]) ]) diff --git a/gnulib-m4/mbiter.m4 b/gnulib-m4/mbiter.m4 index 3481050..becf8a7 100644 --- a/gnulib-m4/mbiter.m4 +++ b/gnulib-m4/mbiter.m4 @@ -1,5 +1,5 @@ -# mbiter.m4 serial 5 -dnl Copyright (C) 2005, 2008, 2009, 2010 Free Software Foundation, Inc. +# mbiter.m4 serial 7 +dnl Copyright (C) 2005, 2008-2015 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. @@ -9,10 +9,6 @@ dnl From Bruno Haible. AC_DEFUN([gl_MBITER], [ - AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) - dnl The following line is that so the user can test HAVE_MBRTOWC before - dnl #include "mbiter.h" or "mbuiter.h". It can be removed in 2010. - AC_REQUIRE([AC_FUNC_MBRTOWC]) : ]) diff --git a/gnulib-m4/mbrtowc.m4 b/gnulib-m4/mbrtowc.m4 index 606de5c..c0d751d 100644 --- a/gnulib-m4/mbrtowc.m4 +++ b/gnulib-m4/mbrtowc.m4 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 17 -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation, +# mbrtowc.m4 serial 26 +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2015 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, @@ -15,16 +15,41 @@ AC_DEFUN([gl_FUNC_MBRTOWC], AC_CHECK_FUNCS_ONCE([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> +]]) + 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 + dnl replacement. + REPLACE_MBRTOWC=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOWC=1 else - gl_MBRTOWC_NULL_ARG + gl_MBRTOWC_NULL_ARG1 + gl_MBRTOWC_NULL_ARG2 gl_MBRTOWC_RETVAL gl_MBRTOWC_NUL_RETVAL - case "$gl_cv_func_mbrtowc_null_arg" in + gl_MBRTOWC_EMPTY_INPUT + case "$gl_cv_func_mbrtowc_null_arg1" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], + [Define if the mbrtowc function has the NULL pwc argument bug.]) + REPLACE_MBRTOWC=1 + ;; + esac + case "$gl_cv_func_mbrtowc_null_arg2" in *yes) ;; - *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1], + *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1], [Define if the mbrtowc function has the NULL string argument bug.]) REPLACE_MBRTOWC=1 ;; @@ -43,13 +68,16 @@ AC_DEFUN([gl_FUNC_MBRTOWC], REPLACE_MBRTOWC=1 ;; esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1], + [Define if the mbrtowc function does not return (size_t) -2 + for empty input.]) + REPLACE_MBRTOWC=1 + ;; + esac fi fi - if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([mbrtowc]) - gl_PREREQ_MBRTOWC - fi ]) dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that @@ -80,9 +108,6 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN], else REPLACE_MBSTATE_T=1 fi - if test $REPLACE_MBSTATE_T = 1; then - gl_REPLACE_WCHAR_H - fi ]) dnl Test whether mbrtowc puts the state into non-initial state when parsing an @@ -101,16 +126,24 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on AIX and OSF/1. - osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + # Guess no on AIX and OSF/1. + aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_JA != none; then - AC_TRY_RUN([ + 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 () { @@ -126,7 +159,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], [:]) @@ -156,10 +189,18 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #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 () { @@ -178,7 +219,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_sanitycheck=yes], [gl_cv_func_mbrtowc_sanitycheck=no], [:]) @@ -186,31 +227,109 @@ int main () ]) ]) +dnl Test whether mbrtowc supports a NULL pwc argument correctly. +dnl Result is gl_cv_func_mbrtowc_null_arg1. + +AC_DEFUN([gl_MBRTOWC_NULL_ARG1], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], + [gl_cv_func_mbrtowc_null_arg1], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#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 () +{ + int result = 0; + + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + char input[] = "\303\237er"; + mbstate_t state; + wchar_t wc; + size_t ret; + + memset (&state, '\0', sizeof (mbstate_t)); + wc = (wchar_t) 0xBADFACE; + ret = mbrtowc (&wc, input, 5, &state); + if (ret != 2) + result |= 1; + if (!mbsinit (&state)) + result |= 2; + + memset (&state, '\0', sizeof (mbstate_t)); + ret = mbrtowc (NULL, input, 5, &state); + if (ret != 2) /* Solaris 7 fails here: ret is -1. */ + result |= 4; + if (!mbsinit (&state)) + result |= 8; + } + return result; +}]])], + [gl_cv_func_mbrtowc_null_arg1=yes], + [gl_cv_func_mbrtowc_null_arg1=no], + [:]) + fi + ]) +]) + dnl Test whether mbrtowc supports a NULL string argument correctly. -dnl Result is gl_cv_func_mbrtowc_null_arg. +dnl Result is gl_cv_func_mbrtowc_null_arg2. -AC_DEFUN([gl_MBRTOWC_NULL_ARG], +AC_DEFUN([gl_MBRTOWC_NULL_ARG2], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument], - [gl_cv_func_mbrtowc_null_arg], + [gl_cv_func_mbrtowc_null_arg2], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on OSF/1. - osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;; + osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; # Guess yes otherwise. - *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;; + *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none; then - AC_TRY_RUN([ + 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 () { @@ -228,7 +347,10 @@ int main () return 1; } return 0; -}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:]) +}]])], + [gl_cv_func_mbrtowc_null_arg2=yes], + [gl_cv_func_mbrtowc_null_arg2=no], + [:]) fi ]) ]) @@ -243,7 +365,7 @@ AC_DEFUN([gl_MBRTOWC_RETVAL], AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_JA]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether mbrtowc has a correct return value], [gl_cv_func_mbrtowc_retval], [ @@ -251,19 +373,30 @@ AC_DEFUN([gl_MBRTOWC_RETVAL], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on HP-UX and Solaris. - hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_retval="guessing yes" ;; esac changequote([,])dnl - if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then - AC_TRY_RUN([ + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ + || { case "$host_os" in mingw*) true;; *) false;; esac; }; 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 () { + int result = 0; + int found_some_locale = 0; /* This fails on Solaris. */ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { @@ -276,8 +409,9 @@ int main () { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 1) - return 1; + result |= 1; } + found_some_locale = 1; } /* This fails on HP-UX 11.11. */ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) @@ -291,13 +425,63 @@ int main () { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 2) - return 1; + result |= 2; } + found_some_locale = 1; } - return 0; -}], + /* This fails on native Windows. */ + if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) + { + char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 4; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) + { + char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 8; + } + found_some_locale = 1; + } + if (setlocale (LC_ALL, "Chinese_China.936") != NULL) + { + char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) + { + input[3] = '\0'; + if (mbrtowc (&wc, input + 4, 4, &state) != 1) + result |= 16; + } + found_some_locale = 1; + } + return (found_some_locale ? result : 77); +}]])], [gl_cv_func_mbrtowc_retval=yes], - [gl_cv_func_mbrtowc_retval=no], + [if test $? != 77; then + gl_cv_func_mbrtowc_retval=no + fi + ], [:]) fi ]) @@ -325,9 +509,17 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + 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 () { @@ -342,7 +534,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_nul_retval=yes], [gl_cv_func_mbrtowc_nul_retval=no], [:]) @@ -350,6 +542,41 @@ int main () ]) ]) +dnl Test whether mbrtowc returns the correct value on empty input. + +AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtowc works on empty input], + [gl_cv_func_mbrtowc_empty_input], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + 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" ;; + esac +changequote([,])dnl + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include <wchar.h> + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) == (size_t) -2; + }]])], + [gl_cv_func_mbrtowc_empty_input=no], + [gl_cv_func_mbrtowc_empty_input=yes], + [:]) + ]) +]) + # Prerequisites of lib/mbrtowc.c. AC_DEFUN([gl_PREREQ_MBRTOWC], [ : @@ -358,10 +585,8 @@ AC_DEFUN([gl_PREREQ_MBRTOWC], [ dnl From Paul Eggert -dnl This override of an autoconf macro can be removed when autoconf 2.60 or -dnl newer can be assumed everywhere. +dnl This is an override of an autoconf macro. -m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[ AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. @@ -369,7 +594,14 @@ AC_DEFUN([AC_FUNC_MBRTOWC], gl_cv_func_mbrtowc, [AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [[#include <wchar.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>]], [[wchar_t wc; char const s[] = ""; size_t n = 1; @@ -382,4 +614,3 @@ AC_DEFUN([AC_FUNC_MBRTOWC], [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) -]) diff --git a/gnulib-m4/mbsinit.m4 b/gnulib-m4/mbsinit.m4 index 46c106f..61c4032 100644 --- a/gnulib-m4/mbsinit.m4 +++ b/gnulib-m4/mbsinit.m4 @@ -1,5 +1,5 @@ -# mbsinit.m4 serial 4 -dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc. +# mbsinit.m4 serial 8 +dnl Copyright (C) 2008, 2010-2015 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_FUNC_MBSINIT], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN @@ -14,16 +15,34 @@ AC_DEFUN([gl_FUNC_MBSINIT], AC_CHECK_FUNCS_ONCE([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> +]]) + 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 + dnl replacement. + REPLACE_MBSINIT=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBSINIT=1 + else + dnl On mingw, mbsinit() always returns 1, which is inappropriate for + dnl states produced by mbrtowc() for an incomplete multibyte character + dnl in multibyte locales. + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; + esac fi fi - if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([mbsinit]) - gl_PREREQ_MBSINIT - fi ]) # Prerequisites of lib/mbsinit.c. diff --git a/gnulib-m4/mbstate_t.m4 b/gnulib-m4/mbstate_t.m4 index 3e2df29..42ad6cd 100644 --- a/gnulib-m4/mbstate_t.m4 +++ b/gnulib-m4/mbstate_t.m4 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 12 -dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc. +# mbstate_t.m4 serial 13 +dnl Copyright (C) 2000-2002, 2008-2015 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. @@ -20,7 +20,14 @@ AC_DEFUN([AC_TYPE_MBSTATE_T], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT[ -# include <wchar.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>]], [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) diff --git a/gnulib-m4/mbtowc.m4 b/gnulib-m4/mbtowc.m4 new file mode 100644 index 0000000..88cdeee --- /dev/null +++ b/gnulib-m4/mbtowc.m4 @@ -0,0 +1,19 @@ +# mbtowc.m4 serial 2 +dnl Copyright (C) 2011-2015 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_MBTOWC], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_MBTOWC=1 + fi +]) + +# Prerequisites of lib/mbtowc.c. +AC_DEFUN([gl_PREREQ_MBTOWC], [ + : +]) diff --git a/gnulib-m4/memchr.m4 b/gnulib-m4/memchr.m4 index ab773b8..cb958d8 100644 --- a/gnulib-m4/memchr.m4 +++ b/gnulib-m4/memchr.m4 @@ -1,5 +1,5 @@ -# memchr.m4 serial 8 -dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc. +# memchr.m4 serial 12 +dnl Copyright (C) 2002-2004, 2009-2015 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,10 +11,16 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) - dnl These days, we assume memchr is present. But just in case... AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([memchr]) - if test $ac_cv_func_memchr = yes; then + m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ + dnl These days, we assume memchr is present. But if support for old + dnl platforms is desired: + AC_CHECK_FUNCS_ONCE([memchr]) + if test $ac_cv_func_memchr = no; then + HAVE_MEMCHR=0 + fi + ]) + if test $HAVE_MEMCHR = 1; then # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 # http://bugzilla.redhat.com/499689 @@ -35,6 +41,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], # endif #endif ]], [[ + int result = 0; char *fence = NULL; #if HAVE_SYS_MMAN_H && HAVE_MPROTECT # if HAVE_MAP_ANONYMOUS @@ -58,24 +65,20 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], if (fence) { if (memchr (fence, 0, 0)) - return 1; + result |= 1; strcpy (fence - 9, "12345678"); if (memchr (fence - 9, 0, 79) != fence - 1) - return 2; + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; } - return 0; + return result; ]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], [dnl Be pessimistic for now. gl_cv_func_memchr_works="guessing no"])]) if test "$gl_cv_func_memchr_works" != yes; then REPLACE_MEMCHR=1 fi - else - HAVE_MEMCHR=0 - fi - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then - AC_LIBOBJ([memchr]) - gl_PREREQ_MEMCHR fi ]) diff --git a/gnulib-m4/minmax.m4 b/gnulib-m4/minmax.m4 index d9e9cec..0df832c 100644 --- a/gnulib-m4/minmax.m4 +++ b/gnulib-m4/minmax.m4 @@ -1,10 +1,10 @@ -# minmax.m4 serial 3 -dnl Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc. +# minmax.m4 serial 4 +dnl Copyright (C) 2005, 2009-2015 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.52]) +AC_PREREQ([2.53]) AC_DEFUN([gl_MINMAX], [ @@ -28,8 +28,11 @@ AC_DEFUN([gl_MINMAX_IN_HEADER], m4_pushdef([HEADER], AS_TR_CPP([$1])) AC_CACHE_CHECK([whether <$1> defines MIN and MAX], [gl_cv_minmax_in_]header, - [AC_TRY_COMPILE([#include <$1> -int x = MIN (42, 17);], [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <$1> + int x = MIN (42, 17);]], + [[]])], [gl_cv_minmax_in_]header[=yes], [gl_cv_minmax_in_]header[=no])]) if test $gl_cv_minmax_in_[]header = yes; then diff --git a/gnulib-m4/mmap-anon.m4 b/gnulib-m4/mmap-anon.m4 index a6b7b9a..92a88d0 100644 --- a/gnulib-m4/mmap-anon.m4 +++ b/gnulib-m4/mmap-anon.m4 @@ -1,5 +1,5 @@ -# mmap-anon.m4 serial 8 -dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc. +# mmap-anon.m4 serial 10 +dnl Copyright (C) 2005, 2007, 2009-2015 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. @@ -9,16 +9,12 @@ dnl with or without modifications, as long as this notice is preserved. # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS # and MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. -# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. +# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be # used. AC_DEFUN([gl_FUNC_MMAP_ANON], [ - dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. - AC_REQUIRE([AC_PROG_CPP]) - AC_REQUIRE([AC_PROG_EGREP]) - dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -31,18 +27,18 @@ AC_DEFUN([gl_FUNC_MMAP_ANON], gl_have_mmap_anonymous=no if test $gl_have_mmap = yes; then AC_MSG_CHECKING([for MAP_ANONYMOUS]) - AC_EGREP_CPP([I cant identify this map.], [ + AC_EGREP_CPP([I cannot identify this map], [ #include <sys/mman.h> #ifdef MAP_ANONYMOUS - I cant identify this map. + I cannot identify this map #endif ], [gl_have_mmap_anonymous=yes]) if test $gl_have_mmap_anonymous != yes; then - AC_EGREP_CPP([I cant identify this map.], [ + AC_EGREP_CPP([I cannot identify this map], [ #include <sys/mman.h> #ifdef MAP_ANON - I cant identify this map. + I cannot identify this map #endif ], [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON], diff --git a/gnulib-m4/msvc-inval.m4 b/gnulib-m4/msvc-inval.m4 new file mode 100644 index 0000000..9446fa5 --- /dev/null +++ b/gnulib-m4/msvc-inval.m4 @@ -0,0 +1,19 @@ +# msvc-inval.m4 serial 1 +dnl Copyright (C) 2011-2015 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_MSVC_INVAL], +[ + AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler]) + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1], + [Define to 1 on MSVC platforms that have the "invalid parameter handler" + concept.]) + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi + AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER]) +]) diff --git a/gnulib-m4/msvc-nothrow.m4 b/gnulib-m4/msvc-nothrow.m4 new file mode 100644 index 0000000..5d72a04 --- /dev/null +++ b/gnulib-m4/msvc-nothrow.m4 @@ -0,0 +1,10 @@ +# msvc-nothrow.m4 serial 1 +dnl Copyright (C) 2011-2015 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_MSVC_NOTHROW], +[ + AC_REQUIRE([gl_MSVC_INVAL]) +]) diff --git a/gnulib-m4/multiarch.m4 b/gnulib-m4/multiarch.m4 index 389bd2b..fc575c1 100644 --- a/gnulib-m4/multiarch.m4 +++ b/gnulib-m4/multiarch.m4 @@ -1,12 +1,12 @@ -# multiarch.m4 serial 5 -dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +# multiarch.m4 serial 7 +dnl Copyright (C) 2008-2015 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. # Determine whether the compiler is or may be producing universal binaries. # -# On MacOS X 10.5 and later systems, the user can create libraries and +# On Mac OS X 10.5 and later systems, the user can create libraries and # executables that work on multiple system types--known as "fat" or # "universal" binaries--by specifying multiple '-arch' options to the # compiler but only a single '-arch' option to the preprocessor. Like @@ -16,8 +16,7 @@ dnl with or without modifications, as long as this notice is preserved. # CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ # CPP="gcc -E" CXXCPP="g++ -E" # -# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the -# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly. +# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly. AC_DEFUN_ONCE([gl_MULTIARCH], [ @@ -55,8 +54,6 @@ AC_DEFUN_ONCE([gl_MULTIARCH], done ]) if test $gl_cv_c_multiarch = yes; then - AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1], - [Define if the compiler is building for multiple architectures of Apple platforms at once.]) APPLE_UNIVERSAL_BUILD=1 else APPLE_UNIVERSAL_BUILD=0 diff --git a/gnulib-m4/nocrash.m4 b/gnulib-m4/nocrash.m4 index efbcfa6..5628318 100644 --- a/gnulib-m4/nocrash.m4 +++ b/gnulib-m4/nocrash.m4 @@ -1,5 +1,5 @@ -# nocrash.m4 serial 2 -dnl Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc. +# nocrash.m4 serial 4 +dnl Copyright (C) 2005, 2009-2015 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. @@ -18,7 +18,7 @@ dnl int main() { nocrash_init(); ... } AC_DEFUN([GL_NOCRASH],[[ #include <stdlib.h> #if defined __MACH__ && defined __APPLE__ -/* Avoid a crash on MacOS X. */ +/* Avoid a crash on Mac OS X. */ #include <mach/mach.h> #include <mach/mach_error.h> #include <mach/thread_status.h> @@ -79,6 +79,34 @@ nocrash_init (void) } } } +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* Avoid a crash on native Windows. */ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winerror.h> +static LONG WINAPI +exception_filter (EXCEPTION_POINTERS *ExceptionInfo) +{ + switch (ExceptionInfo->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + exit (1); + } + return EXCEPTION_CONTINUE_SEARCH; +} +static void +nocrash_init (void) +{ + SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); +} #else /* Avoid a crash on POSIX systems. */ #include <signal.h> diff --git a/gnulib-m4/off_t.m4 b/gnulib-m4/off_t.m4 new file mode 100644 index 0000000..0eb1467 --- /dev/null +++ b/gnulib-m4/off_t.m4 @@ -0,0 +1,18 @@ +# off_t.m4 serial 1 +dnl Copyright (C) 2012-2015 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 Check whether to override the 'off_t' type. +dnl Set WINDOWS_64_BIT_OFF_T. + +AC_DEFUN([gl_TYPE_OFF_T], +[ + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([gl_LARGEFILE]) + ], [ + WINDOWS_64_BIT_OFF_T=0 + ]) + AC_SUBST([WINDOWS_64_BIT_OFF_T]) +]) diff --git a/gnulib-m4/printf-frexp.m4 b/gnulib-m4/printf-frexp.m4 index c42391a..b923c82 100644 --- a/gnulib-m4/printf-frexp.m4 +++ b/gnulib-m4/printf-frexp.m4 @@ -1,5 +1,5 @@ -# printf-frexp.m4 serial 3 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# printf-frexp.m4 serial 5 +dnl Copyright (C) 2007, 2009-2015 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,16 +8,7 @@ dnl Check how to define printf_frexp() without linking with libm. AC_DEFUN([gl_FUNC_PRINTF_FREXP], [ - AC_CACHE_CHECK([whether frexp can be used without linking with libm], - [gl_cv_func_frexp_no_libm], - [ - AC_TRY_LINK([#include <math.h> - double x; - int y;], - [return frexp (x, &y) < 1;], - [gl_cv_func_frexp_no_libm=yes], - [gl_cv_func_frexp_no_libm=no]) - ]) + AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) if test $gl_cv_func_frexp_no_libm = yes; then gl_FUNC_FREXP_WORKS case "$gl_cv_func_frexp_works" in @@ -31,10 +22,12 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXP], AC_CACHE_CHECK([whether ldexp can be used without linking with libm], [gl_cv_func_ldexp_no_libm], [ - AC_TRY_LINK([#include <math.h> - double x; - int y;], - [return ldexp (x, y) < 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + double x; + int y;]], + [[return ldexp (x, y) < 1;]])], [gl_cv_func_ldexp_no_libm=yes], [gl_cv_func_ldexp_no_libm=no]) ]) diff --git a/gnulib-m4/printf-frexpl.m4 b/gnulib-m4/printf-frexpl.m4 index 14ffe1f..ab0eccf 100644 --- a/gnulib-m4/printf-frexpl.m4 +++ b/gnulib-m4/printf-frexpl.m4 @@ -1,5 +1,5 @@ -# printf-frexpl.m4 serial 6 -dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +# printf-frexpl.m4 serial 10 +dnl Copyright (C) 2007, 2009-2015 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. @@ -9,17 +9,10 @@ dnl Check how to define printf_frexpl() without linking with libm. AC_DEFUN([gl_FUNC_PRINTF_FREXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + dnl Subset of gl_FUNC_FREXPL_NO_LIBM. - AC_CACHE_CHECK([whether frexpl can be used without linking with libm], - [gl_cv_func_frexpl_no_libm], - [ - AC_TRY_LINK([#include <math.h> - long double x; - int y;], - [return frexpl (x, &y) < 1;], - [gl_cv_func_frexpl_no_libm=yes], - [gl_cv_func_frexpl_no_libm=no]) - ]) + gl_CHECK_FREXPL_NO_LIBM if test $gl_cv_func_frexpl_no_libm = yes; then gl_FUNC_FREXPL_WORKS case "$gl_cv_func_frexpl_works" in @@ -35,20 +28,11 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL], AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1], [Define if the frexpl function is available in libc.]) dnl Also check whether it's declared. - dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. - AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>]) + dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>. + AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]]) fi - AC_CACHE_CHECK([whether ldexpl can be used without linking with libm], - [gl_cv_func_ldexpl_no_libm], - [ - AC_TRY_LINK([#include <math.h> - long double x; - int y;], - [return ldexpl (x, y) < 1;], - [gl_cv_func_ldexpl_no_libm=yes], - [gl_cv_func_ldexpl_no_libm=no]) - ]) + gl_CHECK_LDEXPL_NO_LIBM if test $gl_cv_func_ldexpl_no_libm = yes; then gl_FUNC_LDEXPL_WORKS case "$gl_cv_func_ldexpl_works" in @@ -56,8 +40,8 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL], AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1], [Define if the ldexpl function is available in libc.]) dnl Also check whether it's declared. - dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>. - AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>]) + dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>. + AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]]) ;; esac fi diff --git a/gnulib-m4/printf.m4 b/gnulib-m4/printf.m4 index ebca536..d06746a 100644 --- a/gnulib-m4/printf.m4 +++ b/gnulib-m4/printf.m4 @@ -1,5 +1,5 @@ -# printf.m4 serial 33 -dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc. +# printf.m4 serial 52 +dnl Copyright (C) 2003, 2007-2015 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,8 @@ AC_DEFUN([gl_PRINTF_SIZES_C99], AC_CACHE_CHECK([whether printf supports size specifiers as in C99], [gl_cv_func_printf_sizes_c99], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stddef.h> #include <stdio.h> #include <string.h> @@ -31,53 +32,56 @@ AC_DEFUN([gl_PRINTF_SIZES_C99], static char buf[100]; int main () { + int result = 0; #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX buf[0] = '\0'; if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) - return 1; + result |= 1; #endif buf[0] = '\0'; if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 || strcmp (buf, "12345672 33") != 0) - return 1; + result |= 2; buf[0] = '\0'; if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 || strcmp (buf, "12345673 33") != 0) - return 1; + result |= 4; buf[0] = '\0'; if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 || strcmp (buf, "1.5 33") != 0) - return 1; - return 0; -}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no], - [ + result |= 8; + return result; +}]])], + [gl_cv_func_printf_sizes_c99=yes], + [gl_cv_func_printf_sizes_c99=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; - darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_printf_sizes_c99="guessing no";; - openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on Solaris >= 2.10. - solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; - solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_sizes_c99="guessing no";; - netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_sizes_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -92,35 +96,39 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE], AC_CACHE_CHECK([whether printf supports 'long double' arguments], [gl_cv_func_printf_long_double], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[10000]; int main () { + int result = 0; buf[0] = '\0'; if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.750000 33") != 0) - return 1; + result |= 1; buf[0] = '\0'; if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.750000e+00 33") != 0) - return 1; + result |= 2; buf[0] = '\0'; if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.75 33") != 0) - return 1; - return 0; -}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no], - [ + result |= 4; + return result; +}]])], + [gl_cv_func_printf_long_double=yes], + [gl_cv_func_printf_long_double=no], + [ changequote(,)dnl - case "$host_os" in - beos*) gl_cv_func_printf_long_double="guessing no";; - mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; - *) gl_cv_func_printf_long_double="guessing yes";; - esac + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -136,7 +144,8 @@ AC_DEFUN([gl_PRINTF_INFINITE], AC_CACHE_CHECK([whether printf supports infinite 'double' arguments], [gl_cv_func_printf_infinite], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static int @@ -168,65 +177,68 @@ static char buf[10000]; static double zero = 0.0; int main () { - if (sprintf (buf, "%f", 1.0 / 0.0) < 0 + int result = 0; + if (sprintf (buf, "%f", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%f", -1.0 / 0.0) < 0 + result |= 1; + if (sprintf (buf, "%f", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; + result |= 1; if (sprintf (buf, "%f", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%e", 1.0 / 0.0) < 0 + result |= 2; + if (sprintf (buf, "%e", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%e", -1.0 / 0.0) < 0 + result |= 4; + if (sprintf (buf, "%e", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; + result |= 4; if (sprintf (buf, "%e", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%g", 1.0 / 0.0) < 0 + result |= 8; + if (sprintf (buf, "%g", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%g", -1.0 / 0.0) < 0 + result |= 16; + if (sprintf (buf, "%g", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; + result |= 16; if (sprintf (buf, "%g", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 32; /* This test fails on HP-UX 10.20. */ if (have_minus_zero ()) if (sprintf (buf, "%g", - zero) < 0 || strcmp (buf, "-0") != 0) - return 1; - return 0; -}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no], - [ + result |= 64; + return result; +}]])], + [gl_cv_func_printf_infinite=yes], + [gl_cv_func_printf_infinite=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; - darwin*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; - hpux*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_infinite="guessing no";; - netbsd*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_infinite="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_infinite="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -239,6 +251,7 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. @@ -252,7 +265,8 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments], [gl_cv_func_printf_infinite_long_double], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ ]GL_NOCRASH[ #include <float.h> #include <stdio.h> @@ -279,41 +293,42 @@ static char buf[10000]; static long double zeroL = 0.0L; int main () { + int result = 0; nocrash_init(); - if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0 + if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0 + result |= 1; + if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; + result |= 1; if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0 + result |= 1; + if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0 + result |= 1; + if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; + result |= 1; if (sprintf (buf, "%Le", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0 + result |= 1; + if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) - return 1; - if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0 + result |= 1; + if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) - return 1; + result |= 1; if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; -#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) + result |= 1; +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else @@ -325,13 +340,13 @@ int main () { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 2; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 2; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 2; } { /* Signalling NaN. */ @@ -339,113 +354,91 @@ int main () { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 2; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 2; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) - return 1; + result |= 2; } { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 4; } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 8; } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 16; } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 32; } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) - return 1; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 64; } #endif - return 0; -}], - [gl_cv_func_printf_infinite_long_double=yes], - [gl_cv_func_printf_infinite_long_double=no], - [ + return result; +}]])], + [gl_cv_func_printf_infinite_long_double=yes], + [gl_cv_func_printf_infinite_long_double=no], + [ changequote(,)dnl - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; - *) - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; - darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; - hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_infinite_long_double="guessing no";; - netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_infinite_long_double="guessing no";; - esac - ;; - esac + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac changequote([,])dnl - ]) + ]) ]) ;; *) @@ -466,72 +459,77 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A], AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives], [gl_cv_func_printf_directive_a], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[100]; +static double zero = 0.0; int main () { + int result = 0; if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 || (strcmp (buf, "0x1.922p+1 33") != 0 && strcmp (buf, "0x3.244p+0 33") != 0 && strcmp (buf, "0x6.488p-1 33") != 0 && strcmp (buf, "0xc.91p-2 33") != 0)) - return 1; + result |= 1; if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 || (strcmp (buf, "-0X1.922P+1 33") != 0 && strcmp (buf, "-0X3.244P+0 33") != 0 && strcmp (buf, "-0X6.488P-1 33") != 0 && strcmp (buf, "-0XC.91P-2 33") != 0)) - return 1; + result |= 2; /* This catches a FreeBSD 6.1 bug: it doesn't round. */ if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 || (strcmp (buf, "0x1.83p+0 33") != 0 && strcmp (buf, "0x3.05p-1 33") != 0 && strcmp (buf, "0x6.0ap-2 33") != 0 && strcmp (buf, "0xc.14p-3 33") != 0)) - return 1; + result |= 4; /* This catches a FreeBSD 6.1 bug. See <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */ - if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0 + if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 || buf[0] == '0') - return 1; - /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */ + result |= 8; + /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ if (sprintf (buf, "%.1a", 1.999) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 && strcmp (buf, "0x4.0p-1") != 0 && strcmp (buf, "0x8.0p-2") != 0)) - return 1; - /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a + result |= 16; + /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */ if (sprintf (buf, "%.1La", 1.999L) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 && strcmp (buf, "0x4.0p-1") != 0 && strcmp (buf, "0x8.0p-2") != 0)) - return 1; - return 0; -}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no], - [ - case "$host_os" in - # Guess yes on glibc >= 2.5 systems. - *-gnu*) - AC_EGREP_CPP([BZ2908], [ - #include <features.h> - #ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) - BZ2908 - #endif - #endif - ], - [gl_cv_func_printf_directive_a="guessing yes"], - [gl_cv_func_printf_directive_a="guessing no"]) - ;; - # If we don't know, assume the worst. - *) gl_cv_func_printf_directive_a="guessing no";; - esac - ]) + result |= 32; + return result; +}]])], + [gl_cv_func_printf_directive_a=yes], + [gl_cv_func_printf_directive_a=no], + [ + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu*) + AC_EGREP_CPP([BZ2908], [ + #include <features.h> + #ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ + BZ2908 + #endif + #endif + ], + [gl_cv_func_printf_directive_a="guessing yes"], + [gl_cv_func_printf_directive_a="guessing no"]) + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac + ]) ]) ]) @@ -546,43 +544,48 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F], AC_CACHE_CHECK([whether printf supports the 'F' directive], [gl_cv_func_printf_directive_f], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[100]; +static double zero = 0.0; int main () { + int result = 0; if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 || strcmp (buf, "1234567.000000 33") != 0) - return 1; - if (sprintf (buf, "%F", 1.0 / 0.0) < 0 + result |= 1; + if (sprintf (buf, "%F", 1.0 / zero) < 0 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) - return 1; + result |= 2; /* This catches a Cygwin 1.5.x bug. */ if (sprintf (buf, "%.F", 1234.0) < 0 || strcmp (buf, "1234") != 0) - return 1; - return 0; -}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no], - [ + result |= 4; + return result; +}]])], + [gl_cv_func_printf_directive_f=yes], + [gl_cv_func_printf_directive_f=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; - darwin*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on Solaris >= 2.10. - solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; - solaris*) gl_cv_func_printf_directive_f="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_directive_f="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -597,14 +600,30 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N], AC_CACHE_CHECK([whether printf supports the 'n' directive], [gl_cv_func_printf_directive_n], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> +#include <stdlib.h> #include <string.h> +#ifdef _MSC_VER +/* See page about "Parameter Validation" on msdn.microsoft.com. */ +static void cdecl +invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, unsigned int line, + uintptr_t dummy) +{ + exit (1); +} +#endif static char fmtstring[10]; static char buf[100]; int main () { int count = -1; +#ifdef _MSC_VER + _set_invalid_parameter_handler (invalid_parameter_handler); +#endif /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) support %n in format strings in read-only memory but not in writable memory. */ @@ -614,14 +633,17 @@ int main () || count != 4) return 1; return 0; -}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no], - [ +}]])], + [gl_cv_func_printf_directive_n=yes], + [gl_cv_func_printf_directive_n=no], + [ changequote(,)dnl - case "$host_os" in - *) gl_cv_func_printf_directive_n="guessing yes";; - esac + case "$host_os" in + mingw*) gl_cv_func_printf_directive_n="guessing no";; + *) gl_cv_func_printf_directive_n="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -639,7 +661,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], AC_CACHE_CHECK([whether printf supports the 'ls' directive], [gl_cv_func_printf_directive_ls], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ /* 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 @@ -651,6 +674,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], #include <string.h> int main () { + int result = 0; char buf[100]; /* Test whether %ls works at all. This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on @@ -660,7 +684,7 @@ int main () buf[0] = '\0'; if (sprintf (buf, "%ls", wstring) < 0 || strcmp (buf, "abc") != 0) - return 1; + result |= 1; } /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an assertion failure inside libc), but not on OpenBSD 4.0. */ @@ -669,7 +693,7 @@ int main () buf[0] = '\0'; if (sprintf (buf, "%ls", wstring) < 0 || strcmp (buf, "a") != 0) - return 1; + result |= 2; } /* Test whether precisions in %ls are supported as specified in ISO C 99 section 7.19.6.1: @@ -684,22 +708,24 @@ int main () buf[0] = '\0'; if (sprintf (buf, "%.2ls", wstring) < 0 || strcmp (buf, "ab") != 0) - return 1; + result |= 8; } - return 0; -}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no], - [ + return result; +}]])], + [gl_cv_func_printf_directive_ls=yes], + [gl_cv_func_printf_directive_ls=no], + [ changequote(,)dnl - case "$host_os" in - openbsd*) gl_cv_func_printf_directive_ls="guessing no";; - irix*) gl_cv_func_printf_directive_ls="guessing no";; - solaris*) gl_cv_func_printf_directive_ls="guessing no";; - cygwin*) gl_cv_func_printf_directive_ls="guessing no";; - beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; - *) gl_cv_func_printf_directive_ls="guessing yes";; - esac + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -714,7 +740,8 @@ AC_DEFUN([gl_PRINTF_POSITIONS], AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions], [gl_cv_func_printf_positions], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> /* The string "%2$d %1$d", with dollar characters protected from the shell's @@ -725,18 +752,20 @@ int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); -}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no], - [ +}]])], + [gl_cv_func_printf_positions=yes], + [gl_cv_func_printf_positions=no], + [ changequote(,)dnl - case "$host_os" in - netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) - gl_cv_func_printf_positions="guessing no";; - beos*) gl_cv_func_printf_positions="guessing no";; - mingw* | pw*) gl_cv_func_printf_positions="guessing no";; - *) gl_cv_func_printf_positions="guessing yes";; - esac + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -751,7 +780,8 @@ AC_DEFUN([gl_PRINTF_FLAG_GROUPING], AC_CACHE_CHECK([whether printf supports the grouping flag], [gl_cv_func_printf_flag_grouping], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[100]; @@ -761,17 +791,19 @@ int main () || buf[strlen (buf) - 1] != '9') return 1; return 0; -}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no], - [ +}]])], + [gl_cv_func_printf_flag_grouping=yes], + [gl_cv_func_printf_flag_grouping=no], + [ changequote(,)dnl - case "$host_os" in - cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; - netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; - mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; - *) gl_cv_func_printf_flag_grouping="guessing yes";; - esac + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -787,7 +819,8 @@ AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST], AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly], [gl_cv_func_printf_flag_leftadjust], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[100]; @@ -798,7 +831,7 @@ int main () || strcmp (buf, "ab c") != 0) return 1; return 0; -}], +}]])], [gl_cv_func_printf_flag_leftadjust=yes], [gl_cv_func_printf_flag_leftadjust=no], [ @@ -828,37 +861,44 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO], AC_CACHE_CHECK([whether printf supports the zero flag correctly], [gl_cv_func_printf_flag_zero], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[100]; +static double zero = 0.0; int main () { - if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0 + if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 || (strcmp (buf, " inf") != 0 && strcmp (buf, " infinity") != 0)) return 1; return 0; -}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no], - [ +}]])], + [gl_cv_func_printf_flag_zero=yes], + [gl_cv_func_printf_flag_zero=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_flag_zero="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_flag_zero="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) dnl Test whether the *printf family of functions supports large precisions. dnl On mingw, precisions larger than 512 are treated like 512, in integer, -dnl floating-point or pointer output. On BeOS, precisions larger than 1044 -dnl crash the program. +dnl floating-point or pointer output. On Solaris 10/x86, precisions larger +dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC, +dnl precisions larger than 510 in floating-point output yield wrong results. +dnl On AIX 7.1, precisions larger than 998 in floating-point output yield +dnl wrong results. On BeOS, precisions larger than 1044 crash the program. dnl Result is gl_cv_func_printf_precision. AC_DEFUN([gl_PRINTF_PRECISION], @@ -868,30 +908,43 @@ AC_DEFUN([gl_PRINTF_PRECISION], AC_CACHE_CHECK([whether printf supports large precisions], [gl_cv_func_printf_precision], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> static char buf[5000]; int main () { + int result = 0; #ifdef __BEOS__ /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ return 1; #endif if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) - return 1; - return 0; -}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no], - [ + result |= 1; + if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) + result |= 2; + if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 + || buf[0] != '1') + result |= 4; + if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 + || buf[0] != '1') + result |= 4; + return result; +}]])], + [gl_cv_func_printf_precision=yes], + [gl_cv_func_printf_precision=no], + [ changequote(,)dnl - case "$host_os" in - # Guess no only on native Win32 and BeOS systems. - mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; - beos*) gl_cv_func_printf_precision="guessing no" ;; - *) gl_cv_func_printf_precision="guessing yes" ;; - esac + case "$host_os" in + # Guess no only on Solaris, native Windows, and BeOS systems. + solaris*) gl_cv_func_printf_precision="guessing no" ;; + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -960,8 +1013,9 @@ int main() changequote([,])dnl ])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then - (./conftest + (./conftest 2>&AS_MESSAGE_LOG_FD result=$? + _AS_ECHO_LOG([\$? = $result]) if test $result != 0 && test $result != 77; then result=1; fi exit $result ) >/dev/null 2>/dev/null @@ -975,7 +1029,7 @@ changequote([,])dnl fi rm -fr conftest* else - dnl A universal build on Apple MacOS X platforms. + dnl A universal build on Apple Mac OS X platforms. dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. dnl But we need a configuration result that is valid in both modes. gl_cv_func_printf_enomem="guessing no" @@ -1028,61 +1082,80 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf truncates the result as in C99], [gl_cv_func_snprintf_truncation_c99], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif static char buf[100]; int main () { strcpy (buf, "ABCDEF"); - snprintf (buf, 3, "%d %d", 4567, 89); + my_snprintf (buf, 3, "%d %d", 4567, 89); if (memcmp (buf, "45\0DEF", 6) != 0) return 1; return 0; -}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no], - [ +}]])], + [gl_cv_func_snprintf_truncation_c99=yes], + [gl_cv_func_snprintf_truncation_c99=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; - darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_snprintf_truncation_c99="guessing no";; - openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; - hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on OSF/1 >= 5. - osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_snprintf_truncation_c99="guessing no";; - netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_snprintf_truncation_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1101,56 +1174,78 @@ dnl } dnl --------------------------------------------------------------------- dnl Result is gl_cv_func_snprintf_retval_c99. -AC_DEFUN([gl_SNPRINTF_RETVAL_C99], +AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], [gl_cv_func_snprintf_retval_c99], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif static char buf[100]; int main () { strcpy (buf, "ABCDEF"); - if (snprintf (buf, 3, "%d %d", 4567, 89) != 7) + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; return 0; -}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no], - [ +}]])], + [gl_cv_func_snprintf_retval_c99=yes], + [gl_cv_func_snprintf_retval_c99=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; - darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_snprintf_retval_c99="guessing no";; - openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";; - solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; - aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_snprintf_retval_c99="guessing no";; - netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_snprintf_retval_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1162,12 +1257,28 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive], [gl_cv_func_snprintf_directive_n], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif static char fmtstring[10]; static char buf[100]; int main () @@ -1177,44 +1288,47 @@ int main () support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); - snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); + my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); if (count != 6) return 1; return 0; -}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no], - [ +}]])], + [gl_cv_func_snprintf_directive_n=yes], + [gl_cv_func_snprintf_directive_n=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; - darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";; - solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; - aix*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on OSF/1 >= 5. - osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; - osf*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_snprintf_directive_n="guessing no";; - netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_snprintf_directive_n="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_snprintf_directive_n="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1226,20 +1340,36 @@ dnl Result is gl_cv_func_snprintf_size1. AC_DEFUN([gl_SNPRINTF_SIZE1], [ AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf respects a size of 1], [gl_cv_func_snprintf_size1], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include <stdarg.h> +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif int main() { static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; - snprintf (buf, 1, "%d", 12345); + my_snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; -}], - [gl_cv_func_snprintf_size1=yes], - [gl_cv_func_snprintf_size1=no], - [gl_cv_func_snprintf_size1="guessing yes"]) +}]])], + [gl_cv_func_snprintf_size1=yes], + [gl_cv_func_snprintf_size1=no], + [gl_cv_func_snprintf_size1="guessing yes"]) ]) ]) @@ -1286,7 +1416,8 @@ AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99], AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99], [gl_cv_func_vsnprintf_zerosize_c99], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdarg.h> #include <stdio.h> static int my_snprintf (char *buf, int size, const char *format, ...) @@ -1303,43 +1434,44 @@ int main() static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; -}], - [gl_cv_func_vsnprintf_zerosize_c99=yes], - [gl_cv_func_vsnprintf_zerosize_c99=no], - [ +}]])], + [gl_cv_func_vsnprintf_zerosize_c99=yes], + [gl_cv_func_vsnprintf_zerosize_c99=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Cygwin. - cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on mingw. - mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1393,24 +1525,31 @@ dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . -dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . . +dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . . +dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . . dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . -dnl Solaris 10 . . # # # . . # . . . # . . . . . . . . -dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . . +dnl Solaris 11 2011-11 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . +dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # +dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . . dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . -dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . . +dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . . dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # +dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . -dnl Haiku . . . # # # . # . . . . . ? . . . . . . -dnl BeOS # # . # # # . ? # . ? . # ? . . . . . . -dnl mingw # # # # # # . . # # . # # ? . # # # . . +dnl Haiku . . . # # # . # . . . . . ? . . ? . . . +dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . +dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . . +dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . . +dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . . +dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . . diff --git a/gnulib-m4/putenv.m4 b/gnulib-m4/putenv.m4 index dd9140c..73a5f46 100644 --- a/gnulib-m4/putenv.m4 +++ b/gnulib-m4/putenv.m4 @@ -1,5 +1,5 @@ -# putenv.m4 serial 16 -dnl Copyright (C) 2002-2010 Free Software Foundation, Inc. +# putenv.m4 serial 20 +dnl Copyright (C) 2002-2015 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,6 +12,7 @@ dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that. AC_DEFUN([gl_FUNC_PUTENV], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([for putenv compatible with GNU and SVID], [gl_cv_func_svid_putenv], [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ @@ -21,21 +22,35 @@ AC_DEFUN([gl_FUNC_PUTENV], /* Try to remove it. */ if (putenv ("CONFTEST_putenv")) - return 1; + return 2; /* Make sure it was deleted. */ if (getenv ("CONFTEST_putenv") != 0) - return 1; + return 3; return 0; ]])], gl_cv_func_svid_putenv=yes, gl_cv_func_svid_putenv=no, dnl When crosscompiling, assume putenv is broken. - gl_cv_func_svid_putenv=no) + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_svid_putenv="guessing no" ;; + esac + ]) ]) - if test $gl_cv_func_svid_putenv = no; then - REPLACE_PUTENV=1 - AC_LIBOBJ([putenv]) - fi + case "$gl_cv_func_svid_putenv" in + *yes) ;; + *) + REPLACE_PUTENV=1 + ;; + esac +]) + +# Prerequisites of lib/putenv.c. +AC_DEFUN([gl_PREREQ_PUTENV], +[ + AC_CHECK_DECLS([_putenv]) ]) diff --git a/gnulib-m4/relocatable-lib.m4 b/gnulib-m4/relocatable-lib.m4 index c192378..889e099 100644 --- a/gnulib-m4/relocatable-lib.m4 +++ b/gnulib-m4/relocatable-lib.m4 @@ -1,5 +1,5 @@ -# relocatable-lib.m4 serial 5 -dnl Copyright (C) 2003, 2005-2007, 2009-2010 Free Software Foundation, Inc. +# relocatable-lib.m4 serial 6 +dnl Copyright (C) 2003, 2005-2007, 2009-2015 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,9 +10,6 @@ dnl Support for relocatable libraries. AC_DEFUN([gl_RELOCATABLE_LIBRARY], [ AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY]) - if test $RELOCATABLE = yes; then - AC_LIBOBJ([relocatable]) - fi ]) AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY], [ @@ -32,13 +29,6 @@ AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY], fi ]) -dnl Like gl_RELOCATABLE_LIBRARY, except prepare for separate compilation -dnl (no AC_LIBOBJ). -AC_DEFUN([gl_RELOCATABLE_LIBRARY_SEPARATE], -[ - AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY]) -]) - dnl Support for relocatable packages for which it is a nop. AC_DEFUN([gl_RELOCATABLE_NOP], [ @@ -55,4 +45,3 @@ AC_DEFUN([gl_RELOCATABLE_NOP], AC_SUBST([RELOCATABLE]) AC_MSG_RESULT([$RELOCATABLE]) ]) - diff --git a/gnulib-m4/setenv.m4 b/gnulib-m4/setenv.m4 index 58f6d13..3aa38d8 100644 --- a/gnulib-m4/setenv.m4 +++ b/gnulib-m4/setenv.m4 @@ -1,5 +1,5 @@ -# setenv.m4 serial 16 -dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc. +# setenv.m4 serial 26 +dnl Copyright (C) 2001-2004, 2006-2015 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,16 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_SETENV], [ AC_REQUIRE([gl_FUNC_SETENV_SEPARATE]) - if test $HAVE_SETENV$REPLACE_SETENV != 10; then - AC_LIBOBJ([setenv]) - fi -]) - -# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ). -AC_DEFUN([gl_FUNC_SETENV_SEPARATE], -[ - AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([setenv]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles if test $ac_cv_func_setenv = no; then HAVE_SETENV=0 else @@ -27,69 +18,127 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE], #include <errno.h> #include <string.h> ]], [[ - if (setenv ("", "", 0) != -1) return 1; - if (errno != EINVAL) return 2; - if (setenv ("a", "=", 1) != 0) return 3; - if (strcmp (getenv ("a"), "=") != 0) return 4; + int result = 0; + { + if (setenv ("", "", 0) != -1) + result |= 1; + else if (errno != EINVAL) + result |= 2; + } + { + if (setenv ("a", "=", 1) != 0) + result |= 4; + else if (strcmp (getenv ("a"), "=") != 0) + result |= 8; + } + return result; ]])], [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], - [gl_cv_func_setenv_works="guessing no"])]) - if test "$gl_cv_func_setenv_works" != yes; then - REPLACE_SETENV=1 - AC_LIBOBJ([setenv]) - fi + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_setenv_works" in + *yes) ;; + *) + REPLACE_SETENV=1 + ;; + esac fi +]) + +# Like gl_FUNC_SETENV, except prepare for separate compilation +# (no REPLACE_SETENV, no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_SETENV_SEPARATE], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([setenv]) + if test $ac_cv_have_decl_setenv = no; then + HAVE_DECL_SETENV=0 + fi + AC_CHECK_FUNCS_ONCE([setenv]) gl_PREREQ_SETENV ]) AC_DEFUN([gl_FUNC_UNSETENV], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_DECLS_ONCE([unsetenv]) + if test $ac_cv_have_decl_unsetenv = no; then + HAVE_DECL_UNSETENV=0 + fi AC_CHECK_FUNCS([unsetenv]) if test $ac_cv_func_unsetenv = no; then HAVE_UNSETENV=0 - AC_LIBOBJ([unsetenv]) - gl_PREREQ_UNSETENV else + HAVE_UNSETENV=1 dnl Some BSDs return void, failing to do error checking. AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], - [AC_TRY_COMPILE([#include <stdlib.h> + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#undef _BSD +#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ +#include <stdlib.h> extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(__cplusplus) int unsetenv (const char *name); -#else -int unsetenv(); -#endif -], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')]) + ]], + [[]])], + [gt_cv_func_unsetenv_ret='int'], + [gt_cv_func_unsetenv_ret='void'])]) if test $gt_cv_func_unsetenv_ret = 'void'; then AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void instead of int.]) REPLACE_UNSETENV=1 - AC_LIBOBJ([unsetenv]) fi dnl Solaris 10 unsetenv does not remove all copies of a name. - AC_CACHE_CHECK([whether unsetenv works on duplicates], + dnl Haiku alpha 2 unsetenv gets confused by assignment to environ. + dnl OpenBSD 4.7 unsetenv("") does not fail. + AC_CACHE_CHECK([whether unsetenv obeys POSIX], [gl_cv_func_unsetenv_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdlib.h> + #include <errno.h> + extern char **environ; ]], [[ - char entry[] = "b=2"; + char entry1[] = "a=1"; + char entry2[] = "b=2"; + char *env[] = { entry1, entry2, NULL }; if (putenv ((char *) "a=1")) return 1; - if (putenv (entry)) return 2; - entry[0] = 'a'; + if (putenv (entry2)) return 2; + entry2[0] = 'a'; unsetenv ("a"); if (getenv ("a")) return 3; + if (!unsetenv ("") || errno != EINVAL) return 4; + entry2[0] = 'b'; + environ = env; + if (!getenv ("a")) return 5; + entry2[0] = 'a'; + unsetenv ("a"); + if (getenv ("a")) return 6; ]])], [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no], - [gl_cv_func_unsetenv_works="guessing no"])]) - if test "$gl_cv_func_unsetenv_works" != yes; then - REPLACE_UNSETENV=1 - AC_LIBOBJ([unsetenv]) - fi + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unsetenv_works="guessing no" ;; + esac + ])]) + case "$gl_cv_func_unsetenv_works" in + *yes) ;; + *) + REPLACE_UNSETENV=1 + ;; + esac fi ]) diff --git a/gnulib-m4/setlocale.m4 b/gnulib-m4/setlocale.m4 new file mode 100644 index 0000000..6d153f9 --- /dev/null +++ b/gnulib-m4/setlocale.m4 @@ -0,0 +1,29 @@ +# setlocale.m4 serial 4 +dnl Copyright (C) 2011-2015 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_SETLOCALE], +[ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + dnl On native Windows systems, setlocale(category,NULL) does not look at + dnl the environment variables LC_ALL, category, and LANG. + mingw*) REPLACE_SETLOCALE=1 ;; + dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL) + dnl is then still "C". + cygwin*) + case `uname -r` in + 1.5.*) REPLACE_SETLOCALE=1 ;; + esac + ;; + esac +]) + +# Prerequisites of lib/setlocale.c. +AC_DEFUN([gl_PREREQ_SETLOCALE], +[ + : +]) diff --git a/gnulib-m4/signbit.m4 b/gnulib-m4/signbit.m4 index 56ff825..21b9bf5 100644 --- a/gnulib-m4/signbit.m4 +++ b/gnulib-m4/signbit.m4 @@ -1,5 +1,5 @@ -# signbit.m4 serial 6 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# signbit.m4 serial 13 +dnl Copyright (C) 2007-2015 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,9 +7,11 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_SIGNBIT], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <math.h> /* If signbit is defined as a function, don't use it, since calling it for 'float' or 'long double' arguments would involve conversions. @@ -23,8 +25,16 @@ AC_DEFUN([gl_SIGNBIT], #endif #include <string.h> ]gl_SIGNBIT_TEST_PROGRAM -, [gl_cv_func_signbit=yes], [gl_cv_func_signbit=no], - [gl_cv_func_signbit="guessing no"]) +])], + [gl_cv_func_signbit=yes], + [gl_cv_func_signbit=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_signbit="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_signbit="guessing no" ;; + esac + ]) ]) dnl GCC 4.0 and newer provides three built-ins for signbit. dnl They can be used without warnings, also in C++, regardless of <math.h>. @@ -32,7 +42,8 @@ AC_DEFUN([gl_SIGNBIT], dnl libc. AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #if __GNUC__ >= 4 # define signbit(x) \ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ @@ -43,84 +54,102 @@ AC_DEFUN([gl_SIGNBIT], #endif #include <string.h> ]gl_SIGNBIT_TEST_PROGRAM -, [gl_cv_func_signbit_gcc=yes], [gl_cv_func_signbit_gcc=no], - [gl_cv_func_signbit_gcc="guessing no"]) +])], + [gl_cv_func_signbit_gcc=yes], + [gl_cv_func_signbit_gcc=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_signbit_gcc="guessing no" ;; + esac + ]) ]) dnl Use the compiler built-ins whenever possible, because they are more dnl efficient than the system library functions (if they exist). - if test "$gl_cv_func_signbit_gcc" = yes; then - REPLACE_SIGNBIT_USING_GCC=1 - else - if test "$gl_cv_func_signbit" != yes; then - REPLACE_SIGNBIT=1 - AC_LIBOBJ([signbitf]) - AC_LIBOBJ([signbitd]) - AC_LIBOBJ([signbitl]) - gl_FLOAT_SIGN_LOCATION - gl_DOUBLE_SIGN_LOCATION - gl_LONG_DOUBLE_SIGN_LOCATION - if test "$gl_cv_cc_float_signbit" = unknown; then - dnl Test whether copysignf() is declared. - AC_CHECK_DECLS([copysignf], , , [#include <math.h>]) - if test "$ac_cv_have_decl_copysignf" = yes; then - dnl Test whether copysignf() can be used without libm. - AC_CACHE_CHECK([whether copysignf can be used without linking with libm], - [gl_cv_func_copysignf_no_libm], - [ - AC_TRY_LINK([#include <math.h> - float x, y;], - [return copysignf (x, y) < 0;], - [gl_cv_func_copysignf_no_libm=yes], - [gl_cv_func_copysignf_no_libm=no]) - ]) - if test $gl_cv_func_copysignf_no_libm = yes; then - AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1], - [Define if the copysignf function is declared in <math.h> and available in libc.]) + case "$gl_cv_func_signbit_gcc" in + *yes) + REPLACE_SIGNBIT_USING_GCC=1 + ;; + *) + case "$gl_cv_func_signbit" in + *yes) ;; + *) + dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built. + REPLACE_SIGNBIT=1 + gl_FLOAT_SIGN_LOCATION + gl_DOUBLE_SIGN_LOCATION + gl_LONG_DOUBLE_SIGN_LOCATION + if test "$gl_cv_cc_float_signbit" = unknown; then + dnl Test whether copysignf() is declared. + AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]]) + if test "$ac_cv_have_decl_copysignf" = yes; then + dnl Test whether copysignf() can be used without libm. + AC_CACHE_CHECK([whether copysignf can be used without linking with libm], + [gl_cv_func_copysignf_no_libm], + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + float x, y;]], + [[return copysignf (x, y) < 0;]])], + [gl_cv_func_copysignf_no_libm=yes], + [gl_cv_func_copysignf_no_libm=no]) + ]) + if test $gl_cv_func_copysignf_no_libm = yes; then + AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1], + [Define if the copysignf function is declared in <math.h> and available in libc.]) + fi + fi fi - fi - fi - if test "$gl_cv_cc_double_signbit" = unknown; then - dnl Test whether copysign() is declared. - AC_CHECK_DECLS([copysign], , , [#include <math.h>]) - if test "$ac_cv_have_decl_copysign" = yes; then - dnl Test whether copysign() can be used without libm. - AC_CACHE_CHECK([whether copysign can be used without linking with libm], - [gl_cv_func_copysign_no_libm], - [ - AC_TRY_LINK([#include <math.h> - double x, y;], - [return copysign (x, y) < 0;], - [gl_cv_func_copysign_no_libm=yes], - [gl_cv_func_copysign_no_libm=no]) - ]) - if test $gl_cv_func_copysign_no_libm = yes; then - AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1], - [Define if the copysign function is declared in <math.h> and available in libc.]) + if test "$gl_cv_cc_double_signbit" = unknown; then + dnl Test whether copysign() is declared. + AC_CHECK_DECLS([copysign], , , [[#include <math.h>]]) + if test "$ac_cv_have_decl_copysign" = yes; then + dnl Test whether copysign() can be used without libm. + AC_CACHE_CHECK([whether copysign can be used without linking with libm], + [gl_cv_func_copysign_no_libm], + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + double x, y;]], + [[return copysign (x, y) < 0;]])], + [gl_cv_func_copysign_no_libm=yes], + [gl_cv_func_copysign_no_libm=no]) + ]) + if test $gl_cv_func_copysign_no_libm = yes; then + AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1], + [Define if the copysign function is declared in <math.h> and available in libc.]) + fi + fi fi - fi - fi - if test "$gl_cv_cc_long_double_signbit" = unknown; then - dnl Test whether copysignl() is declared. - AC_CHECK_DECLS([copysignl], , , [#include <math.h>]) - if test "$ac_cv_have_decl_copysignl" = yes; then - dnl Test whether copysignl() can be used without libm. - AC_CACHE_CHECK([whether copysignl can be used without linking with libm], - [gl_cv_func_copysignl_no_libm], - [ - AC_TRY_LINK([#include <math.h> - long double x, y;], - [return copysignl (x, y) < 0;], - [gl_cv_func_copysignl_no_libm=yes], - [gl_cv_func_copysignl_no_libm=no]) - ]) - if test $gl_cv_func_copysignl_no_libm = yes; then - AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1], - [Define if the copysignl function is declared in <math.h> and available in libc.]) + if test "$gl_cv_cc_long_double_signbit" = unknown; then + dnl Test whether copysignl() is declared. + AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]]) + if test "$ac_cv_have_decl_copysignl" = yes; then + dnl Test whether copysignl() can be used without libm. + AC_CACHE_CHECK([whether copysignl can be used without linking with libm], + [gl_cv_func_copysignl_no_libm], + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h> + long double x, y;]], + [[return copysignl (x, y) < 0;]])], + [gl_cv_func_copysignl_no_libm=yes], + [gl_cv_func_copysignl_no_libm=no]) + ]) + if test $gl_cv_func_copysignl_no_libm = yes; then + AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1], + [Define if the copysignl function is declared in <math.h> and available in libc.]) + fi + fi fi - fi - fi - fi - fi + ;; + esac + ;; + esac ]) AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[ @@ -141,14 +170,15 @@ double m0d = -p0d; /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. So we use another constant expression instead. But that expression does not work on other platforms, such as when - cross-compiling to PowerPC on MacOS X 10.5. */ + cross-compiling to PowerPC on Mac OS X 10.5. */ long double p0l = 0.0L; #if defined __hpux || defined __sgi long double m0l = -LDBL_MIN * LDBL_MIN; #else long double m0l = -p0l; #endif - if (signbit (vf)) + int result = 0; + if (signbit (vf)) /* link check */ vf++; { float plus_inf = 1.0f / p0f; @@ -159,9 +189,9 @@ long double m0l = -p0l; && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) && !signbit (plus_inf) && signbit (minus_inf))) - return 1; + result |= 1; } - if (signbit (vd)) + if (signbit (vd)) /* link check */ vd++; { double plus_inf = 1.0 / p0d; @@ -172,22 +202,27 @@ long double m0l = -p0l; && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) && !signbit (plus_inf) && signbit (minus_inf))) - return 1; + result |= 2; } - if (signbit (vl)) + if (signbit (vl)) /* link check */ vl++; { long double plus_inf = 1.0L / p0l; long double minus_inf = -1.0L / p0l; - if (!(!signbit (255.0L) - && signbit (-255.0L) - && !signbit (p0l) - && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)) - && !signbit (plus_inf) - && signbit (minus_inf))) - return 1; + if (signbit (255.0L)) + result |= 4; + if (!signbit (-255.0L)) + result |= 4; + if (signbit (p0l)) + result |= 8; + if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))) + result |= 16; + if (signbit (plus_inf)) + result |= 32; + if (!signbit (minus_inf)) + result |= 64; } - return 0; + return result; } ]]) @@ -211,7 +246,8 @@ AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION], AC_CACHE_CHECK([where to find the sign bit in a '$1'], [$2], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stddef.h> #include <stdio.h> #define NWORDS \ @@ -236,7 +272,7 @@ int main () { /* More than one bit difference. */ fprintf (fp, "unknown"); - return 1; + return 2; } if (x) { @@ -248,7 +284,7 @@ int main () { /* No difference. */ fprintf (fp, "unknown"); - return 1; + return 3; } /* Now m = plus.word[k] ^ ~minus.word[k]. */ if (plus.word[k] & ~minus.word[k]) @@ -256,15 +292,17 @@ int main () /* Oh? The sign bit is set in the positive and cleared in the negative numbers? */ fprintf (fp, "unknown"); - return 1; + return 4; } for (i = 0; ; i++) if ((m >> i) & 1) break; fprintf (fp, "word %d bit %d", (int) k, (int) i); - return (fclose (fp) != 0); + if (fclose (fp) != 0) + return 5; + return 0; } - ], + ]])], [$2=`cat conftest.out`], [$2="unknown"], [ @@ -285,3 +323,43 @@ int main () ;; esac ]) + +# Expands to code that defines a function signbitf(float). +# It extracts the sign bit of a non-NaN value. +AC_DEFUN([gl_FLOAT_SIGNBIT_CODE], +[ + gl_FLOATTYPE_SIGNBIT_CODE([float], [f], [f]) +]) + +# Expands to code that defines a function signbitd(double). +# It extracts the sign bit of a non-NaN value. +AC_DEFUN([gl_DOUBLE_SIGNBIT_CODE], +[ + gl_FLOATTYPE_SIGNBIT_CODE([double], [d], []) +]) + +# Expands to code that defines a function signbitl(long double). +# It extracts the sign bit of a non-NaN value. +AC_DEFUN([gl_LONG_DOUBLE_SIGNBIT_CODE], +[ + gl_FLOATTYPE_SIGNBIT_CODE([long double], [l], [L]) +]) + +AC_DEFUN([gl_FLOATTYPE_SIGNBIT_CODE], +[[ +static int +signbit$2 ($1 value) +{ + typedef union { $1 f; unsigned char b[sizeof ($1)]; } float_union; + static float_union plus_one = { 1.0$3 }; /* unused bits are zero here */ + static float_union minus_one = { -1.0$3 }; /* unused bits are zero here */ + /* Compute the sign bit mask as the XOR of plus_one and minus_one. */ + float_union u; + unsigned int i; + u.f = value; + for (i = 0; i < sizeof ($1); i++) + if (u.b[i] & (plus_one.b[i] ^ minus_one.b[i])) + return 1; + return 0; +} +]]) diff --git a/gnulib-m4/size_max.m4 b/gnulib-m4/size_max.m4 index ce992db..186e3fd 100644 --- a/gnulib-m4/size_max.m4 +++ b/gnulib-m4/size_max.m4 @@ -1,5 +1,5 @@ -# size_max.m4 serial 9 -dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc. +# size_max.m4 serial 10 +dnl Copyright (C) 2003, 2005-2006, 2008-2015 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. @@ -34,10 +34,14 @@ Found it if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. - AC_TRY_COMPILE([#include <stddef.h> - extern size_t foo; - extern unsigned long foo; - ], [], [fits_in_uint=0]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + ]], + [[]])], + [fits_in_uint=0]) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we diff --git a/gnulib-m4/ssize_t.m4 b/gnulib-m4/ssize_t.m4 new file mode 100644 index 0000000..25bd451 --- /dev/null +++ b/gnulib-m4/ssize_t.m4 @@ -0,0 +1,23 @@ +# ssize_t.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2001-2003, 2006, 2010-2015 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 Test whether ssize_t is defined. + +AC_DEFUN([gt_TYPE_SSIZE_T], +[ + AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h>]], + [[int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x;]])], + [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) + if test $gt_cv_ssize_t = no; then + AC_DEFINE([ssize_t], [int], + [Define as a signed type of the same size as size_t.]) + fi +]) diff --git a/gnulib-m4/stdalign.m4 b/gnulib-m4/stdalign.m4 new file mode 100644 index 0000000..033b0d3 --- /dev/null +++ b/gnulib-m4/stdalign.m4 @@ -0,0 +1,57 @@ +# Check for stdalign.h that conforms to C11. + +dnl Copyright 2011-2015 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. + +# Prepare for substituting <stdalign.h> if it is not supported. + +AC_DEFUN([gl_STDALIGN_H], +[ + AC_CACHE_CHECK([for working stdalign.h], + [gl_cv_header_working_stdalign_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdalign.h> + #include <stddef.h> + + /* Test that alignof yields a result consistent with offsetof. + This catches GCC bug 52023 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ + #ifdef __cplusplus + template <class t> struct alignof_helper { char a; t b; }; + # define ao(type) offsetof (alignof_helper<type>, b) + #else + # define ao(type) offsetof (struct { char a; type b; }, b) + #endif + char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; + char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; + char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + ((defined __cplusplus && 201103 <= __cplusplus) \ + || (defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__) \ + || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \ + || __ICC || 0x5110 <= __SUNPRO_C \ + || 1300 <= _MSC_VER) + struct alignas_test { char c; char alignas (8) alignas_8; }; + char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 + ? 1 : -1]; + #endif + ]])], + [gl_cv_header_working_stdalign_h=yes], + [gl_cv_header_working_stdalign_h=no])]) + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + AC_SUBST([STDALIGN_H]) + AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +]) diff --git a/gnulib-m4/stdbool.m4 b/gnulib-m4/stdbool.m4 index 3d672d7..7273b82 100644 --- a/gnulib-m4/stdbool.m4 +++ b/gnulib-m4/stdbool.m4 @@ -1,15 +1,17 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2015 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. +#serial 5 + # Prepare for substituting <stdbool.h> if it is not supported. AC_DEFUN([AM_STDBOOL_H], [ - AC_REQUIRE([AC_HEADER_STDBOOL]) + AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) # Define two additional variables used in the Makefile substitution. @@ -19,6 +21,7 @@ AC_DEFUN([AM_STDBOOL_H], STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) + AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 @@ -31,85 +34,67 @@ AC_DEFUN([AM_STDBOOL_H], # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) -# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf -# have this macro built-in. +# This version of the macro is needed in autoconf <= 2.68. -AC_DEFUN([AC_HEADER_STDBOOL], +AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], - [AC_TRY_COMPILE( - [ - #include <stdbool.h> - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include <stdbool.h> + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif - struct s { _Bool s: 1; _Bool t; } s; + struct s { _Bool s: 1; _Bool t; } s; - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - #if defined __xlc__ || defined __GNUC__ - /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 - reported by James Lemley on 2005-10-05; see - http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html - This test is not quite right, since xlc is allowed to - reject this program, as the initializer for xlcbug is - not one of the forms that C requires support for. - However, doing the test right would require a run-time - test, and that would make cross-compilation harder. - Let us hope that IBM fixes the xlc bug, and also adds - support for this kind of constant expression. In the - meantime, this test will reject xlc, which is OK, since - our stdbool.h substitute should suffice. We also test - this with GCC, where it should work, to detect more - quickly whether someone messes up the test in the - future. */ - char digs[] = "0123456789"; - int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); - #endif - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; - ], - [ - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - ], + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + ]], + [[ + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + ]])], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) - if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) - fi]) +]) diff --git a/gnulib-m4/stddef_h.m4 b/gnulib-m4/stddef_h.m4 index c3ae569..2310502 100644 --- a/gnulib-m4/stddef_h.m4 +++ b/gnulib-m4/stddef_h.m4 @@ -1,6 +1,6 @@ -dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues. -# stddef_h.m4 serial 2 -dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. +dnl A placeholder for <stddef.h>, for platforms that have issues. +# stddef_h.m4 serial 5 +dnl Copyright (C) 2009-2015 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. @@ -9,6 +9,10 @@ AC_DEFUN([gl_STDDEF_H], [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) + STDDEF_H= + AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h], + [[#include <stddef.h> + ]]) if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -24,8 +28,10 @@ AC_DEFUN([gl_STDDEF_H], REPLACE_NULL=1 STDDEF_H=stddef.h fi + AC_SUBST([STDDEF_H]) + AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) if test -n "$STDDEF_H"; then - gl_CHECK_NEXT_HEADERS([stddef.h]) + gl_NEXT_HEADERS([stddef.h]) fi ]) @@ -40,6 +46,6 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) + HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T]) HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) - STDDEF_H=''; AC_SUBST([STDDEF_H]) ]) diff --git a/gnulib-m4/stdint.m4 b/gnulib-m4/stdint.m4 index 1cc57e6..4011a49 100644 --- a/gnulib-m4/stdint.m4 +++ b/gnulib-m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 34 -dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. +# stdint.m4 serial 43 +dnl Copyright (C) 2001-2015 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,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Bruno Haible. dnl Test whether <stdint.h> is supported or must be substituted. -AC_DEFUN([gl_STDINT_H], +AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl @@ -27,6 +27,15 @@ AC_DEFUN([gl_STDINT_H], fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does. + AC_CHECK_HEADERS_ONCE([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) + dnl Check for <inttypes.h>. dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then @@ -60,8 +69,6 @@ AC_DEFUN([gl_STDINT_H], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include <stdint.h> /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ @@ -145,9 +152,11 @@ uintmax_t j = UINTMAX_MAX; #include <limits.h> /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ - ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) #define TYPE_MAXIMUM(t) \ - ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) + ((t) ((t) 0 < (t) -1 \ + ? (t) -1 \ + : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) struct s { int check_PTRDIFF: PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) @@ -208,8 +217,6 @@ struct s { dnl This detects a bug on HP-UX 11.23/ia64. AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include <stdint.h> ] @@ -259,7 +266,7 @@ static const char *macro_values[] = || strncmp (value, "((int)"/*)*/, 6) == 0 || strncmp (value, "((signed short)"/*)*/, 15) == 0 || strncmp (value, "((signed char)"/*)*/, 14) == 0) - return 1; + return mv - macro_values + 1; } return 0; ]])], @@ -290,14 +297,11 @@ static const char *macro_values[] = fi AC_SUBST([HAVE_SYS_BITYPES_H]) - dnl Check for <wchar.h> (missing in Linux uClibc when built without wide - dnl character support). - AC_CHECK_HEADERS_ONCE([wchar.h]) - gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi AC_SUBST([STDINT_H]) + AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -309,7 +313,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF], dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], - [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], @@ -334,7 +338,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF], eval BITSIZEOF_${GLTYPE}=\$result done m4_foreach_w([gltype], [$1], - [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) + [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) @@ -347,7 +351,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], - [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), + [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to 1 if ']gltype[' is a signed integer type.])]) for gltype in $1 ; do AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], @@ -367,7 +371,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], fi done m4_foreach_w([gltype], [$1], - [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) + [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) @@ -380,7 +384,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], - [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], + [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for constants of type ']gltype['.])]) for gltype in $1 ; do @@ -419,7 +423,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], - [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) + [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) ]) dnl gl_STDINT_INCLUDES @@ -458,6 +462,14 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], fi gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) + + dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 + dnl requirement that wint_t is "unchanged by default argument promotions". + dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t. + dnl Set the variable BITSIZEOF_WINT_T accordingly. + if test $BITSIZEOF_WINT_T -lt 32; then + BITSIZEOF_WINT_T=32 + fi ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. diff --git a/gnulib-m4/stdint_h.m4 b/gnulib-m4/stdint_h.m4 index b8e3c6c..5097c0b 100644 --- a/gnulib-m4/stdint_h.m4 +++ b/gnulib-m4/stdint_h.m4 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. +# stdint_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008-2015 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,12 +12,13 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], - [AC_TRY_COMPILE( - [#include <sys/types.h> -#include <stdint.h>], - [uintmax_t i = (uintmax_t) -1; return !i;], - [gl_cv_header_stdint_h=yes], - [gl_cv_header_stdint_h=no])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <stdint.h>]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_stdint_h=yes], + [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, diff --git a/gnulib-m4/stdio_h.m4 b/gnulib-m4/stdio_h.m4 new file mode 100644 index 0000000..f60cc21 --- /dev/null +++ b/gnulib-m4/stdio_h.m4 @@ -0,0 +1,221 @@ +# stdio_h.m4 serial 46 +dnl Copyright (C) 2007-2015 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_STDIO_H], +[ + dnl For __USE_MINGW_ANSI_STDIO + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_NEXT_HEADERS([stdio.h]) + + dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and + dnl inttypes.h behave like gnu instead of system; we must give our + dnl printf wrapper the right attribute to match. + AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros], + [gl_cv_func_printf_attribute_flavor], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #define __STDC_FORMAT_MACROS 1 + #include <stdio.h> + #include <inttypes.h> + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + ]])], [gl_cv_func_printf_attribute_flavor=system], + [gl_cv_func_printf_attribute_flavor=gnu])]) + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1], + [Define to 1 if printf and friends should be labeled with + attribute "__gnu_printf__" instead of "__printf__"]) + fi + + dnl No need to create extra modules for these functions. Everyone who uses + dnl <stdio.h> likely needs them. + GNULIB_FSCANF=1 + gl_MODULE_INDICATOR([fscanf]) + GNULIB_SCANF=1 + gl_MODULE_INDICATOR([scanf]) + GNULIB_FGETC=1 + GNULIB_GETC=1 + GNULIB_GETCHAR=1 + GNULIB_FGETS=1 + GNULIB_FREAD=1 + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_READ_FUNCS=1 + AC_LIBOBJ([stdio-read]) + fi + ]) + + dnl No need to create extra modules for these functions. Everyone who uses + dnl <stdio.h> likely needs them. + GNULIB_FPRINTF=1 + GNULIB_PRINTF=1 + GNULIB_VFPRINTF=1 + GNULIB_VPRINTF=1 + GNULIB_FPUTC=1 + GNULIB_PUTC=1 + GNULIB_PUTCHAR=1 + GNULIB_FPUTS=1 + GNULIB_PUTS=1 + GNULIB_FWRITE=1 + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or + dnl GNULIB_SIGPIPE redundant. + m4_ifdef([gl_SIGNAL_SIGPIPE], [ + gl_SIGNAL_SIGPIPE + if test $gl_cv_header_signal_h_SIGPIPE != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) + dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" + dnl "expected source file, required through AC_LIBSOURCES, not found". It is + dnl also an optimization, to avoid performing a configure check whose result + dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING + dnl or GNULIB_NONBLOCKING redundant. + m4_ifdef([gl_NONBLOCKING_IO], [ + gl_NONBLOCKING_IO + if test $gl_cv_have_nonblocking != yes; then + REPLACE_STDIO_WRITE_FUNCS=1 + AC_LIBOBJ([stdio-write]) + fi + ]) + + 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 both C89 and C11. + gl_WARN_ON_USE_PREPARE([[#include <stdio.h> + ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen + renameat snprintf tmpfile vdprintf vsnprintf]) +]) + +AC_DEFUN([gl_STDIO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_STDIO_H_DEFAULTS], +[ + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) + GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN]) + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) + GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) + GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) + GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE]) + GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) + GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) + GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD]) + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) + GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF]) + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) + GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) + GNULIB_GETC=0; AC_SUBST([GNULIB_GETC]) + GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) + GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) + GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) + GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) + GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN]) + GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF]) + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) + GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) + GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) + GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS]) + GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE]) + GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME]) + GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT]) + GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF]) + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) + GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) + GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE]) + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF]) + GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) + GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) + GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF]) + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) + HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) + HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) + HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) + HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE]) + HAVE_POPEN=1; AC_SUBST([HAVE_POPEN]) + HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT]) + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) + REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) + REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE]) + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM]) + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) + REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) + REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) + REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN]) + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) + REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE]) + REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME]) + REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT]) + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS]) + REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) + REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE]) + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) +]) diff --git a/gnulib-m4/stdlib_h.m4 b/gnulib-m4/stdlib_h.m4 index dd84796..0b4c623 100644 --- a/gnulib-m4/stdlib_h.m4 +++ b/gnulib-m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 28 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# stdlib_h.m4 serial 42 +dnl Copyright (C) 2007-2015 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,21 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - gl_CHECK_NEXT_HEADERS([stdlib.h]) - AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT]) - if test $ac_cv_header_random_h = yes; then - HAVE_RANDOM_H=1 - else - HAVE_RANDOM_H=0 - fi - AC_SUBST([HAVE_RANDOM_H]) - AC_CHECK_TYPES([struct random_data], - [], [HAVE_STRUCT_RANDOM_DATA=0], - [[#include <stdlib.h> - #if HAVE_RANDOM_H - # include <random.h> - #endif - ]]) + gl_NEXT_HEADERS([stdlib.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 @@ -33,10 +19,11 @@ AC_DEFUN([gl_STDLIB_H], #if HAVE_RANDOM_H # include <random.h> #endif - ]], [atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp - mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r - setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt - unsetenv]) + ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps + posix_openpt ptsname ptsname_r random random_r realpath rpmatch + secure_getenv setenv setstate setstate_r srandom srandom_r + strtod strtoll strtoull unlockpt unsetenv]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -50,6 +37,7 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ + GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) @@ -57,54 +45,75 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) + GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) + GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) + GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) + GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) + GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) + GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) + GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) - HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) - HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) + HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) + HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) + HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) - HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) + HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) + HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) - HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) + HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) + REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) + REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) + REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) + REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) + REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) + REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) + REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) ]) diff --git a/gnulib-m4/strerror.m4 b/gnulib-m4/strerror.m4 index 1649b24..75a17f2 100644 --- a/gnulib-m4/strerror.m4 +++ b/gnulib-m4/strerror.m4 @@ -1,68 +1,96 @@ -# strerror.m4 serial 9 -dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc. +# strerror.m4 serial 17 +dnl Copyright (C) 2002, 2007-2015 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_STRERROR], [ - AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE]) - if test $REPLACE_STRERROR = 1; then - AC_LIBOBJ([strerror]) - AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR], - [Define this to 1 if strerror is broken.]) - fi -]) - -# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ). -AC_DEFUN([gl_FUNC_STRERROR_SEPARATE], -[ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_ERRNO_H]) - if test -z "$ERRNO_H"; then + AC_REQUIRE([gl_FUNC_STRERROR_0]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ + AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) + ]) + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then AC_CACHE_CHECK([for working strerror function], [gl_cv_func_working_strerror], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include <string.h> ]], - [[return !*strerror (-2);]])], + [[if (!*strerror (-2)) return 1;]])], [gl_cv_func_working_strerror=yes], [gl_cv_func_working_strerror=no], - [dnl Assume crossbuild works if it compiles. - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include <string.h> - ]], - [[return !*strerror (-2);]])], - [gl_cv_func_working_strerror=yes], - [gl_cv_func_working_strerror=no]) - ]) + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_working_strerror" in + *yes) ;; + *) + dnl The system's strerror() fails to return a string for out-of-range + dnl integers. Replace it. + REPLACE_STRERROR=1 + ;; + esac + m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ + dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's + dnl buffer, we must replace strerror. + case "$gl_cv_func_strerror_r_works" in + *no) REPLACE_STRERROR=1 ;; + esac ]) - if test $gl_cv_func_working_strerror = no; then - dnl The system's strerror() fails to return a string for out-of-range - dnl integers. Replace it. - REPLACE_STRERROR=1 - fi else dnl The system's strerror() cannot know about the new errno values we add - dnl to <errno.h>. Replace it. + dnl to <errno.h>, or any fix for strerror(0). Replace it. REPLACE_STRERROR=1 fi - if test $REPLACE_STRERROR = 1; then - gl_PREREQ_STRERROR - fi ]) -# Prerequisites of lib/strerror.c. -AC_DEFUN([gl_PREREQ_STRERROR], [ - AC_CHECK_DECLS([strerror]) - AC_CHECK_HEADERS_ONCE([sys/socket.h]) - if test $ac_cv_header_sys_socket_h != yes; then - dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make - dnl the check for those headers unconditional; yet cygwin reports - dnl that the headers are present but cannot be compiled (since on - dnl cygwin, all socket information should come from sys/socket.h). - AC_CHECK_HEADERS([winsock2.h]) - fi +dnl Detect if strerror(0) passes (that is, does not set errno, and does not +dnl return a string that matches strerror(-1)). +AC_DEFUN([gl_FUNC_STRERROR_0], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + REPLACE_STRERROR_0=0 + AC_CACHE_CHECK([whether strerror(0) succeeds], + [gl_cv_func_strerror_0_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <string.h> + #include <errno.h> + ]], + [[int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result;]])], + [gl_cv_func_strerror_0_works=yes], + [gl_cv_func_strerror_0_works=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 + AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0) + does not return a message implying success.]) + ;; + esac ]) diff --git a/gnulib-m4/string_h.m4 b/gnulib-m4/string_h.m4 index 1977aec..55d09ef 100644 --- a/gnulib-m4/string_h.m4 +++ b/gnulib-m4/string_h.m4 @@ -1,11 +1,11 @@ # Configure a GNU-like replacement for <string.h>. -# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# Copyright (C) 2007-2015 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. -# serial 17 +# serial 21 # Written by Paul Eggert. @@ -20,16 +20,16 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - gl_CHECK_NEXT_HEADERS([string.h]) + gl_NEXT_HEADERS([string.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 <string.h> ]], - [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup - strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal - strverscmp]) + [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul + strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r + strerror_r strsignal strverscmp]) ]) AC_DEFUN([gl_STRING_MODULE_INDICATOR], @@ -43,6 +43,8 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR], AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ + GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) + GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) @@ -75,10 +77,13 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) + HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) @@ -94,6 +99,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) + HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) @@ -102,7 +108,9 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) + REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) diff --git a/gnulib-m4/strncat.m4 b/gnulib-m4/strncat.m4 index e4ff70e..ba461e4 100644 --- a/gnulib-m4/strncat.m4 +++ b/gnulib-m4/strncat.m4 @@ -1,5 +1,5 @@ -# strncat.m4 serial 1 -dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc. +# strncat.m4 serial 2 +dnl Copyright (C) 2002-2004, 2009-2015 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. @@ -92,11 +92,7 @@ AC_DEFUN_ONCE([gl_FUNC_STRNCAT], ]) case "$gl_cv_func_strncat_works" in *yes) ;; - *) - REPLACE_STRNCAT=1 - AC_LIBOBJ([strncat]) - gl_PREREQ_STRNCAT - ;; + *) REPLACE_STRNCAT=1 ;; esac ]) diff --git a/gnulib-m4/strstr.m4 b/gnulib-m4/strstr.m4 new file mode 100644 index 0000000..040c0b9 --- /dev/null +++ b/gnulib-m4/strstr.m4 @@ -0,0 +1,130 @@ +# strstr.m4 serial 16 +dnl Copyright (C) 2008-2015 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 Check that strstr works. +AC_DEFUN([gl_FUNC_STRSTR_SIMPLE], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MEMCHR]) + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_STRSTR=1 + else + dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092. + AC_CACHE_CHECK([whether strstr works], + [gl_cv_func_strstr_works_always], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <string.h> /* for strstr */ +#define P "_EF_BF_BD" +#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P +#define NEEDLE P P P P P +]], [[return !!strstr (HAYSTACK, NEEDLE); + ]])], + [gl_cv_func_strstr_works_always=yes], + [gl_cv_func_strstr_works_always=no], + [dnl glibc 2.12 and cygwin 1.7.7 have a known bug. uClibc is not + dnl affected, since it uses different source code for strstr than + dnl glibc. + dnl Assume that it works on all other platforms, even if it is not + dnl linear. + AC_EGREP_CPP([Lucky user], + [ +#ifdef __GNU_LIBRARY__ + #include <features.h> + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ + || defined __UCLIBC__ + Lucky user + #endif +#elif defined __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + Lucky user + #endif +#else + Lucky user +#endif + ], + [gl_cv_func_strstr_works_always="guessing yes"], + [gl_cv_func_strstr_works_always="guessing no"]) + ]) + ]) + case "$gl_cv_func_strstr_works_always" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac + fi +]) # gl_FUNC_STRSTR_SIMPLE + +dnl Additionally, check that strstr is efficient. +AC_DEFUN([gl_FUNC_STRSTR], +[ + AC_REQUIRE([gl_FUNC_STRSTR_SIMPLE]) + if test $REPLACE_STRSTR = 0; then + AC_CACHE_CHECK([whether strstr works in linear time], + [gl_cv_func_strstr_linear], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <signal.h> /* for signal */ +#include <string.h> /* for strstr */ +#include <stdlib.h> /* for malloc */ +#include <unistd.h> /* for alarm */ +static void quit (int sig) { exit (sig + 128); } +]], [[ + int result = 0; + size_t m = 1000000; + char *haystack = (char *) malloc (2 * m + 2); + char *needle = (char *) malloc (m + 2); + /* Failure to compile this test due to missing alarm is okay, + since all such platforms (mingw) also have quadratic strstr. */ + signal (SIGALRM, quit); + alarm (5); + /* Check for quadratic performance. */ + if (haystack && needle) + { + memset (haystack, 'A', 2 * m); + haystack[2 * m] = 'B'; + haystack[2 * m + 1] = 0; + memset (needle, 'A', m); + needle[m] = 'B'; + needle[m + 1] = 0; + if (!strstr (haystack, needle)) + result |= 1; + } + return result; + ]])], + [gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no], + [dnl Only glibc > 2.12 on processors without SSE 4.2 instructions and + dnl cygwin > 1.7.7 are known to have a bug-free strstr that works in + dnl linear time. + AC_EGREP_CPP([Lucky user], + [ +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ + && !(defined __i386__ || defined __x86_64__) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif +#ifdef __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) + Lucky user + #endif +#endif + ], + [gl_cv_func_strstr_linear="guessing yes"], + [gl_cv_func_strstr_linear="guessing no"]) + ]) + ]) + case "$gl_cv_func_strstr_linear" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac + fi +]) # gl_FUNC_STRSTR diff --git a/gnulib-m4/sys_socket_h.m4 b/gnulib-m4/sys_socket_h.m4 new file mode 100644 index 0000000..eaeabe7 --- /dev/null +++ b/gnulib-m4/sys_socket_h.m4 @@ -0,0 +1,176 @@ +# sys_socket_h.m4 serial 23 +dnl Copyright (C) 2005-2015 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 Simon Josefsson. + +AC_DEFUN([gl_HEADER_SYS_SOCKET], +[ + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have + dnl old-style declarations (with return type 'int' instead of 'ssize_t') + dnl unless _POSIX_PII_SOCKET is defined. + case "$host_os" in + osf*) + AC_DEFINE([_POSIX_PII_SOCKET], [1], + [Define to 1 in order to get the POSIX compatible declarations + of socket functions.]) + ;; + esac + + AC_CACHE_CHECK([whether <sys/socket.h> is self-contained], + [gl_cv_header_sys_socket_h_selfcontained], + [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])], + [gl_cv_header_sys_socket_h_selfcontained=yes], + [gl_cv_header_sys_socket_h_selfcontained=no]) + ]) + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + dnl If the shutdown function exists, <sys/socket.h> should define + dnl SHUT_RD, SHUT_WR, SHUT_RDWR. + AC_CHECK_FUNCS([shutdown]) + if test $ac_cv_func_shutdown = yes; then + AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros], + [gl_cv_header_sys_socket_h_shut], + [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <sys/socket.h>]], + [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])], + [gl_cv_header_sys_socket_h_shut=yes], + [gl_cv_header_sys_socket_h_shut=no]) + ]) + if test $gl_cv_header_sys_socket_h_shut = no; then + SYS_SOCKET_H='sys/socket.h' + fi + fi + fi + # We need to check for ws2tcpip.h now. + gl_PREREQ_SYS_H_SOCKET + AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +]) + if test $ac_cv_type_struct_sockaddr_storage = no; then + HAVE_STRUCT_SOCKADDR_STORAGE=0 + fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], + [], + [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0], + [#include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif + #ifdef HAVE_WS2TCPIP_H + #include <ws2tcpip.h> + #endif + ]) + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi + gl_PREREQ_SYS_H_WINSOCK2 + + 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([[ +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#include <sys/socket.h> + ]], [socket connect accept bind getpeername getsockname getsockopt + listen recv send recvfrom sendto setsockopt shutdown accept4]) +]) + +AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], +[ + dnl Check prerequisites of the <sys/socket.h> replacement. + AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) + gl_CHECK_NEXT_HEADERS([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + AC_SUBST([HAVE_SYS_SOCKET_H]) + AC_SUBST([HAVE_WS2TCPIP_H]) +]) + +# Common prerequisites of the <sys/socket.h> replacement and of the +# <sys/select.h> replacement. +# Sets and substitutes HAVE_WINSOCK2_H. +AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2], +[ + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h != yes; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([winsock2.h]) + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + AC_SUBST([HAVE_WINSOCK2_H]) +]) + +AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], +[ + GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET]) + GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT]) + GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT]) + GNULIB_BIND=0; AC_SUBST([GNULIB_BIND]) + GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME]) + GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME]) + GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT]) + GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN]) + GNULIB_RECV=0; AC_SUBST([GNULIB_RECV]) + GNULIB_SEND=0; AC_SUBST([GNULIB_SEND]) + GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM]) + GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) + GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) + GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) + GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) + HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) + HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) + HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) +]) diff --git a/gnulib-m4/sys_types_h.m4 b/gnulib-m4/sys_types_h.m4 new file mode 100644 index 0000000..2232aec --- /dev/null +++ b/gnulib-m4/sys_types_h.m4 @@ -0,0 +1,24 @@ +# sys_types_h.m4 serial 5 +dnl Copyright (C) 2011-2015 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_ONCE([gl_SYS_TYPES_H], +[ + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) + gl_NEXT_HEADERS([sys/types.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Whether to override the 'off_t' type. + AC_REQUIRE([gl_TYPE_OFF_T]) +]) + +AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], +[ +]) diff --git a/gnulib-m4/thread.m4 b/gnulib-m4/thread.m4 index 8e79075..5945126 100644 --- a/gnulib-m4/thread.m4 +++ b/gnulib-m4/thread.m4 @@ -1,5 +1,5 @@ -# thread.m4 serial 2 -dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +# thread.m4 serial 3 +dnl Copyright (C) 2008-2015 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,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_THREAD], [ AC_REQUIRE([gl_THREADLIB]) - AC_REQUIRE([AC_C_INLINE]) if test $gl_threads_api = posix; then gl_save_LIBS="$LIBS" diff --git a/gnulib-m4/threadlib.m4 b/gnulib-m4/threadlib.m4 index 05cc4ff..8615ac9 100644 --- a/gnulib-m4/threadlib.m4 +++ b/gnulib-m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. +# threadlib.m4 serial 11 (gettext-0.18.2) +dnl Copyright (C) 2005-2015 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. @@ -9,15 +9,20 @@ dnl From Bruno Haible. dnl gl_THREADLIB dnl ------------ dnl Tests for a multithreading library to be used. +dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO +dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the +dnl default is 'no', otherwise it is system dependent. In both cases, the user +dnl can change the choice through the options --enable-threads=choice or +dnl --disable-threads. dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, -dnl USE_PTH_THREADS, USE_WIN32_THREADS +dnl USE_PTH_THREADS, USE_WINDOWS_THREADS dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl programs that really need multithread functionality. The difference dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak -dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". +dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not. dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. @@ -44,10 +49,12 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) dnl Check for multithreading. - m4_divert_text([DEFAULTS], [gl_use_threads_default=]) + m4_ifdef([gl_THREADLIB_DEFAULT_NO], + [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])], + [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) AC_ARG_ENABLE([threads], -AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) -AC_HELP_STRING([--disable-threads], [build without multithread safety]), +AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ +AC_HELP_STRING([--disable-threads], [build without multithread safety])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" @@ -80,7 +87,7 @@ changequote([,])dnl # groks <pthread.h>. cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker - # causes the AC_TRY_LINK test below to succeed unexpectedly, + # causes the AC_LINK_IFELSE test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; @@ -111,18 +118,25 @@ AC_DEFUN([gl_THREADLIB_BODY], [gl_cv_have_weak], [gl_cv_have_weak=no dnl First, test whether the compiler accepts it syntactically. - AC_TRY_LINK([extern void xyzzy (); -#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=maybe]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern void xyzzy (); +#pragma weak xyzzy]], + [[xyzzy();]])], + [gl_cv_have_weak=maybe]) if test $gl_cv_have_weak = maybe; then dnl Second, test whether it actually works. On Cygwin 1.7.2, with dnl gcc 4.3, symbols declared weak always evaluate to the address 0. - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <stdio.h> #pragma weak fputs int main () { return (fputs == NULL); -}], [gl_cv_have_weak=yes], [gl_cv_have_weak=no], +}]])], + [gl_cv_have_weak=yes], + [gl_cv_have_weak=no], [dnl When cross-compiling, assume that only ELF platforms support dnl weak symbols. AC_EGREP_CPP([Extensible Linking Format], @@ -148,13 +162,31 @@ int main () # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. - AC_TRY_LINK([#include <pthread.h>], - [pthread_mutex_lock((pthread_mutex_t*)0); - pthread_mutexattr_init((pthread_mutexattr_t*)0);], - [gl_have_pthread=yes]) + # + # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 + # needs -pthread for some reason. See: + # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html + save_LIBS=$LIBS + for gl_pthread in '' '-pthread'; do + LIBS="$LIBS $gl_pthread" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <pthread.h> + pthread_mutex_t m; + pthread_mutexattr_t ma; + ]], + [[pthread_mutex_lock (&m); + pthread_mutexattr_init (&ma);]])], + [gl_have_pthread=yes + LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread + LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread]) + LIBS=$save_LIBS + test -n "$gl_have_pthread" && break + done + # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) - if test -n "$gl_have_pthread"; then + if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB([pthread], [pthread_kill], @@ -169,7 +201,7 @@ int main () [Define if the pthread_in_use() detection is hard.]) esac ]) - else + elif test -z "$gl_have_pthread"; then # Some library is needed. Try libpthread and libc_r. AC_CHECK_LIB([pthread], [pthread_kill], [gl_have_pthread=yes @@ -203,9 +235,13 @@ int main () gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" - AC_TRY_LINK([#include <thread.h> -#include <synch.h>], - [thr_self();], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <thread.h> +#include <synch.h> + ]], + [[thr_self();]])], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then @@ -230,8 +266,10 @@ int main () AC_LIB_LINKFLAGS([pth]) gl_have_pth= gl_save_LIBS="$LIBS" - LIBS="$LIBS -lpth" - AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes]) + LIBS="$LIBS $LIBPTH" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])], + [gl_have_pth=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth @@ -254,17 +292,19 @@ int main () fi fi if test -z "$gl_have_pthread"; then - if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then - if { case "$host_os" in - mingw*) true;; - *) false;; - esac - }; then - gl_threads_api=win32 - AC_DEFINE([USE_WIN32_THREADS], [1], - [Define if the Win32 multithreading API can be used.]) - fi - fi + case "$gl_use_threads" in + yes | windows | win32) # The 'win32' is for backward compatibility. + if { case "$host_os" in + mingw*) true;; + *) false;; + esac + }; then + gl_threads_api=windows + AC_DEFINE([USE_WINDOWS_THREADS], [1], + [Define if the native Windows multithreading API can be used.]) + fi + ;; + esac fi fi AC_MSG_CHECKING([for multithread API to use]) @@ -295,50 +335,52 @@ AC_DEFUN([gl_DISABLE_THREADS], [ dnl Survey of platforms: dnl -dnl Platform Available Compiler Supports test-lock -dnl flavours option weak result -dnl --------------- --------- --------- -------- --------- -dnl Linux 2.4/glibc posix -lpthread Y OK +dnl Platform Available Compiler Supports test-lock +dnl flavours option weak result +dnl --------------- --------- --------- -------- --------- +dnl Linux 2.4/glibc posix -lpthread Y OK +dnl +dnl GNU Hurd/glibc posix dnl -dnl GNU Hurd/glibc posix +dnl Ubuntu 14.04 posix -pthread Y OK dnl -dnl FreeBSD 5.3 posix -lc_r Y -dnl posix -lkse ? Y -dnl posix -lpthread ? Y -dnl posix -lthr Y +dnl FreeBSD 5.3 posix -lc_r Y +dnl posix -lkse ? Y +dnl posix -lpthread ? Y +dnl posix -lthr Y dnl -dnl FreeBSD 5.2 posix -lc_r Y -dnl posix -lkse Y -dnl posix -lthr Y +dnl FreeBSD 5.2 posix -lc_r Y +dnl posix -lkse Y +dnl posix -lthr Y dnl -dnl FreeBSD 4.0,4.10 posix -lc_r Y OK +dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl -dnl NetBSD 1.6 -- +dnl NetBSD 1.6 -- dnl -dnl OpenBSD 3.4 posix -lpthread Y OK +dnl OpenBSD 3.4 posix -lpthread Y OK dnl -dnl MacOS X 10.[123] posix -lpthread Y OK +dnl Mac OS X 10.[123] posix -lpthread Y OK dnl -dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK -dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK +dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK +dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl -dnl HP-UX 11 posix -lpthread N (cc) OK +dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl -dnl IRIX 6.5 posix -lpthread Y 0.5 +dnl IRIX 6.5 posix -lpthread Y 0.5 dnl -dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK +dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl -dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK +dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK dnl -lpthread (gcc) Y dnl -dnl Cygwin posix -lpthread Y OK +dnl Cygwin posix -lpthread Y OK dnl -dnl Any of the above pth -lpth 0.0 +dnl Any of the above pth -lpth 0.0 dnl -dnl Mingw win32 N OK +dnl Mingw windows N OK dnl -dnl BeOS 5 -- +dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: diff --git a/gnulib-m4/unistd_h.m4 b/gnulib-m4/unistd_h.m4 index b26d0a9..b3c581f 100644 --- a/gnulib-m4/unistd_h.m4 +++ b/gnulib-m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 46 -dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. +# unistd_h.m4 serial 68 +dnl Copyright (C) 2006-2015 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,11 +11,8 @@ AC_DEFUN([gl_UNISTD_H], dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) - AC_REQUIRE([AC_C_INLINE]) gl_CHECK_NEXT_HEADERS([unistd.h]) - - AC_CHECK_HEADERS_ONCE([unistd.h]) if test $ac_cv_header_unistd_h = yes; then HAVE_UNISTD_H=1 else @@ -23,11 +20,20 @@ AC_DEFUN([gl_UNISTD_H], fi AC_SUBST([HAVE_UNISTD_H]) + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Determine WINDOWS_64_BIT_OFF_T. + AC_REQUIRE([gl_TYPE_OFF_T]) + 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 <unistd.h> + gl_WARN_ON_USE_PREPARE([[ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif /* Some systems declare various items in the wrong headers. */ -#ifndef __GLIBC__ +#if !(defined __GLIBC__ && !defined __UCLIBC__) # include <fcntl.h> # include <stdio.h> # include <stdlib.h> @@ -35,11 +41,13 @@ AC_DEFUN([gl_UNISTD_H], # include <io.h> # endif #endif - ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat - fsync ftruncate getcwd getdomainname getdtablesize getgroups - gethostname getlogin getlogin_r getpagesize getusershell setusershell - endusershell lchown link linkat lseek pipe2 pread readlink readlinkat - rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep]) + ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat + fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups + gethostname getlogin getlogin_r getpagesize + getusershell setusershell endusershell + group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite + readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r + unlink unlinkat usleep]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -53,45 +61,54 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ - GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) - GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) - GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) - GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) - GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) - GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) - GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) - GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) - GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) - GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) - GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) - GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) - GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) - GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) - GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) - GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) - GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) - GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) - GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) - GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) - GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) - GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) - GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) - GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) - GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) - GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) - GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) - GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) - GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) - GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) - GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) - GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) - GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) - GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) - GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) - GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) - GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) - GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) - GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) + GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) + GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) + GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) + GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) + GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) + GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) + GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) + GNULIB_READ=0; AC_SUBST([GNULIB_READ]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) + GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) + GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) + GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) + GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) + GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) + GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) + GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) @@ -100,31 +117,39 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) + HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) - HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) + HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) + HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) + HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) - HAVE_TTYNAME_R=1; AC_SUBST([HAVE_TTYNAME_R]) HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) + HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) + HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) + HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) @@ -132,18 +157,27 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) + REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) + REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) + REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) + REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) + REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) + REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) + REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) diff --git a/gnulib-m4/vasnprintf.m4 b/gnulib-m4/vasnprintf.m4 index ebe3c52..4708f2b 100644 --- a/gnulib-m4/vasnprintf.m4 +++ b/gnulib-m4/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 31 -dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc. +# vasnprintf.m4 serial 36 +dnl Copyright (C) 2002-2004, 2006-2015 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,7 +29,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], gl_PREREQ_ASNPRINTF ]) -# Prequisites of lib/printf-args.h, lib/printf-args.c. +# Prerequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -37,9 +37,10 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS], AC_REQUIRE([gt_TYPE_WINT_T]) ]) -# Prequisites of lib/printf-parse.h, lib/printf-parse.c. +# Prerequisites of lib/printf-parse.h, lib/printf-parse.c. AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ + AC_REQUIRE([gl_FEATURES_H]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) @@ -54,7 +55,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE], # Prerequisites of lib/vasnprintf.c. AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], [ - AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) @@ -62,7 +62,10 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). - AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) + AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]]) + dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization + dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE. + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) dnl We can avoid a lot of code by assuming that snprintf's return value dnl conforms to ISO C99. So check that. AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) diff --git a/gnulib-m4/warn-on-use.m4 b/gnulib-m4/warn-on-use.m4 index 42daae8..1e98dc9 100644 --- a/gnulib-m4/warn-on-use.m4 +++ b/gnulib-m4/warn-on-use.m4 @@ -1,5 +1,5 @@ -# warn-on-use.m4 serial 2 -dnl Copyright (C) 2010 Free Software Foundation, Inc. +# warn-on-use.m4 serial 5 +dnl Copyright (C) 2010-2015 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. @@ -18,8 +18,8 @@ dnl with or without modifications, as long as this notice is preserved. # some systems declare functions in the wrong header, then INCLUDES # should do likewise. # -# If you assume C89, then it is generally safe to assume declarations -# for functions declared in that standard (such as gets) without +# It is generally safe to assume declarations for functions declared +# in the intersection of C89 and C11 (such as printf) without # needing gl_WARN_ON_USE_PREPARE. AC_DEFUN([gl_WARN_ON_USE_PREPARE], [ @@ -27,6 +27,8 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl +dnl FIXME: gl_Symbol must be used unquoted until we can assume +dnl autoconf 2.64 or newer. for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AC_CACHE_CHECK([whether $gl_func is declared without a macro], @@ -35,8 +37,8 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [@%:@undef $gl_func (void) $gl_func;])], [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) - AS_VAR_IF(gl_Symbol, [yes], - [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) + AS_VAR_IF(gl_Symbol, [yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl shortcut - if the raw declaration exists, then set a cache dnl variable to allow skipping any later AC_CHECK_DECL efforts eval ac_cv_have_decl_$gl_func=yes]) diff --git a/gnulib-m4/wchar_h.m4 b/gnulib-m4/wchar_h.m4 index 8cae82d..9d1b0f8 100644 --- a/gnulib-m4/wchar_h.m4 +++ b/gnulib-m4/wchar_h.m4 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2015 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 Eric Blake. -# wchar_h.m4 serial 33 +# wchar_h.m4 serial 39 AC_DEFUN([gl_WCHAR_H], [ @@ -17,7 +17,6 @@ AC_DEFUN([gl_WCHAR_H], dnl Check for <wchar.h> (missing in Linux uClibc when built without wide dnl character support). dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK. - AC_CHECK_HEADERS_ONCE([wchar.h]) gl_CHECK_NEXT_HEADERS([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 @@ -26,6 +25,8 @@ AC_DEFUN([gl_WCHAR_H], fi AC_SUBST([HAVE_WCHAR_H]) + AC_REQUIRE([gl_FEATURES_H]) + AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 @@ -37,15 +38,23 @@ AC_DEFUN([gl_WCHAR_H], 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([[ -/* Some systems require additional headers. */ -#ifndef __GLIBC__ +/* 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>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) # include <stddef.h> # include <stdio.h> # include <time.h> #endif #include <wchar.h> - ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb - wcsrtombs wcsnrtombs wcwidth]) + ]], + [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp + wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr + wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth + ]) ]) dnl Check whether <wchar.h> is usable at all. @@ -61,6 +70,13 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK], [gl_cv_header_wchar_h_correct_inline=yes AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* 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> extern int zero (void); int main () { return zero(); } @@ -69,6 +85,13 @@ int main () { return zero(); } mv conftest.$ac_objext conftest1.$ac_objext AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod +/* 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 zero (void) { return 0; } ]])]) @@ -96,13 +119,6 @@ Configuration aborted.]) fi ]) -dnl Unconditionally enables the replacement of <wchar.h>. -AC_DEFUN([gl_REPLACE_WCHAR_H], -[ - dnl This is a no-op, because <wchar.h> is always overridden. - : -]) - AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. @@ -114,17 +130,45 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ - GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) - GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) - GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) - GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) - GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) - GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) - GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) - GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) - GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) - GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) - GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) + GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) + GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) + GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) + GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) + GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) + GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) + GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) + GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) + GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) + GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) + GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) + GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) + GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) + GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) + GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) + GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) + GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) + GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) + GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) + GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) + GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) + GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) + GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) + GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) + GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) + GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) + GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) + GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) + GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) + GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) + GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) + GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) + GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) + GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) + GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) + GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) @@ -135,6 +179,34 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) + HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) + HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) + HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) + HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) + HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) + HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) + HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) + HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) + HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) + HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) + HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) + HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) + HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) + HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) + HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) + HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) + HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) + HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) + HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) + HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) + HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) + HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) + HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) + HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) + HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) + HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) + HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) + HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) @@ -149,4 +221,5 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) + REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) ]) diff --git a/gnulib-m4/wchar_t.m4 b/gnulib-m4/wchar_t.m4 index ed804e6..dc964e6 100644 --- a/gnulib-m4/wchar_t.m4 +++ b/gnulib-m4/wchar_t.m4 @@ -1,5 +1,5 @@ -# wchar_t.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc. +# wchar_t.m4 serial 4 (gettext-0.18.2) +dnl Copyright (C) 2002-2003, 2008-2015 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,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], - [AC_TRY_COMPILE([#include <stddef.h> - wchar_t foo = (wchar_t)'\0';], , - [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stddef.h> + wchar_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wchar_t=yes], + [gt_cv_c_wchar_t=no])]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi diff --git a/gnulib-m4/wcrtomb.m4 b/gnulib-m4/wcrtomb.m4 new file mode 100644 index 0000000..7e3fe3f --- /dev/null +++ b/gnulib-m4/wcrtomb.m4 @@ -0,0 +1,112 @@ +# wcrtomb.m4 serial 11 +dnl Copyright (C) 2008-2015 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_WCRTOMB], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + + AC_CHECK_FUNCS_ONCE([wcrtomb]) + if test $ac_cv_func_wcrtomb = no; then + HAVE_WCRTOMB=0 + AC_CHECK_DECLS([wcrtomb],,, [[ +/* 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> +]]) + if test $ac_cv_have_decl_wcrtomb = yes; then + dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_WCRTOMB=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_WCRTOMB=1 + else + dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes + dnl returns 0 instead of 1. + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether wcrtomb return value is correct], + [gl_cv_func_wcrtomb_retval], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != 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 () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 1; + } + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 2; + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 4; + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + if (wcrtomb (NULL, 0, NULL) != 1) + result |= 8; + } + return result; +}]])], + [gl_cv_func_wcrtomb_retval=yes], + [gl_cv_func_wcrtomb_retval=no], + [:]) + fi + ]) + case "$gl_cv_func_wcrtomb_retval" in + *yes) ;; + *) REPLACE_WCRTOMB=1 ;; + esac + fi + fi +]) + +# Prerequisites of lib/wcrtomb.c. +AC_DEFUN([gl_PREREQ_WCRTOMB], [ + : +]) diff --git a/gnulib-m4/wctob.m4 b/gnulib-m4/wctob.m4 index 3af3cc7..501dc4a 100644 --- a/gnulib-m4/wctob.m4 +++ b/gnulib-m4/wctob.m4 @@ -1,5 +1,5 @@ -# wctob.m4 serial 5 -dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. +# wctob.m4 serial 10 +dnl Copyright (C) 2008-2015 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,11 +10,10 @@ AC_DEFUN([gl_FUNC_WCTOB], AC_CHECK_FUNCS_ONCE([wctob]) if test $ac_cv_func_wctob = no; then + HAVE_WCTOB=0 HAVE_DECL_WCTOB=0 - gl_REPLACE_WCHAR_H - AC_LIBOBJ([wctob]) - gl_PREREQ_WCTOB else + HAVE_WCTOB=1 dnl Solaris 9 has the wctob() function but it does not work. dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned @@ -38,8 +37,16 @@ changequote(,)dnl changequote([,])dnl case "$host_os" in cygwin*) - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <locale.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> register long global __asm__ ("%ebx"); @@ -54,13 +61,24 @@ int main () if (global != 0x12345678) return 2; return 0; -}], [:], [gl_cv_func_wctob_works=no], [:]) +}]])], + [:], + [gl_cv_func_wctob_works=no], + [:]) ;; esac if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then - AC_TRY_RUN([ + 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 () { @@ -73,7 +91,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_wctob_works=yes], [gl_cv_func_wctob_works=no], [:]) @@ -83,14 +101,10 @@ int main () *yes) ;; *) REPLACE_WCTOB=1 ;; esac - if test $REPLACE_WCTOB = 1; then - gl_REPLACE_WCHAR_H - AC_LIBOBJ([wctob]) - gl_PREREQ_WCTOB - else + if test $REPLACE_WCTOB = 0; then dnl IRIX 6.5 has the wctob() function but does not declare it. - AC_CHECK_DECLS([wctob], [], [], [ + AC_CHECK_DECLS([wctob], [], [], [[ /* 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 @@ -99,10 +113,9 @@ int main () #include <stdio.h> #include <time.h> #include <wchar.h> -]) +]]) if test $ac_cv_have_decl_wctob != yes; then HAVE_DECL_WCTOB=0 - gl_REPLACE_WCHAR_H fi fi fi diff --git a/gnulib-m4/wctomb.m4 b/gnulib-m4/wctomb.m4 new file mode 100644 index 0000000..05c6685 --- /dev/null +++ b/gnulib-m4/wctomb.m4 @@ -0,0 +1,19 @@ +# wctomb.m4 serial 2 +dnl Copyright (C) 2011-2015 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_WCTOMB], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + + if false; then + REPLACE_WCTOMB=1 + fi +]) + +# Prerequisites of lib/wctomb.c. +AC_DEFUN([gl_PREREQ_WCTOMB], [ + : +]) diff --git a/gnulib-m4/wctype_h.m4 b/gnulib-m4/wctype_h.m4 index 3292451..95a4705 100644 --- a/gnulib-m4/wctype_h.m4 +++ b/gnulib-m4/wctype_h.m4 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 6 +# wctype_h.m4 serial 18 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. -dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2015 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,7 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_WCTYPE_H], [ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([iswcntrl]) @@ -20,15 +21,6 @@ AC_DEFUN([gl_WCTYPE_H], HAVE_ISWCNTRL=0 fi AC_SUBST([HAVE_ISWCNTRL]) - AC_CHECK_FUNCS_ONCE([iswblank]) - if test $ac_cv_func_iswblank = yes; then - HAVE_ISWBLANK=1 - else - HAVE_ISWBLANK=0 - fi - AC_SUBST([HAVE_ISWBLANK]) - AC_CHECK_HEADERS_ONCE([wctype.h]) - AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then @@ -38,39 +30,180 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WINT_T]) + gl_CHECK_NEXT_HEADERS([wctype.h]) if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then dnl Linux libc5 has an iswprint function that returns 0 for all arguments. dnl The other functions are likely broken in the same way. AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include <stddef.h> - #include <stdio.h> - #include <time.h> - #include <wchar.h> - #include <wctype.h> - int main () { return iswprint ('x') == 0; }]])], + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + /* 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 <wctype.h> + int main () { return iswprint ('x') == 0; } + ]])], [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [])], - [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) + [gl_cv_func_iswcntrl_works="guessing yes"], + [gl_cv_func_iswcntrl_works="guessing no"]) ]) ]) fi - gl_CHECK_NEXT_HEADERS([wctype.h]) HAVE_WCTYPE_H=1 else HAVE_WCTYPE_H=0 fi AC_SUBST([HAVE_WCTYPE_H]) - if test "$gl_cv_func_iswcntrl_works" = no; then - REPLACE_ISWCNTRL=1 + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + AC_SUBST([REPLACE_ISWCNTRL]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>. + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 else - REPLACE_ISWCNTRL=0 + AC_CHECK_FUNCS([towlower]) + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + AC_CHECK_DECLS([towlower],,, + [[/* 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> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + ]]) + if test $ac_cv_have_decl_towlower = yes; then + dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and + dnl towupper() although it does not have the functions. Avoid a + dnl collision with gnulib's replacement. + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi fi - AC_SUBST([REPLACE_ISWCNTRL]) + AC_SUBST([REPLACE_TOWLOWER]) + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + dnl Redefine towlower, towupper in <wctype.h>. + : + fi + + dnl We assume that the wctype() and iswctype() functions exist if and only + dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that + dnl exists. + dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>. + AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], + [AC_COMPILE_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> + #if HAVE_WCTYPE_H + # include <wctype.h> + #endif + wctype_t a; + ]], + [[]])], + [gl_cv_type_wctype_t=yes], + [gl_cv_type_wctype_t=no]) + ]) + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi + + dnl We assume that the wctrans() and towctrans() functions exist if and only + dnl if the type wctrans_t is defined in <wctype.h>. + AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], + [AC_COMPILE_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 <wctype.h> + wctrans_t a; + ]], + [[]])], + [gl_cv_type_wctrans_t=yes], + [gl_cv_type_wctrans_t=no]) + ]) + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi + + 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([[ +/* 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>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +# include <wchar.h> +#endif +#include <wctype.h> + ]], + [wctype iswctype wctrans towctrans + ]) +]) + +AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_WCTYPE_H_DEFAULTS], +[ + GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) + GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) + GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) + GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) + GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) + HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) + HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) + REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) ]) diff --git a/gnulib-m4/wcwidth.m4 b/gnulib-m4/wcwidth.m4 index acceba5..b11dc8d 100644 --- a/gnulib-m4/wcwidth.m4 +++ b/gnulib-m4/wcwidth.m4 @@ -1,5 +1,5 @@ -# wcwidth.m4 serial 16 -dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. +# wcwidth.m4 serial 23 +dnl Copyright (C) 2006-2015 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. @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH], AC_CHECK_HEADERS_ONCE([wchar.h]) AC_CHECK_FUNCS_ONCE([wcwidth]) - AC_CHECK_DECLS([wcwidth], [], [], [ + AC_CHECK_DECLS([wcwidth], [], [], [[ /* AIX 3.2.5 declares wcwidth in <string.h>. */ #include <string.h> /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before @@ -29,19 +29,22 @@ AC_DEFUN([gl_FUNC_WCWIDTH], #include <stdio.h> #include <time.h> #include <wchar.h> -]) +]]) if test $ac_cv_have_decl_wcwidth != yes; then HAVE_DECL_WCWIDTH=0 fi if test $ac_cv_func_wcwidth = yes; then - dnl On MacOS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. + HAVE_WCWIDTH=1 + dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. + dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. dnl This leads to bugs in 'ls' (coreutils). AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales], [gl_cv_func_wcwidth_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include <locale.h> /* AIX 3.2.5 declares wcwidth in <string.h>. */ #include <string.h> @@ -62,17 +65,26 @@ int wcwidth (int); #endif int main () { + int result = 0; if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL) - if (wcwidth (0x0301) > 0 || wcwidth (0x200B) > 0) - return 1; - return 0; -}], [gl_cv_func_wcwidth_works=yes], [gl_cv_func_wcwidth_works=no], + { + if (wcwidth (0x0301) > 0) + result |= 1; + if (wcwidth (0x05B0) > 0) + result |= 2; + if (wcwidth (0x200B) > 0) + result |= 4; + } + return result; +}]])], + [gl_cv_func_wcwidth_works=yes], + [gl_cv_func_wcwidth_works=no], [ changequote(,)dnl case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_wcwidth_works="guessing yes";; - *) gl_cv_func_wcwidth_works="guessing no";; + # Guess yes on glibc and AIX 7 systems. + *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; esac changequote([,])dnl ]) @@ -81,13 +93,8 @@ changequote([,])dnl *yes) ;; *no) REPLACE_WCWIDTH=1 ;; esac - fi - if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1; then - AC_LIBOBJ([wcwidth]) - fi - if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1 \ - || test $HAVE_DECL_WCWIDTH = 0; then - gl_REPLACE_WCHAR_H + else + HAVE_WCWIDTH=0 fi dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not dnl have the wcwidth function, then it does not declare it. diff --git a/gnulib-m4/wint_t.m4 b/gnulib-m4/wint_t.m4 index a6c7d15..ca3fd44 100644 --- a/gnulib-m4/wint_t.m4 +++ b/gnulib-m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc. +# wint_t.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2003, 2007-2015 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,9 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], - [AC_TRY_COMPILE([ + [AC_COMPILE_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 @@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T], #include <stdio.h> #include <time.h> #include <wchar.h> - wint_t foo = (wchar_t)'\0';], , - [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) + wint_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wint_t=yes], + [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi diff --git a/gnulib-m4/xalloc.m4 b/gnulib-m4/xalloc.m4 index 83247fe..6dfcab3 100644 --- a/gnulib-m4/xalloc.m4 +++ b/gnulib-m4/xalloc.m4 @@ -1,25 +1,7 @@ -# xalloc.m4 serial 16 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software -dnl Foundation, Inc. +# xalloc.m4 serial 18 +dnl Copyright (C) 2002-2006, 2009-2015 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_XALLOC], -[ - AC_LIBOBJ([xmalloc]) - - gl_PREREQ_XALLOC - gl_PREREQ_XMALLOC -]) - -# Prerequisites of lib/xalloc.h. -AC_DEFUN([gl_PREREQ_XALLOC], [ - AC_REQUIRE([gl_INLINE]) - : -]) - -# Prerequisites of lib/xmalloc.c. -AC_DEFUN([gl_PREREQ_XMALLOC], [ - : -]) +AC_DEFUN([gl_XALLOC], [:]) diff --git a/gnulib-m4/xsize.m4 b/gnulib-m4/xsize.m4 index b653693..98faf7d 100644 --- a/gnulib-m4/xsize.m4 +++ b/gnulib-m4/xsize.m4 @@ -1,5 +1,5 @@ -# xsize.m4 serial 4 -dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc. +# xsize.m4 serial 5 +dnl Copyright (C) 2003-2004, 2008-2015 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,6 +8,5 @@ AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) - AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS([stdint.h]) ]) diff --git a/gnulib-m4/yield.m4 b/gnulib-m4/yield.m4 index 7a543e4..4f24582 100644 --- a/gnulib-m4/yield.m4 +++ b/gnulib-m4/yield.m4 @@ -1,5 +1,5 @@ # yield.m4 serial 2 -dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2015 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. |