diff options
Diffstat (limited to 'src/gl/m4')
104 files changed, 683 insertions, 190 deletions
diff --git a/src/gl/m4/00gnulib.m4 b/src/gl/m4/00gnulib.m4 index c7103ed52f..bb37e32aa3 100644 --- a/src/gl/m4/00gnulib.m4 +++ b/src/gl/m4/00gnulib.m4 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 3 -dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2016 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/src/gl/m4/absolute-header.m4 b/src/gl/m4/absolute-header.m4 index bc19dfc301..7ffc38d7a2 100644 --- a/src/gl/m4/absolute-header.m4 +++ b/src/gl/m4/absolute-header.m4 @@ -1,5 +1,5 @@ # absolute-header.m4 serial 16 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2016 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/src/gl/m4/alloca.m4 b/src/gl/m4/alloca.m4 index 8408bed288..2382ff1eee 100644 --- a/src/gl/m4/alloca.m4 +++ b/src/gl/m4/alloca.m4 @@ -1,5 +1,5 @@ # alloca.m4 serial 14 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 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/src/gl/m4/arpa_inet_h.m4 b/src/gl/m4/arpa_inet_h.m4 index 056bc7b4bf..5387f28409 100644 --- a/src/gl/m4/arpa_inet_h.m4 +++ b/src/gl/m4/arpa_inet_h.m4 @@ -1,5 +1,5 @@ # arpa_inet_h.m4 serial 13 -dnl Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2016 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/src/gl/m4/bison.m4 b/src/gl/m4/bison.m4 index acfca78050..556730cf67 100644 --- a/src/gl/m4/bison.m4 +++ b/src/gl/m4/bison.m4 @@ -1,6 +1,6 @@ # serial 7 -# Copyright (C) 2002, 2005, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2002, 2005, 2009-2016 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. diff --git a/src/gl/m4/clock_time.m4 b/src/gl/m4/clock_time.m4 index a903e582ea..bb20344e8f 100644 --- a/src/gl/m4/clock_time.m4 +++ b/src/gl/m4/clock_time.m4 @@ -1,5 +1,5 @@ # clock_time.m4 serial 10 -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2016 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/src/gl/m4/close.m4 b/src/gl/m4/close.m4 index d04aefbeeb..310f076bed 100644 --- a/src/gl/m4/close.m4 +++ b/src/gl/m4/close.m4 @@ -1,5 +1,5 @@ # close.m4 serial 8 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2016 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/src/gl/m4/dirname.m4 b/src/gl/m4/dirname.m4 new file mode 100644 index 0000000000..6f8bec32c4 --- /dev/null +++ b/src/gl/m4/dirname.m4 @@ -0,0 +1,19 @@ +#serial 10 -*- autoconf -*- +dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_DIRNAME], +[ + AC_REQUIRE([gl_DIRNAME_LGPL]) +]) + +AC_DEFUN([gl_DIRNAME_LGPL], +[ + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) + + dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c, + dnl lib/stripslash.c. +]) diff --git a/src/gl/m4/double-slash-root.m4 b/src/gl/m4/double-slash-root.m4 new file mode 100644 index 0000000000..dfd3921d1e --- /dev/null +++ b/src/gl/m4/double-slash-root.m4 @@ -0,0 +1,38 @@ +# double-slash-root.m4 serial 4 -*- Autoconf -*- +dnl Copyright (C) 2006, 2008-2016 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_DOUBLE_SLASH_ROOT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root], + [ if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # <bug-gnulib@gnu.org>. + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi]) + if test "$gl_cv_double_slash_root" = yes; then + AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1], + [Define to 1 if // is a file system root distinct from /.]) + fi +]) diff --git a/src/gl/m4/dup2.m4 b/src/gl/m4/dup2.m4 index 59028e0982..5b68312b1e 100644 --- a/src/gl/m4/dup2.m4 +++ b/src/gl/m4/dup2.m4 @@ -1,5 +1,5 @@ -#serial 24 -dnl Copyright (C) 2002, 2005, 2007, 2009-2015 Free Software Foundation, Inc. +#serial 25 +dnl Copyright (C) 2002, 2005, 2007, 2009-2016 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. @@ -62,6 +62,16 @@ AC_DEFUN([gl_FUNC_DUP2], result |= 32; dup2 (2, 255); dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + + close (fd); + } return result;]]) ], [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], @@ -78,6 +88,8 @@ AC_DEFUN([gl_FUNC_DUP2], gl_cv_func_dup2_works="guessing no" ;; *-android*) # implemented using dup3(), which fails if oldfd == newfd gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; *) gl_cv_func_dup2_works="guessing yes" ;; esac]) ]) diff --git a/src/gl/m4/eealloc.m4 b/src/gl/m4/eealloc.m4 index 322bdd50b4..63d74defec 100644 --- a/src/gl/m4/eealloc.m4 +++ b/src/gl/m4/eealloc.m4 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2016 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/src/gl/m4/environ.m4 b/src/gl/m4/environ.m4 index 4dbf9473e1..9a0ea7e214 100644 --- a/src/gl/m4/environ.m4 +++ b/src/gl/m4/environ.m4 @@ -1,5 +1,5 @@ # environ.m4 serial 6 -dnl Copyright (C) 2001-2004, 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2016 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/src/gl/m4/errno_h.m4 b/src/gl/m4/errno_h.m4 index cfaa687615..b111fce053 100644 --- a/src/gl/m4/errno_h.m4 +++ b/src/gl/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 serial 12 -dnl Copyright (C) 2004, 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2016 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/src/gl/m4/error.m4 b/src/gl/m4/error.m4 index b3bd7f6c6c..f772bcf580 100644 --- a/src/gl/m4/error.m4 +++ b/src/gl/m4/error.m4 @@ -1,6 +1,6 @@ #serial 14 -# Copyright (C) 1996-1998, 2001-2004, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2016 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/gl/m4/exponentd.m4 b/src/gl/m4/exponentd.m4 index 84f1691a65..7869a7d6cb 100644 --- a/src/gl/m4/exponentd.m4 +++ b/src/gl/m4/exponentd.m4 @@ -1,5 +1,5 @@ # exponentd.m4 serial 3 -dnl Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2016 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/src/gl/m4/extensions.m4 b/src/gl/m4/extensions.m4 index 35bc49c97b..e114a6f729 100644 --- a/src/gl/m4/extensions.m4 +++ b/src/gl/m4/extensions.m4 @@ -1,7 +1,7 @@ -# serial 13 -*- Autoconf -*- +# serial 15 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2015 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2016 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. @@ -60,7 +60,7 @@ dnl configure.ac when using autoheader 2.62. #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on OS X. */ +/* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif @@ -68,14 +68,38 @@ dnl configure.ac when using autoheader 2.62. #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 #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE @@ -104,8 +128,14 @@ dnl configure.ac when using autoheader 2.62. 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([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) + AC_DEFINE([__STDC_WANT_LIB_EXT2__]) + AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) AC_DEFINE([_TANDEM_SOURCE]) AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], [ac_cv_should_define__xopen_source], diff --git a/src/gl/m4/extern-inline.m4 b/src/gl/m4/extern-inline.m4 index 72800650e6..1e578f3deb 100644 --- a/src/gl/m4/extern-inline.m4 +++ b/src/gl/m4/extern-inline.m4 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2015 Free Software Foundation, Inc. +dnl Copyright 2012-2016 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. @@ -54,6 +54,7 @@ AC_DEFUN([gl_EXTERN_INLINE], ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ + && !defined __PGI \ && !(defined __SUNPRO_C && __STDC__))) \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline diff --git a/src/gl/m4/flexmember.m4 b/src/gl/m4/flexmember.m4 new file mode 100644 index 0000000000..155ae9b812 --- /dev/null +++ b/src/gl/m4/flexmember.m4 @@ -0,0 +1,43 @@ +# serial 4 +# Check for flexible array member support. + +# Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Paul Eggert. + +AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], +[ + AC_CACHE_CHECK([for flexible array member], + ac_cv_c_flexmember, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdlib.h> + #include <stdio.h> + #include <stddef.h> + struct s { int n; double d[]; };]], + [[int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->d[0] = 0.0; + return p->d != (double *) NULL;]])], + [ac_cv_c_flexmember=yes], + [ac_cv_c_flexmember=no])]) + if test $ac_cv_c_flexmember = yes; then + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], + [Define to nothing if C supports flexible array members, and to + 1 if it does not. That way, with a declaration like 'struct s + { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack + can be used with pre-C99 compilers. + When computing the size of such an object, don't use 'sizeof (struct s)' + as it overestimates the size. Use 'offsetof (struct s, d)' instead. + Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with + MSVC and with C++ compilers.]) + else + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1]) + fi +]) diff --git a/src/gl/m4/float_h.m4 b/src/gl/m4/float_h.m4 index e4853f3b09..e2887eb5c6 100644 --- a/src/gl/m4/float_h.m4 +++ b/src/gl/m4/float_h.m4 @@ -1,5 +1,5 @@ # float_h.m4 serial 9 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2016 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/src/gl/m4/fseek.m4 b/src/gl/m4/fseek.m4 index fb29688a0d..5ec8d004d3 100644 --- a/src/gl/m4/fseek.m4 +++ b/src/gl/m4/fseek.m4 @@ -1,5 +1,5 @@ # fseek.m4 serial 4 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2016 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/src/gl/m4/fseeko.m4 b/src/gl/m4/fseeko.m4 index 84555e2cba..6c7f551bda 100644 --- a/src/gl/m4/fseeko.m4 +++ b/src/gl/m4/fseeko.m4 @@ -1,5 +1,5 @@ # fseeko.m4 serial 17 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2016 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/src/gl/m4/fstat.m4 b/src/gl/m4/fstat.m4 index d6a928827e..29f9b81654 100644 --- a/src/gl/m4/fstat.m4 +++ b/src/gl/m4/fstat.m4 @@ -1,5 +1,5 @@ # fstat.m4 serial 4 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2016 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/src/gl/m4/ftell.m4 b/src/gl/m4/ftell.m4 index 77989192dc..6701f0a76c 100644 --- a/src/gl/m4/ftell.m4 +++ b/src/gl/m4/ftell.m4 @@ -1,5 +1,5 @@ # ftell.m4 serial 3 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2016 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/src/gl/m4/ftello.m4 b/src/gl/m4/ftello.m4 index 3825cf2d0f..3f4808bf37 100644 --- a/src/gl/m4/ftello.m4 +++ b/src/gl/m4/ftello.m4 @@ -1,5 +1,5 @@ # ftello.m4 serial 11 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2016 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/src/gl/m4/getaddrinfo.m4 b/src/gl/m4/getaddrinfo.m4 index f3e40c479c..4a92d0865f 100644 --- a/src/gl/m4/getaddrinfo.m4 +++ b/src/gl/m4/getaddrinfo.m4 @@ -1,5 +1,5 @@ -# getaddrinfo.m4 serial 30 -dnl Copyright (C) 2004-2015 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 31 +dnl Copyright (C) 2004-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,7 +8,7 @@ AC_DEFUN([gl_GETADDRINFO], [ AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H - AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) + AC_MSG_CHECKING([how to do getaddrinfo, freeaddrinfo and getnameinfo]) GETADDRINFO_LIB= gai_saved_LIBS="$LIBS" diff --git a/src/gl/m4/getdelim.m4 b/src/gl/m4/getdelim.m4 index af9b1faa9a..a1a7dcc526 100644 --- a/src/gl/m4/getdelim.m4 +++ b/src/gl/m4/getdelim.m4 @@ -1,6 +1,6 @@ -# getdelim.m4 serial 10 +# getdelim.m4 serial 11 -dnl Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -48,7 +48,9 @@ AC_DEFUN([gl_FUNC_GETDELIM], size_t siz = (size_t)(~0) / 4; if (getdelim (&line, &siz, '\n', in) == -1) return 3; + free (line); } + fclose (in); return 0; } ]])], [gl_cv_func_working_getdelim=yes] dnl The library version works. diff --git a/src/gl/m4/getline.m4 b/src/gl/m4/getline.m4 index a35f3a295b..f44751cd4b 100644 --- a/src/gl/m4/getline.m4 +++ b/src/gl/m4/getline.m4 @@ -1,6 +1,6 @@ -# getline.m4 serial 26 +# getline.m4 serial 27 -dnl Copyright (C) 1998-2003, 2005-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 1998-2003, 2005-2007, 2009-2016 Free Software Foundation, dnl Inc. dnl dnl This file is free software; the Free Software Foundation @@ -47,6 +47,7 @@ AC_DEFUN([gl_FUNC_GETLINE], int len = getline (&line, &siz, in); if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) return 2; + free (line); } { /* Test result for a NULL buffer and a non-zero size. @@ -55,7 +56,9 @@ AC_DEFUN([gl_FUNC_GETLINE], size_t siz = (size_t)(~0) / 4; if (getline (&line, &siz, in) == -1) return 3; + free (line); } + fclose (in); return 0; } ]])], [am_cv_func_working_getline=yes] dnl The library version works. diff --git a/src/gl/m4/getpass.m4 b/src/gl/m4/getpass.m4 index 30437ef09e..f0e330cb4e 100644 --- a/src/gl/m4/getpass.m4 +++ b/src/gl/m4/getpass.m4 @@ -1,5 +1,5 @@ # getpass.m4 serial 14 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 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/src/gl/m4/getprogname.m4 b/src/gl/m4/getprogname.m4 new file mode 100644 index 0000000000..f027037fc6 --- /dev/null +++ b/src/gl/m4/getprogname.m4 @@ -0,0 +1,43 @@ +# getprogname.m4 - check for getprogname or replacements for it + +# Copyright (C) 2016 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 4 + +AC_DEFUN([gl_FUNC_GETPROGNAME], +[ + AC_CHECK_FUNCS_ONCE([getprogname getexecname]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + ac_found=0 + AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], + [#include <errno.h>]) + AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [], + [#include <errno.h>]) + AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include <stdlib.h>]) + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + AC_CACHE_CHECK([whether __progname is defined in default libraries], + [gl_cv_var___progname], + [ + gl_cv_var___progname= + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern char *__progname;]], + [[return *__progname;]] + )], + [gl_cv_var___progname=yes] + ) + ] + ) + if test "$gl_cv_var___progname" = yes; then + AC_DEFINE([HAVE_VAR___PROGNAME], 1, + [Define if you have a global __progname variable]) + fi + fi +]) diff --git a/src/gl/m4/gettime.m4 b/src/gl/m4/gettime.m4 index cd499ff5d7..9843ed4855 100644 --- a/src/gl/m4/gettime.m4 +++ b/src/gl/m4/gettime.m4 @@ -1,5 +1,5 @@ # gettime.m4 serial 8 -dnl Copyright (C) 2002, 2004-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004-2006, 2009-2016 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/src/gl/m4/gettimeofday.m4 b/src/gl/m4/gettimeofday.m4 index ce246e18bc..4ae5d63fe3 100644 --- a/src/gl/m4/gettimeofday.m4 +++ b/src/gl/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ # serial 21 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2016 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. diff --git a/src/gl/m4/gnulib-cache.m4 b/src/gl/m4/gnulib-cache.m4 index ed31ded3aa..b460788f20 100644 --- a/src/gl/m4/gnulib-cache.m4 +++ b/src/gl/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2016 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=src/gl/override --lib=libgnu_gpl --source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=ggl --no-vc-files accept bind close connect getaddrinfo getpass gettext-h inet_ntop inet_pton listen minmax parse-datetime progname read-file recv recvfrom select send sendto servent setsockopt shutdown socket sockets socklen +# gnulib-tool --import --local-dir=src/gl/override --lib=libgnu_gpl --source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=ggl --no-vc-files accept bind close connect getaddrinfo getpass gettext-h inet_ntop inet_pton listen minmax parse-datetime progname read-file recv recvfrom select send sendto servent setsockopt shutdown socket sockets socklen # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([src/gl/override]) diff --git a/src/gl/m4/gnulib-common.m4 b/src/gl/m4/gnulib-common.m4 index 40e82f6e27..f8454c8a01 100644 --- a/src/gl/m4/gnulib-common.m4 +++ b/src/gl/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ # gnulib-common.m4 serial 36 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2016 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. @@ -253,9 +253,10 @@ 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 library formats. In particular, the GNU binutils programs ar and ranlib dnl produce libraries that work only with gcc, not with cc. AC_REQUIRE([AC_PROG_CC]) + AC_BEFORE([$0], [AM_PROG_AR]) AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], [ AC_EGREP_CPP([Amsterdam], @@ -267,25 +268,37 @@ Amsterdam [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 + + dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not + dnl building with __ACK__. + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; 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' + ARFLAGS='-o' fi + else + dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST + dnl ARFLAGS variable (it is filed into Makefile.in directly by automake + dnl script on-demand, if not specified by ./configure of course). + dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above + dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block + dnl because AM_PROG_AR is written so it could re-set AR variable even for + dnl __ACK__. It may seem like its easier to avoid calling the macro here, + dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good + dnl default value and automake should usually know them). + m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:]) + fi + + dnl In case the code above has not helped with setting AR/ARFLAGS, use + dnl Automake-documented default values for AR and ARFLAGS, but prefer + dnl ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cr' fi + AC_SUBST([AR]) AC_SUBST([ARFLAGS]) if test -z "$RANLIB"; then diff --git a/src/gl/m4/gnulib-comp.m4 b/src/gl/m4/gnulib-comp.m4 index fc8762e384..aad9f74f34 100644 --- a/src/gl/m4/gnulib-comp.m4 +++ b/src/gl/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2016 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,7 +37,11 @@ AC_DEFUN([ggl_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 + + # Pre-early section. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) + # Code from module absolute-header: # Code from module accept: # Code from module alloca: @@ -48,15 +52,18 @@ AC_DEFUN([ggl_EARLY], # Code from module clock-time: # Code from module close: # Code from module connect: + # Code from module dirname-lgpl: + # Code from module dosname: + # Code from module double-slash-root: # Code from module dup2: # Code from module environ: # Code from module errno: # Code from module error: # Code from module exitfail: # Code from module extensions: - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: # Code from module fd-hook: + # Code from module flexmember: # Code from module float: # Code from module fseek: # Code from module fseeko: @@ -70,6 +77,7 @@ AC_DEFUN([ggl_EARLY], # Code from module getline: # Code from module getpass: # Code from module getpeername: + # Code from module getprogname: # Code from module gettext-h: # Code from module gettime: # Code from module gettimeofday: @@ -80,6 +88,7 @@ AC_DEFUN([ggl_EARLY], # Code from module intprops: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) + # Code from module limits-h: # Code from module listen: # Code from module lseek: # Code from module malloc-posix: @@ -87,6 +96,7 @@ AC_DEFUN([ggl_EARLY], # Code from module memchr: # Code from module minmax: # Code from module mktime: + # Code from module mktime-internal: # Code from module msvc-inval: # Code from module msvc-nothrow: # Code from module multiarch: @@ -126,6 +136,7 @@ AC_DEFUN([ggl_EARLY], # Code from module strdup-posix: # Code from module strerror: # Code from module strerror-override: + # Code from module strftime: # Code from module string: # Code from module sys_select: # Code from module sys_socket: @@ -135,6 +146,8 @@ AC_DEFUN([ggl_EARLY], # Code from module sys_uio: # Code from module time: # Code from module time_r: + # Code from module time_rz: + # Code from module timegm: # Code from module timespec: # Code from module unistd: # Code from module unsetenv: @@ -189,6 +202,8 @@ AC_SUBST([LTALLOCA]) AC_LIBOBJ([connect]) fi gl_SYS_SOCKET_MODULE_INDICATOR([connect]) + gl_DIRNAME_LGPL + gl_DOUBLE_SLASH_ROOT gl_FUNC_DUP2 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then AC_LIBOBJ([dup2]) @@ -207,6 +222,7 @@ AC_SUBST([LTALLOCA]) [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) AC_REQUIRE([gl_EXTERN_INLINE]) + AC_C_FLEXIBLE_ARRAY_MEMBER gl_FLOAT_H if test $REPLACE_FLOAT_LDBL = 1; then AC_LIBOBJ([float]) @@ -272,6 +288,7 @@ AC_SUBST([LTALLOCA]) AC_LIBOBJ([getpeername]) fi gl_SYS_SOCKET_MODULE_INDICATOR([getpeername]) + gl_FUNC_GETPROGNAME AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_GETTIME @@ -295,6 +312,7 @@ AC_SUBST([LTALLOCA]) fi gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) AC_REQUIRE([gl_LARGEFILE]) + gl_LIMITS_H AC_REQUIRE([gl_HEADER_SYS_SOCKET]) if test "$ac_cv_header_winsock2_h" = yes; then AC_LIBOBJ([listen]) @@ -324,11 +342,16 @@ AC_SUBST([LTALLOCA]) gl_PREREQ_MKTIME fi gl_TIME_MODULE_INDICATOR([mktime]) - gl_MSVC_INVAL + gl_FUNC_MKTIME_INTERNAL + if test $REPLACE_MKTIME = 1; then + AC_LIBOBJ([mktime]) + gl_PREREQ_MKTIME + fi + AC_REQUIRE([gl_MSVC_INVAL]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-inval]) fi - gl_MSVC_NOTHROW + AC_REQUIRE([gl_MSVC_NOTHROW]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-nothrow]) fi @@ -433,6 +456,7 @@ AC_SUBST([LTALLOCA]) AC_LIBOBJ([strerror-override]) gl_PREREQ_SYS_H_WINSOCK2 fi + gl_FUNC_GNU_STRFTIME gl_HEADER_STRING_H gl_HEADER_SYS_SELECT AC_PROG_MKDIR_P @@ -453,6 +477,17 @@ AC_SUBST([LTALLOCA]) gl_PREREQ_TIME_R fi gl_TIME_MODULE_INDICATOR([time_r]) + gl_TIME_RZ + if test "$HAVE_TIMEZONE_T" = 0; then + AC_LIBOBJ([time_rz]) + fi + gl_TIME_MODULE_INDICATOR([time_rz]) + gl_FUNC_TIMEGM + if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then + AC_LIBOBJ([timegm]) + gl_PREREQ_TIMEGM + fi + gl_TIME_MODULE_INDICATOR([timegm]) gl_TIMESPEC gl_UNISTD_H gl_FUNC_UNSETENV @@ -611,11 +646,15 @@ AC_DEFUN([ggl_FILE_LIST], [ lib/alloca.in.h lib/arpa_inet.in.h lib/asnprintf.c + lib/basename-lgpl.c lib/bind.c lib/c-ctype.c lib/c-ctype.h lib/close.c lib/connect.c + lib/dirname-lgpl.c + lib/dirname.h + lib/dosname.h lib/dup2.c lib/errno.in.h lib/error.c @@ -624,6 +663,7 @@ AC_DEFUN([ggl_FILE_LIST], [ lib/exitfail.h lib/fd-hook.c lib/fd-hook.h + lib/flexmember.h lib/float+.h lib/float.c lib/float.in.h @@ -639,6 +679,8 @@ AC_DEFUN([ggl_FILE_LIST], [ lib/getpass.c lib/getpass.h lib/getpeername.c + lib/getprogname.c + lib/getprogname.h lib/gettext.h lib/gettime.c lib/gettimeofday.c @@ -646,6 +688,7 @@ AC_DEFUN([ggl_FILE_LIST], [ lib/inet_pton.c lib/intprops.h lib/itold.c + lib/limits.in.h lib/listen.c lib/lseek.c lib/malloc.c @@ -699,7 +742,10 @@ AC_DEFUN([ggl_FILE_LIST], [ lib/strerror-override.c lib/strerror-override.h lib/strerror.c + lib/strftime.c + lib/strftime.h lib/string.in.h + lib/stripslash.c lib/sys_select.in.h lib/sys_socket.c lib/sys_socket.in.h @@ -707,8 +753,11 @@ AC_DEFUN([ggl_FILE_LIST], [ lib/sys_time.in.h lib/sys_types.in.h lib/sys_uio.in.h + lib/time-internal.h lib/time.in.h lib/time_r.c + lib/time_rz.c + lib/timegm.c lib/timespec.c lib/timespec.h lib/unistd.c @@ -732,6 +781,8 @@ AC_DEFUN([ggl_FILE_LIST], [ m4/bison.m4 m4/clock_time.m4 m4/close.m4 + m4/dirname.m4 + m4/double-slash-root.m4 m4/dup2.m4 m4/eealloc.m4 m4/environ.m4 @@ -740,6 +791,7 @@ AC_DEFUN([ggl_FILE_LIST], [ m4/exponentd.m4 m4/extensions.m4 m4/extern-inline.m4 + m4/flexmember.m4 m4/float_h.m4 m4/fseek.m4 m4/fseeko.m4 @@ -750,6 +802,7 @@ AC_DEFUN([ggl_FILE_LIST], [ m4/getdelim.m4 m4/getline.m4 m4/getpass.m4 + m4/getprogname.m4 m4/gettime.m4 m4/gettimeofday.m4 m4/gnulib-common.m4 @@ -760,6 +813,7 @@ AC_DEFUN([ggl_FILE_LIST], [ m4/intmax_t.m4 m4/inttypes_h.m4 m4/largefile.m4 + m4/limits-h.m4 m4/longlong.m4 m4/lseek.m4 m4/malloc.m4 @@ -799,6 +853,7 @@ AC_DEFUN([ggl_FILE_LIST], [ m4/stdlib_h.m4 m4/strdup.m4 m4/strerror.m4 + m4/strftime.m4 m4/string_h.m4 m4/sys_select_h.m4 m4/sys_socket_h.m4 @@ -808,6 +863,8 @@ AC_DEFUN([ggl_FILE_LIST], [ m4/sys_uio_h.m4 m4/time_h.m4 m4/time_r.m4 + m4/time_rz.m4 + m4/timegm.m4 m4/timespec.m4 m4/tm_gmtoff.m4 m4/unistd_h.m4 diff --git a/src/gl/m4/gnulib-tool.m4 b/src/gl/m4/gnulib-tool.m4 index fede1fc3bd..0d2ee444b4 100644 --- a/src/gl/m4/gnulib-tool.m4 +++ b/src/gl/m4/gnulib-tool.m4 @@ -1,5 +1,5 @@ # gnulib-tool.m4 serial 2 -dnl Copyright (C) 2004-2005, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2005, 2009-2016 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/src/gl/m4/hostent.m4 b/src/gl/m4/hostent.m4 index 6706d1f5cc..1b2488abc0 100644 --- a/src/gl/m4/hostent.m4 +++ b/src/gl/m4/hostent.m4 @@ -1,5 +1,5 @@ # hostent.m4 serial 2 -dnl Copyright (C) 2008, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2016 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/src/gl/m4/include_next.m4 b/src/gl/m4/include_next.m4 index 233d254e80..db0f2c0795 100644 --- a/src/gl/m4/include_next.m4 +++ b/src/gl/m4/include_next.m4 @@ -1,5 +1,5 @@ # include_next.m4 serial 23 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2016 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/src/gl/m4/inet_ntop.m4 b/src/gl/m4/inet_ntop.m4 index df2bc746da..26464c34ac 100644 --- a/src/gl/m4/inet_ntop.m4 +++ b/src/gl/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ # inet_ntop.m4 serial 19 -dnl Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2006, 2008-2016 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/src/gl/m4/inet_pton.m4 b/src/gl/m4/inet_pton.m4 index 433faee0cb..4f5db7149a 100644 --- a/src/gl/m4/inet_pton.m4 +++ b/src/gl/m4/inet_pton.m4 @@ -1,5 +1,5 @@ # inet_pton.m4 serial 17 -dnl Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2016 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/src/gl/m4/intmax_t.m4 b/src/gl/m4/intmax_t.m4 index 4bd8155c83..9559accabf 100644 --- a/src/gl/m4/intmax_t.m4 +++ b/src/gl/m4/intmax_t.m4 @@ -1,5 +1,5 @@ # intmax_t.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 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/src/gl/m4/inttypes_h.m4 b/src/gl/m4/inttypes_h.m4 index d0b5f5d982..76571199f3 100644 --- a/src/gl/m4/inttypes_h.m4 +++ b/src/gl/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ # inttypes_h.m4 serial 10 -dnl Copyright (C) 1997-2004, 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2016 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/src/gl/m4/largefile.m4 b/src/gl/m4/largefile.m4 index b7a6c48b68..8bbdfaac1d 100644 --- a/src/gl/m4/largefile.m4 +++ b/src/gl/m4/largefile.m4 @@ -1,6 +1,6 @@ # Enable large files on systems where this is not the default. -# Copyright 1992-1996, 1998-2015 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2016 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. diff --git a/src/gl/m4/limits-h.m4 b/src/gl/m4/limits-h.m4 new file mode 100644 index 0000000000..31fdf0a779 --- /dev/null +++ b/src/gl/m4/limits-h.m4 @@ -0,0 +1,31 @@ +dnl Check whether limits.h has needed features. + +dnl Copyright 2016 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_DEFUN_ONCE([gl_LIMITS_H], +[ + gl_CHECK_NEXT_HEADERS([limits.h]) + + AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], + [gl_cv_header_limits_width], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <limits.h> + int ullw = ULLONG_WIDTH;]])], + [gl_cv_header_limits_width=yes], + [gl_cv_header_limits_width=no])]) + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + AC_SUBST([LIMITS_H]) + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +]) diff --git a/src/gl/m4/longlong.m4 b/src/gl/m4/longlong.m4 index d57bc700d4..36d8b12421 100644 --- a/src/gl/m4/longlong.m4 +++ b/src/gl/m4/longlong.m4 @@ -1,5 +1,5 @@ # longlong.m4 serial 17 -dnl Copyright (C) 1999-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1999-2007, 2009-2016 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/src/gl/m4/lseek.m4 b/src/gl/m4/lseek.m4 index f337abf1a8..4a95440073 100644 --- a/src/gl/m4/lseek.m4 +++ b/src/gl/m4/lseek.m4 @@ -1,5 +1,5 @@ # lseek.m4 serial 10 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2016 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/src/gl/m4/malloc.m4 b/src/gl/m4/malloc.m4 index 31368ab97f..c393690e27 100644 --- a/src/gl/m4/malloc.m4 +++ b/src/gl/m4/malloc.m4 @@ -1,13 +1,13 @@ -# malloc.m4 serial 14 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +# malloc.m4 serial 15 +dnl Copyright (C) 2007, 2009-2016 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 +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], char *malloc (); #endif ]], - [[return ! malloc (0);]]) + [[char *p = malloc (0); + int result = !p; + free (p); + return result;]]) ], [ac_cv_func_malloc_0_nonnull=yes], [ac_cv_func_malloc_0_nonnull=no], diff --git a/src/gl/m4/malloca.m4 b/src/gl/m4/malloca.m4 index 7248951746..b368b20e50 100644 --- a/src/gl/m4/malloca.m4 +++ b/src/gl/m4/malloca.m4 @@ -1,5 +1,5 @@ # malloca.m4 serial 1 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 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/src/gl/m4/math_h.m4 b/src/gl/m4/math_h.m4 index 7d0f58346b..35d07ee5f5 100644 --- a/src/gl/m4/math_h.m4 +++ b/src/gl/m4/math_h.m4 @@ -1,5 +1,5 @@ # math_h.m4 serial 114 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2016 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/src/gl/m4/memchr.m4 b/src/gl/m4/memchr.m4 index cb958d8626..25d32f0ec9 100644 --- a/src/gl/m4/memchr.m4 +++ b/src/gl/m4/memchr.m4 @@ -1,5 +1,5 @@ # memchr.m4 serial 12 -dnl Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2009-2016 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/src/gl/m4/minmax.m4 b/src/gl/m4/minmax.m4 index 0df832c833..9c43e6452c 100644 --- a/src/gl/m4/minmax.m4 +++ b/src/gl/m4/minmax.m4 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2016 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/src/gl/m4/mktime.m4 b/src/gl/m4/mktime.m4 index 3f0e1eee44..23cad732ff 100644 --- a/src/gl/m4/mktime.m4 +++ b/src/gl/m4/mktime.m4 @@ -1,5 +1,5 @@ -# serial 25 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2015 Free Software Foundation, +# serial 27 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 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,14 +7,30 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. +AC_DEFUN([gl_TIME_T_IS_SIGNED], +[ + AC_CACHE_CHECK([whether time_t is signed], + [gl_cv_time_t_is_signed], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <time.h> + char time_t_signed[(time_t) -1 < 0 ? 1 : -1];]])], + [gl_cv_time_t_is_signed=yes], + [gl_cv_time_t_is_signed=no])]) + if test $gl_cv_time_t_is_signed = yes; then + AC_DEFINE([TIME_T_IS_SIGNED], [1], [Define to 1 if time_t is signed.]) + fi +]) + AC_DEFUN([gl_FUNC_MKTIME], [ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_TIME_T_IS_SIGNED]) dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained dnl in Autoconf and because it invokes AC_LIBOBJ. AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_DECLS_ONCE([alarm]) + AC_CHECK_FUNCS_ONCE([tzset]) AC_REQUIRE([gl_MULTIARCH]) if test $APPLE_UNIVERSAL_BUILD = 1; then # A universal build on Apple Mac OS X platforms. @@ -169,7 +185,6 @@ main () time_t t, delta; int i, j; int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; - int time_t_signed = ! ((time_t) 0 < (time_t) -1); #if HAVE_DECL_ALARM /* This test makes some buggy mktime implementations loop. @@ -179,11 +194,11 @@ main () alarm (60); #endif - time_t_max = (! time_t_signed + time_t_max = (! TIME_T_IS_SIGNED ? (time_t) -1 : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) * 2 + 1)); - time_t_min = (! time_t_signed + time_t_min = (! TIME_T_IS_SIGNED ? (time_t) 0 : time_t_signed_magnitude ? ~ (time_t) 0 diff --git a/src/gl/m4/mmap-anon.m4 b/src/gl/m4/mmap-anon.m4 index 92a88d05fb..853c89dc9b 100644 --- a/src/gl/m4/mmap-anon.m4 +++ b/src/gl/m4/mmap-anon.m4 @@ -1,5 +1,5 @@ # mmap-anon.m4 serial 10 -dnl Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2016 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/src/gl/m4/msvc-inval.m4 b/src/gl/m4/msvc-inval.m4 index 9446fa5850..f5e4c89309 100644 --- a/src/gl/m4/msvc-inval.m4 +++ b/src/gl/m4/msvc-inval.m4 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2016 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/src/gl/m4/msvc-nothrow.m4 b/src/gl/m4/msvc-nothrow.m4 index 5d72a042da..58f5c0bc20 100644 --- a/src/gl/m4/msvc-nothrow.m4 +++ b/src/gl/m4/msvc-nothrow.m4 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2016 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/src/gl/m4/multiarch.m4 b/src/gl/m4/multiarch.m4 index fc575c1d43..43b5d05750 100644 --- a/src/gl/m4/multiarch.m4 +++ b/src/gl/m4/multiarch.m4 @@ -1,5 +1,5 @@ # multiarch.m4 serial 7 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2016 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/src/gl/m4/netdb_h.m4 b/src/gl/m4/netdb_h.m4 index fce208014c..4e5206cebe 100644 --- a/src/gl/m4/netdb_h.m4 +++ b/src/gl/m4/netdb_h.m4 @@ -1,5 +1,5 @@ # netdb_h.m4 serial 11 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2016 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/src/gl/m4/netinet_in_h.m4 b/src/gl/m4/netinet_in_h.m4 index 42ac008442..93dcc68947 100644 --- a/src/gl/m4/netinet_in_h.m4 +++ b/src/gl/m4/netinet_in_h.m4 @@ -1,5 +1,5 @@ # netinet_in_h.m4 serial 5 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2016 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/src/gl/m4/off_t.m4 b/src/gl/m4/off_t.m4 index 0eb14678be..282751b47b 100644 --- a/src/gl/m4/off_t.m4 +++ b/src/gl/m4/off_t.m4 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2016 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/src/gl/m4/parse-datetime.m4 b/src/gl/m4/parse-datetime.m4 index 2fc15c6298..6606ab286c 100644 --- a/src/gl/m4/parse-datetime.m4 +++ b/src/gl/m4/parse-datetime.m4 @@ -1,5 +1,5 @@ # parse-datetime.m4 serial 21 -dnl Copyright (C) 2002-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2016 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/src/gl/m4/printf.m4 b/src/gl/m4/printf.m4 index d06746aae7..c7a14b20e0 100644 --- a/src/gl/m4/printf.m4 +++ b/src/gl/m4/printf.m4 @@ -1,5 +1,5 @@ # printf.m4 serial 52 -dnl Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2016 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. @@ -38,6 +38,8 @@ int main () if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 1; +#else + result |= 1; #endif buf[0] = '\0'; if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 diff --git a/src/gl/m4/read-file.m4 b/src/gl/m4/read-file.m4 index 67e50bd1e0..aa23b5840c 100644 --- a/src/gl/m4/read-file.m4 +++ b/src/gl/m4/read-file.m4 @@ -1,5 +1,5 @@ # read-file.m4 serial 3 -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2016 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/src/gl/m4/realloc.m4 b/src/gl/m4/realloc.m4 index 0e1d3386e7..fc2282544d 100644 --- a/src/gl/m4/realloc.m4 +++ b/src/gl/m4/realloc.m4 @@ -1,13 +1,13 @@ -# realloc.m4 serial 13 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +# realloc.m4 serial 14 +dnl Copyright (C) 2007, 2009-2016 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 +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_REALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], char *realloc (); #endif ]], - [[return ! realloc (0, 0);]]) + [[char *p = realloc (0, 0); + int result = !p; + free (p); + return result;]]) ], [ac_cv_func_realloc_0_nonnull=yes], [ac_cv_func_realloc_0_nonnull=no], diff --git a/src/gl/m4/select.m4 b/src/gl/m4/select.m4 index 2a2ee6f901..d19365541e 100644 --- a/src/gl/m4/select.m4 +++ b/src/gl/m4/select.m4 @@ -1,5 +1,5 @@ -# select.m4 serial 7 -dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. +# select.m4 serial 8 +dnl Copyright (C) 2009-2016 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_SELECT], [ AC_REQUIRE([gl_HEADER_SYS_SELECT]) + AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SOCKETS]) if test "$ac_cv_header_winsock2_h" = yes; then diff --git a/src/gl/m4/servent.m4 b/src/gl/m4/servent.m4 index e871d45ce7..182e7f6277 100644 --- a/src/gl/m4/servent.m4 +++ b/src/gl/m4/servent.m4 @@ -1,5 +1,5 @@ # servent.m4 serial 2 -dnl Copyright (C) 2008, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2016 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/src/gl/m4/setenv.m4 b/src/gl/m4/setenv.m4 index 3aa38d8958..5d49aba60d 100644 --- a/src/gl/m4/setenv.m4 +++ b/src/gl/m4/setenv.m4 @@ -1,5 +1,5 @@ # setenv.m4 serial 26 -dnl Copyright (C) 2001-2004, 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2016 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/src/gl/m4/signal_h.m4 b/src/gl/m4/signal_h.m4 index f737c36ba8..bcfd7b4be3 100644 --- a/src/gl/m4/signal_h.m4 +++ b/src/gl/m4/signal_h.m4 @@ -1,5 +1,5 @@ # signal_h.m4 serial 18 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2016 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/src/gl/m4/size_max.m4 b/src/gl/m4/size_max.m4 index 186e3fddab..de69025d62 100644 --- a/src/gl/m4/size_max.m4 +++ b/src/gl/m4/size_max.m4 @@ -1,5 +1,5 @@ # size_max.m4 serial 10 -dnl Copyright (C) 2003, 2005-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2006, 2008-2016 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/src/gl/m4/snprintf.m4 b/src/gl/m4/snprintf.m4 index 8ae70050c8..f876b55995 100644 --- a/src/gl/m4/snprintf.m4 +++ b/src/gl/m4/snprintf.m4 @@ -1,5 +1,5 @@ # snprintf.m4 serial 6 -dnl Copyright (C) 2002-2004, 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2016 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/src/gl/m4/socketlib.m4 b/src/gl/m4/socketlib.m4 index 9341739552..5da64fcaca 100644 --- a/src/gl/m4/socketlib.m4 +++ b/src/gl/m4/socketlib.m4 @@ -1,5 +1,5 @@ # socketlib.m4 serial 1 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2016 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/src/gl/m4/sockets.m4 b/src/gl/m4/sockets.m4 index e75ac02b25..7e77a62e88 100644 --- a/src/gl/m4/sockets.m4 +++ b/src/gl/m4/sockets.m4 @@ -1,5 +1,5 @@ # sockets.m4 serial 7 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2016 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/src/gl/m4/socklen.m4 b/src/gl/m4/socklen.m4 index bcabed3ef0..634c43a35c 100644 --- a/src/gl/m4/socklen.m4 +++ b/src/gl/m4/socklen.m4 @@ -1,5 +1,5 @@ # socklen.m4 serial 10 -dnl Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2016 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/src/gl/m4/sockpfaf.m4 b/src/gl/m4/sockpfaf.m4 index 50eb7619da..dce8b8f01e 100644 --- a/src/gl/m4/sockpfaf.m4 +++ b/src/gl/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ # sockpfaf.m4 serial 8 -dnl Copyright (C) 2004, 2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2016 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/src/gl/m4/ssize_t.m4 b/src/gl/m4/ssize_t.m4 index 25bd451434..3e7b9e6e02 100644 --- a/src/gl/m4/ssize_t.m4 +++ b/src/gl/m4/ssize_t.m4 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2016 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/src/gl/m4/stdalign.m4 b/src/gl/m4/stdalign.m4 index 033b0d39e4..49980cd636 100644 --- a/src/gl/m4/stdalign.m4 +++ b/src/gl/m4/stdalign.m4 @@ -1,6 +1,6 @@ # Check for stdalign.h that conforms to C11. -dnl Copyright 2011-2015 Free Software Foundation, Inc. +dnl Copyright 2011-2016 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/src/gl/m4/stdbool.m4 b/src/gl/m4/stdbool.m4 index 7273b82246..2a9b1db86f 100644 --- a/src/gl/m4/stdbool.m4 +++ b/src/gl/m4/stdbool.m4 @@ -1,11 +1,11 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2016 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 +#serial 7 # Prepare for substituting <stdbool.h> if it is not supported. @@ -43,56 +43,64 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [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" + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #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 #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; bool u: 1; bool v; } 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]; /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; + char f[(Bool) 0.0 == false ? 1 : -1]; char g[true]; - char h[sizeof (_Bool)]; + 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]; + 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]; + 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 q = true; + Bool *pq = &q; + bool *qq = &q; ]], [[ bool e = &s; - *pq |= q; - *pq |= ! q; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! 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); + + !m + !n + !o + !p + !q + !pq + !qq); ]])], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) diff --git a/src/gl/m4/stddef_h.m4 b/src/gl/m4/stddef_h.m4 index 231050274a..c045c65f9f 100644 --- a/src/gl/m4/stddef_h.m4 +++ b/src/gl/m4/stddef_h.m4 @@ -1,6 +1,6 @@ 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 Copyright (C) 2009-2016 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/src/gl/m4/stdint.m4 b/src/gl/m4/stdint.m4 index 4011a4942a..05b6ab7846 100644 --- a/src/gl/m4/stdint.m4 +++ b/src/gl/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 43 -dnl Copyright (C) 2001-2015 Free Software Foundation, Inc. +# stdint.m4 serial 48 +dnl Copyright (C) 2001-2016 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,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl + AC_REQUIRE([gl_LIMITS_H]) + dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test $ac_cv_type_long_long_int = yes; then @@ -70,6 +72,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include <stdint.h> /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -150,6 +154,15 @@ uintptr_t h = UINTPTR_MAX; intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include <limits.h> /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) @@ -218,6 +231,8 @@ struct s { AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include <stdint.h> ] gl_STDINT_INCLUDES @@ -278,28 +293,74 @@ static const char *macro_values[] = ]) ]) fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= + HAVE_C99_STDINT_H=1 + dnl Now see whether the system <stdint.h> works without + dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. + AC_CACHE_CHECK([whether stdint.h predates C++11], + [gl_cv_header_stdint_predates_cxx11_h], + [gl_cv_header_stdint_predates_cxx11_h=yes + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include <stdint.h> +] +gl_STDINT_INCLUDES +[ +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + ]])], + [gl_cv_header_stdint_predates_cxx11_h=no])]) + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + AC_DEFINE([__STDC_CONSTANT_MACROS], [1], + [Define to 1 if the system <stdint.h> predates C++11.]) + AC_DEFINE([__STDC_LIMIT_MACROS], [1], + [Define to 1 if the system <stdint.h> predates C++11.]) + fi + AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], + [gl_cv_header_stdint_width], + [gl_cv_header_stdint_width=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include <stdint.h> + ]gl_STDINT_INCLUDES[ + int iw = UINTMAX_WIDTH; + ]])], + [gl_cv_header_stdint_width=yes])]) + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi else dnl Check for <sys/inttypes.h>, and for dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 fi - AC_SUBST([HAVE_SYS_INTTYPES_H]) if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 fi - AC_SUBST([HAVE_SYS_BITYPES_H]) - gl_STDINT_TYPE_PROPERTIES - STDINT_H=stdint.h fi + + # The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. + LIMITS_H=limits.h + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) + + AC_SUBST([HAVE_C99_STDINT_H]) + AC_SUBST([HAVE_SYS_BITYPES_H]) + AC_SUBST([HAVE_SYS_INTTYPES_H]) AC_SUBST([STDINT_H]) AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) @@ -477,8 +538,3 @@ dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) - -# Hey Emacs! -# Local Variables: -# indent-tabs-mode: nil -# End: diff --git a/src/gl/m4/stdint_h.m4 b/src/gl/m4/stdint_h.m4 index 5097c0b0dc..f823b94c33 100644 --- a/src/gl/m4/stdint_h.m4 +++ b/src/gl/m4/stdint_h.m4 @@ -1,5 +1,5 @@ # stdint_h.m4 serial 9 -dnl Copyright (C) 1997-2004, 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2016 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/src/gl/m4/stdio_h.m4 b/src/gl/m4/stdio_h.m4 index f60cc2156e..eaa25a01d4 100644 --- a/src/gl/m4/stdio_h.m4 +++ b/src/gl/m4/stdio_h.m4 @@ -1,14 +1,18 @@ -# stdio_h.m4 serial 46 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +# stdio_h.m4 serial 48 +dnl Copyright (C) 2007-2016 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]) - + AH_VERBATIM([MINGW_ANSI_STDIO], +[/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) + AC_DEFINE([__USE_MINGW_ANSI_STDIO]) AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) diff --git a/src/gl/m4/stdlib_h.m4 b/src/gl/m4/stdlib_h.m4 index 0b4c623ec7..3999068153 100644 --- a/src/gl/m4/stdlib_h.m4 +++ b/src/gl/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 42 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +# stdlib_h.m4 serial 43 +dnl Copyright (C) 2007-2016 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. @@ -21,7 +21,7 @@ AC_DEFUN([gl_STDLIB_H], #endif ]], [_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 + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv]) ]) @@ -85,6 +85,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], 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_QSORT_R=1; AC_SUBST([HAVE_QSORT_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]) diff --git a/src/gl/m4/strdup.m4 b/src/gl/m4/strdup.m4 index 90ea29d22f..ff7060abd3 100644 --- a/src/gl/m4/strdup.m4 +++ b/src/gl/m4/strdup.m4 @@ -1,6 +1,6 @@ # strdup.m4 serial 13 -dnl Copyright (C) 2002-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/src/gl/m4/strerror.m4 b/src/gl/m4/strerror.m4 index 75a17f2012..e286594b58 100644 --- a/src/gl/m4/strerror.m4 +++ b/src/gl/m4/strerror.m4 @@ -1,5 +1,5 @@ # strerror.m4 serial 17 -dnl Copyright (C) 2002, 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2016 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/src/gl/m4/strftime.m4 b/src/gl/m4/strftime.m4 new file mode 100644 index 0000000000..9598e7272e --- /dev/null +++ b/src/gl/m4/strftime.m4 @@ -0,0 +1,28 @@ +# serial 33 + +# Copyright (C) 1996-1997, 1999-2007, 2009-2016 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Written by Jim Meyering and Paul Eggert. + +AC_DEFUN([gl_FUNC_GNU_STRFTIME], +[ + gl_FUNC_STRFTIME +]) + +# These are the prerequisite macros for GNU's strftime.c replacement. +AC_DEFUN([gl_FUNC_STRFTIME], +[ + # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. + AC_REQUIRE([AC_STRUCT_TIMEZONE]) + + AC_REQUIRE([gl_TM_GMTOFF]) + + AC_CHECK_FUNCS_ONCE([tzset]) + + AC_DEFINE([my_strftime], [nstrftime], + [Define to the name of the strftime replacement function.]) +]) diff --git a/src/gl/m4/string_h.m4 b/src/gl/m4/string_h.m4 index 55d09ef407..0c5ec6f9a0 100644 --- a/src/gl/m4/string_h.m4 +++ b/src/gl/m4/string_h.m4 @@ -1,6 +1,6 @@ # Configure a GNU-like replacement for <string.h>. -# Copyright (C) 2007-2015 Free Software Foundation, Inc. +# Copyright (C) 2007-2016 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. diff --git a/src/gl/m4/sys_select_h.m4 b/src/gl/m4/sys_select_h.m4 index 5ec5919f25..23526e5f56 100644 --- a/src/gl/m4/sys_select_h.m4 +++ b/src/gl/m4/sys_select_h.m4 @@ -1,5 +1,5 @@ # sys_select_h.m4 serial 20 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2016 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/src/gl/m4/sys_socket_h.m4 b/src/gl/m4/sys_socket_h.m4 index eaeabe7d96..ae500c7605 100644 --- a/src/gl/m4/sys_socket_h.m4 +++ b/src/gl/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 23 -dnl Copyright (C) 2005-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2016 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/src/gl/m4/sys_stat_h.m4 b/src/gl/m4/sys_stat_h.m4 index 6c909e816a..3d43b6f5ef 100644 --- a/src/gl/m4/sys_stat_h.m4 +++ b/src/gl/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ # sys_stat_h.m4 serial 28 -*- Autoconf -*- -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2016 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/src/gl/m4/sys_time_h.m4 b/src/gl/m4/sys_time_h.m4 index 28c8b1acbb..3061a9c185 100644 --- a/src/gl/m4/sys_time_h.m4 +++ b/src/gl/m4/sys_time_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for <sys/time.h>. # serial 8 -# Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2016 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. diff --git a/src/gl/m4/sys_types_h.m4 b/src/gl/m4/sys_types_h.m4 index 2232aece63..159b005b3d 100644 --- a/src/gl/m4/sys_types_h.m4 +++ b/src/gl/m4/sys_types_h.m4 @@ -1,5 +1,5 @@ -# sys_types_h.m4 serial 5 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +# sys_types_h.m4 serial 6 +dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,3 +22,28 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ ]) + +# This works around a buggy version in autoconf <= 2.69. +# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html> + +m4_version_prereq([2.70], [], [ + +# This is taken from the following Autoconf patch: +# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 + +m4_undefine([AC_HEADER_MAJOR]) +AC_DEFUN([AC_HEADER_MAJOR], +[AC_CHECK_HEADERS_ONCE([sys/types.h]) +AC_CHECK_HEADER([sys/mkdev.h], + [AC_DEFINE([MAJOR_IN_MKDEV], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + <mkdev.h>.])]) +if test $ac_cv_header_sys_mkdev_h = no; then + AC_CHECK_HEADER([sys/sysmacros.h], + [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + <sysmacros.h>.])]) +fi +]) + +]) diff --git a/src/gl/m4/sys_uio_h.m4 b/src/gl/m4/sys_uio_h.m4 index 3dfbcbe6e6..d4d967fd57 100644 --- a/src/gl/m4/sys_uio_h.m4 +++ b/src/gl/m4/sys_uio_h.m4 @@ -1,5 +1,5 @@ # sys_uio_h.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2016 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/src/gl/m4/time_h.m4 b/src/gl/m4/time_h.m4 index 754b469a0d..eb2a631e2c 100644 --- a/src/gl/m4/time_h.m4 +++ b/src/gl/m4/time_h.m4 @@ -1,6 +1,6 @@ # Configure a more-standard replacement for <time.h>. -# Copyright (C) 2000-2001, 2003-2007, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc. # serial 9 diff --git a/src/gl/m4/time_r.m4 b/src/gl/m4/time_r.m4 index 8df7e139cf..21b4a2cc18 100644 --- a/src/gl/m4/time_r.m4 +++ b/src/gl/m4/time_r.m4 @@ -1,6 +1,6 @@ dnl Reentrant time functions: localtime_r, gmtime_r. -dnl Copyright (C) 2003, 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006-2016 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/src/gl/m4/time_rz.m4 b/src/gl/m4/time_rz.m4 new file mode 100644 index 0000000000..9b1db1b24b --- /dev/null +++ b/src/gl/m4/time_rz.m4 @@ -0,0 +1,21 @@ +dnl Time zone functions: tzalloc, localtime_rz, etc. + +dnl Copyright (C) 2015-2016 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_TIME_RZ], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + AC_REQUIRE([AC_STRUCT_TIMEZONE]) + AC_CHECK_FUNCS_ONCE([tzset]) + + AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]]) + if test "$ac_cv_type_timezone_t" = yes; then + HAVE_TIMEZONE_T=1 + fi +]) diff --git a/src/gl/m4/timegm.m4 b/src/gl/m4/timegm.m4 new file mode 100644 index 0000000000..752aa43d7e --- /dev/null +++ b/src/gl/m4/timegm.m4 @@ -0,0 +1,26 @@ +# timegm.m4 serial 11 +dnl Copyright (C) 2003, 2007, 2009-2016 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_TIMEGM], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MKTIME]) + REPLACE_TIMEGM=0 + AC_CHECK_FUNCS_ONCE([timegm]) + if test $ac_cv_func_timegm = yes; then + if test $gl_cv_func_working_mktime = no; then + # Assume that timegm is buggy if mktime is. + REPLACE_TIMEGM=1 + fi + else + HAVE_TIMEGM=0 + fi +]) + +# Prerequisites of lib/timegm.c. +AC_DEFUN([gl_PREREQ_TIMEGM], [ + : +]) diff --git a/src/gl/m4/timespec.m4 b/src/gl/m4/timespec.m4 index 06b3533e42..2482518124 100644 --- a/src/gl/m4/timespec.m4 +++ b/src/gl/m4/timespec.m4 @@ -1,6 +1,6 @@ #serial 15 -# Copyright (C) 2000-2001, 2003-2007, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/gl/m4/tm_gmtoff.m4 b/src/gl/m4/tm_gmtoff.m4 index 71a88f92f4..ce0671fd1f 100644 --- a/src/gl/m4/tm_gmtoff.m4 +++ b/src/gl/m4/tm_gmtoff.m4 @@ -1,5 +1,5 @@ # tm_gmtoff.m4 serial 3 -dnl Copyright (C) 2002, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2009-2016 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/src/gl/m4/unistd_h.m4 b/src/gl/m4/unistd_h.m4 index b3c581f7b2..544dadb412 100644 --- a/src/gl/m4/unistd_h.m4 +++ b/src/gl/m4/unistd_h.m4 @@ -1,5 +1,5 @@ # unistd_h.m4 serial 68 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2016 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/src/gl/m4/vasnprintf.m4 b/src/gl/m4/vasnprintf.m4 index 4708f2b8e2..2d4b46310b 100644 --- a/src/gl/m4/vasnprintf.m4 +++ b/src/gl/m4/vasnprintf.m4 @@ -1,5 +1,5 @@ # vasnprintf.m4 serial 36 -dnl Copyright (C) 2002-2004, 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006-2016 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/src/gl/m4/warn-on-use.m4 b/src/gl/m4/warn-on-use.m4 index 1e98dc9b77..08440ec593 100644 --- a/src/gl/m4/warn-on-use.m4 +++ b/src/gl/m4/warn-on-use.m4 @@ -1,5 +1,5 @@ # warn-on-use.m4 serial 5 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2016 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/src/gl/m4/wchar_h.m4 b/src/gl/m4/wchar_h.m4 index 9d1b0f8b6d..16017a59fb 100644 --- a/src/gl/m4/wchar_h.m4 +++ b/src/gl/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-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2016 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 39 +# wchar_h.m4 serial 40 AC_DEFUN([gl_WCHAR_H], [ @@ -81,8 +81,14 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK], extern int zero (void); int main () { return zero(); } ]])]) + dnl Do not rename the object file from conftest.$ac_objext to + dnl conftest1.$ac_objext, as this will cause the link to fail on + dnl z/OS when using the XPLINK object format (due to duplicate + dnl CSECT names). Instead, temporarily redefine $ac_compile so + dnl that the object file has the latter name from the start. + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` if AC_TRY_EVAL([ac_compile]); then - 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 @@ -95,8 +101,9 @@ int main () { return zero(); } #include <wchar.h> int zero (void) { return 0; } ]])]) + dnl See note above about renaming object files. + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` if AC_TRY_EVAL([ac_compile]); then - mv conftest.$ac_objext conftest2.$ac_objext if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then : else @@ -104,6 +111,7 @@ int zero (void) { return 0; } fi fi fi + ac_compile="$save_ac_compile" rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext ]) if test $gl_cv_header_wchar_h_correct_inline = no; then diff --git a/src/gl/m4/wchar_t.m4 b/src/gl/m4/wchar_t.m4 index dc964e67e2..2db8c3f2f6 100644 --- a/src/gl/m4/wchar_t.m4 +++ b/src/gl/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2016 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/src/gl/m4/wint_t.m4 b/src/gl/m4/wint_t.m4 index ca3fd449a1..8ff2a5b5a2 100644 --- a/src/gl/m4/wint_t.m4 +++ b/src/gl/m4/wint_t.m4 @@ -1,5 +1,5 @@ # wint_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2016 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/src/gl/m4/xalloc.m4 b/src/gl/m4/xalloc.m4 index 6dfcab3c90..f4f540d118 100644 --- a/src/gl/m4/xalloc.m4 +++ b/src/gl/m4/xalloc.m4 @@ -1,5 +1,5 @@ # xalloc.m4 serial 18 -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2016 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/src/gl/m4/xsize.m4 b/src/gl/m4/xsize.m4 index 98faf7de0b..16764e89dd 100644 --- a/src/gl/m4/xsize.m4 +++ b/src/gl/m4/xsize.m4 @@ -1,5 +1,5 @@ # xsize.m4 serial 5 -dnl Copyright (C) 2003-2004, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2004, 2008-2016 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. |