diff options
Diffstat (limited to 'gdb/gnulib/import/m4')
137 files changed, 2617 insertions, 1005 deletions
diff --git a/gdb/gnulib/import/m4/00gnulib.m4 b/gdb/gnulib/import/m4/00gnulib.m4 index bb37e32..bd24796 100644 --- a/gdb/gnulib/import/m4/00gnulib.m4 +++ b/gdb/gnulib/import/m4/00gnulib.m4 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 3 -dnl Copyright (C) 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/__inline.m4 b/gdb/gnulib/import/m4/__inline.m4 new file mode 100644 index 0000000..3d0c479 --- /dev/null +++ b/gdb/gnulib/import/m4/__inline.m4 @@ -0,0 +1,22 @@ +# Test for __inline keyword +dnl Copyright 2017-2018 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl___INLINE], +[ + AC_CACHE_CHECK([whether the compiler supports the __inline keyword], + [gl_cv_c___inline], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[typedef int foo_t; + static __inline foo_t foo (void) { return 0; }]], + [[return foo ();]])], + [gl_cv_c___inline=yes], + [gl_cv_c___inline=no])]) + if test $gl_cv_c___inline = yes; then + AC_DEFINE([HAVE___INLINE], [1], + [Define to 1 if the compiler supports the keyword '__inline'.]) + fi +]) diff --git a/gdb/gnulib/import/m4/absolute-header.m4 b/gdb/gnulib/import/m4/absolute-header.m4 index 7ffc38d..4e67e5f 100644 --- a/gdb/gnulib/import/m4/absolute-header.m4 +++ b/gdb/gnulib/import/m4/absolute-header.m4 @@ -1,5 +1,5 @@ # absolute-header.m4 serial 16 -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/alloca.m4 b/gdb/gnulib/import/m4/alloca.m4 index 2382ff1..b9d94e8 100644 --- a/gdb/gnulib/import/m4/alloca.m4 +++ b/gdb/gnulib/import/m4/alloca.m4 @@ -1,5 +1,5 @@ # alloca.m4 serial 14 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation, +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2018 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, @@ -44,12 +44,12 @@ AC_DEFUN([gl_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>. +# See <https://lists.gnu.org/r/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 +# https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497 # _AC_LIBOBJ_ALLOCA # ----------------- diff --git a/gdb/gnulib/import/m4/builtin-expect.m4 b/gdb/gnulib/import/m4/builtin-expect.m4 new file mode 100644 index 0000000..a1eaf96 --- /dev/null +++ b/gdb/gnulib/import/m4/builtin-expect.m4 @@ -0,0 +1,49 @@ +dnl Check for __builtin_expect. + +dnl Copyright 2016-2018 Free Software Foundation, Inc. +dnl This file is free software; the Free 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___BUILTIN_EXPECT], +[ + AC_CACHE_CHECK([for __builtin_expect], + [gl_cv___builtin_expect], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + }]])], + [gl_cv___builtin_expect=yes], + [AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + #include <builtins.h> + int + main (int argc, char **argv) + { + argc = __builtin_expect (argc, 100); + return argv[argc != 100][0]; + }]])], + [gl_cv___builtin_expect="in <builtins.h>"], + [gl_cv___builtin_expect=no])])]) + if test "$gl_cv___builtin_expect" = yes; then + AC_DEFINE([HAVE___BUILTIN_EXPECT], [1]) + elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then + AC_DEFINE([HAVE___BUILTIN_EXPECT], [2]) + fi + AH_VERBATIM([HAVE___BUILTIN_EXPECT], + [/* Define to 1 if the compiler supports __builtin_expect, + and to 2 if <builtins.h> does. */ +#undef HAVE___BUILTIN_EXPECT +#ifndef HAVE___BUILTIN_EXPECT +# define __builtin_expect(e, c) (e) +#elif HAVE___BUILTIN_EXPECT == 2 +# include <builtins.h> +#endif + ]) +]) diff --git a/gdb/gnulib/import/m4/canonicalize.m4 b/gdb/gnulib/import/m4/canonicalize.m4 index cbbf3e2..0c23894 100644 --- a/gdb/gnulib/import/m4/canonicalize.m4 +++ b/gdb/gnulib/import/m4/canonicalize.m4 @@ -1,6 +1,6 @@ -# canonicalize.m4 serial 28 +# canonicalize.m4 serial 29 -dnl Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,8 +35,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL], HAVE_REALPATH=0 else case "$gl_cv_func_realpath_works" in - *yes) ;; - *) REPLACE_REALPATH=1 ;; + *yes) ;; + *) REPLACE_REALPATH=1 ;; esac fi else @@ -113,6 +113,8 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_realpath_works="guessing no" ;; # If we don't know, assume the worst. *) gl_cv_func_realpath_works="guessing no" ;; esac diff --git a/gdb/gnulib/import/m4/chdir-long.m4 b/gdb/gnulib/import/m4/chdir-long.m4 index 85e7a22..46dbbc4 100644 --- a/gdb/gnulib/import/m4/chdir-long.m4 +++ b/gdb/gnulib/import/m4/chdir-long.m4 @@ -1,4 +1,4 @@ -#serial 15 +#serial 16 # Use Gnulib's robust chdir function. # It can handle arbitrarily long directory names, which means @@ -6,7 +6,7 @@ # never fails with ENAMETOOLONG. # Arrange to compile chdir-long.c only on systems that define PATH_MAX. -dnl Copyright (C) 2004-2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,14 +17,14 @@ AC_DEFUN([gl_FUNC_CHDIR_LONG], [ AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ]) AC_CACHE_CHECK([whether this system has an arbitrary file name length limit], - gl_cv_have_arbitrary_file_name_length_limit, + [gl_cv_have_arbitrary_file_name_length_limit], [AC_EGREP_CPP([have_arbitrary_file_name_length_limit], gl_PATHMAX_SNIPPET[ #ifdef PATH_MAX have_arbitrary_file_name_length_limit #endif], - gl_cv_have_arbitrary_file_name_length_limit=yes, - gl_cv_have_arbitrary_file_name_length_limit=no)]) + [gl_cv_have_arbitrary_file_name_length_limit=yes], + [gl_cv_have_arbitrary_file_name_length_limit=no])]) ]) AC_DEFUN([gl_PREREQ_CHDIR_LONG], [:]) diff --git a/gdb/gnulib/import/m4/close.m4 b/gdb/gnulib/import/m4/close.m4 index 310f076..f11b17e 100644 --- a/gdb/gnulib/import/m4/close.m4 +++ b/gdb/gnulib/import/m4/close.m4 @@ -1,5 +1,5 @@ -# close.m4 serial 8 -dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. +# close.m4 serial 9 +dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_CLOSE], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) - AC_REQUIRE([gl_MSVC_INVAL]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - REPLACE_CLOSE=1 - fi + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + ]) m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [ gl_PREREQ_SYS_H_WINSOCK2 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then diff --git a/gdb/gnulib/import/m4/closedir.m4 b/gdb/gnulib/import/m4/closedir.m4 index 0c9fd82..338b5a7 100644 --- a/gdb/gnulib/import/m4/closedir.m4 +++ b/gdb/gnulib/import/m4/closedir.m4 @@ -1,5 +1,5 @@ -# closedir.m4 serial 5 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +# closedir.m4 serial 6 +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_CLOSEDIR], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS([closedir]) if test $ac_cv_func_closedir = no; then diff --git a/gdb/gnulib/import/m4/configmake.m4 b/gdb/gnulib/import/m4/configmake.m4 deleted file mode 100644 index 80b9254..0000000 --- a/gdb/gnulib/import/m4/configmake.m4 +++ /dev/null @@ -1,55 +0,0 @@ -# configmake.m4 serial 2 -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. - -# 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/gdb/gnulib/import/m4/d-ino.m4 b/gdb/gnulib/import/m4/d-ino.m4 index f3ce54c..4f8b1a2 100644 --- a/gdb/gnulib/import/m4/d-ino.m4 +++ b/gdb/gnulib/import/m4/d-ino.m4 @@ -1,11 +1,11 @@ -# serial 15 +# serial 18 dnl From Jim Meyering. dnl dnl Check whether struct dirent has a member named d_ino. dnl -# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2016 Free Software +# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2018 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation @@ -15,7 +15,7 @@ dnl AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], [AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([for d_ino member in directory struct], - gl_cv_struct_dirent_d_ino, + [gl_cv_struct_dirent_d_ino], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include <sys/types.h> @@ -29,11 +29,11 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], return 1; e = readdir (dp); if (! e) - return 2; + { closedir (dp); return 2; } if (lstat (e->d_name, &st) != 0) - return 3; + { closedir (dp); return 3; } if (e->d_ino != st.st_ino) - return 4; + { closedir (dp); return 4; } closedir (dp); return 0; ]])], @@ -42,6 +42,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], [case "$host_os" in # Guess yes on glibc systems with Linux kernel. linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;; # If we don't know, assume the worst. *) gl_cv_struct_dirent_d_ino="guessing no" ;; esac diff --git a/gdb/gnulib/import/m4/d-type.m4 b/gdb/gnulib/import/m4/d-type.m4 index eda762c..ab6463d 100644 --- a/gdb/gnulib/import/m4/d-type.m4 +++ b/gdb/gnulib/import/m4/d-type.m4 @@ -1,11 +1,11 @@ -# serial 11 +# serial 12 dnl From Jim Meyering. dnl dnl Check whether struct dirent has a member named d_type. dnl -# Copyright (C) 1997, 1999-2004, 2006, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999-2004, 2006, 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,7 @@ dnl AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE], [AC_CACHE_CHECK([for d_type member in directory struct], - gl_cv_struct_dirent_d_type, + [gl_cv_struct_dirent_d_type], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <dirent.h> diff --git a/gdb/gnulib/import/m4/dirent_h.m4 b/gdb/gnulib/import/m4/dirent_h.m4 index 68836a4..b054a92 100644 --- a/gdb/gnulib/import/m4/dirent_h.m4 +++ b/gdb/gnulib/import/m4/dirent_h.m4 @@ -1,5 +1,5 @@ # dirent_h.m4 serial 16 -dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/dirfd.m4 b/gdb/gnulib/import/m4/dirfd.m4 index 1d7cb08..48589b9 100644 --- a/gdb/gnulib/import/m4/dirfd.m4 +++ b/gdb/gnulib/import/m4/dirfd.m4 @@ -1,8 +1,8 @@ -# serial 24 -*- Autoconf -*- +# serial 26 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. -# Copyright (C) 2001-2006, 2008-2016 Free Software Foundation, Inc. +# Copyright (C) 2001-2006, 2008-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,6 +12,7 @@ dnl From Jim Meyering AC_DEFUN([gl_FUNC_DIRFD], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc <dirent.h> to declare dirfd(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) @@ -25,15 +26,15 @@ AC_DEFUN([gl_FUNC_DIRFD], fi AC_CACHE_CHECK([whether dirfd is a macro], - gl_cv_func_dirfd_macro, + [gl_cv_func_dirfd_macro], [AC_EGREP_CPP([dirent_header_defines_dirfd], [ #include <sys/types.h> #include <dirent.h> #ifdef dirfd dirent_header_defines_dirfd #endif], - gl_cv_func_dirfd_macro=yes, - gl_cv_func_dirfd_macro=no)]) + [gl_cv_func_dirfd_macro=yes], + [gl_cv_func_dirfd_macro=no])]) # Use the replacement if we have no function or macro with that name, # or if OS/2 kLIBC whose dirfd() does not work. diff --git a/gdb/gnulib/import/m4/dirname.m4 b/gdb/gnulib/import/m4/dirname.m4 index 6f8bec3..820b047 100644 --- a/gdb/gnulib/import/m4/dirname.m4 +++ b/gdb/gnulib/import/m4/dirname.m4 @@ -1,5 +1,5 @@ #serial 10 -*- autoconf -*- -dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/double-slash-root.m4 b/gdb/gnulib/import/m4/double-slash-root.m4 index dfd3921..e99d4a3 100644 --- a/gdb/gnulib/import/m4/double-slash-root.m4 +++ b/gdb/gnulib/import/m4/double-slash-root.m4 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/dup.m4 b/gdb/gnulib/import/m4/dup.m4 index e30348c..ec04d69 100644 --- a/gdb/gnulib/import/m4/dup.m4 +++ b/gdb/gnulib/import/m4/dup.m4 @@ -1,5 +1,5 @@ -# dup.m4 serial 4 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +# dup.m4 serial 6 +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,10 +7,13 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_DUP], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) - AC_REQUIRE([gl_MSVC_INVAL]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - REPLACE_DUP=1 - fi + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_DUP=1 + fi + ]) dnl Replace dup() for supporting the gnulib-defined fchdir() function, dnl to keep fchdir's bookkeeping up-to-date. m4_ifdef([gl_FUNC_FCHDIR], [ @@ -31,7 +34,12 @@ AC_DEFUN([gl_FUNC_DUP], ], [gl_cv_func_dup_works=yes], [gl_cv_func_dup_works=no], - [gl_cv_func_dup_works='guessing yes']) + [case "$host_os" in + # Guess no on native Windows. + mingw*) gl_cv_func_dup_works="guessing no" ;; + *) gl_cv_func_dup_works="guessing yes" ;; + esac + ]) ]) case "$gl_cv_func_dup_works" in *yes) ;; diff --git a/gdb/gnulib/import/m4/dup2.m4 b/gdb/gnulib/import/m4/dup2.m4 index 5b68312..c785d37 100644 --- a/gdb/gnulib/import/m4/dup2.m4 +++ b/gdb/gnulib/import/m4/dup2.m4 @@ -1,5 +1,5 @@ #serial 25 -dnl Copyright (C) 2002, 2005, 2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005, 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/eealloc.m4 b/gdb/gnulib/import/m4/eealloc.m4 index 63d74de..a5a4e26 100644 --- a/gdb/gnulib/import/m4/eealloc.m4 +++ b/gdb/gnulib/import/m4/eealloc.m4 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/environ.m4 b/gdb/gnulib/import/m4/environ.m4 index 9a0ea7e..68b67ea 100644 --- a/gdb/gnulib/import/m4/environ.m4 +++ b/gdb/gnulib/import/m4/environ.m4 @@ -1,5 +1,5 @@ # environ.m4 serial 6 -dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/errno_h.m4 b/gdb/gnulib/import/m4/errno_h.m4 index b111fce..9dbdedd 100644 --- a/gdb/gnulib/import/m4/errno_h.m4 +++ b/gdb/gnulib/import/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 serial 12 -dnl Copyright (C) 2004, 2006, 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/error.m4 b/gdb/gnulib/import/m4/error.m4 index f772bcf..280fdce 100644 --- a/gdb/gnulib/import/m4/error.m4 +++ b/gdb/gnulib/import/m4/error.m4 @@ -1,6 +1,6 @@ #serial 14 -# Copyright (C) 1996-1998, 2001-2004, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2018 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/gdb/gnulib/import/m4/exponentd.m4 b/gdb/gnulib/import/m4/exponentd.m4 index 7869a7d..7b02a4c 100644 --- a/gdb/gnulib/import/m4/exponentd.m4 +++ b/gdb/gnulib/import/m4/exponentd.m4 @@ -1,5 +1,5 @@ # exponentd.m4 serial 3 -dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/exponentl.m4 b/gdb/gnulib/import/m4/exponentl.m4 index c49cf2c3..136fa61 100644 --- a/gdb/gnulib/import/m4/exponentl.m4 +++ b/gdb/gnulib/import/m4/exponentl.m4 @@ -1,11 +1,12 @@ -# exponentl.m4 serial 3 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# exponentl.m4 serial 4 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION], [ AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([where to find the exponent in a 'long double'], [gl_cv_cc_long_double_expbit0], [ @@ -79,9 +80,24 @@ int main () [gl_cv_cc_long_double_expbit0=`cat conftest.out`], [gl_cv_cc_long_double_expbit0="unknown"], [ - dnl When cross-compiling, we don't know. It depends on the + dnl When cross-compiling, in general we don't know. It depends on the dnl ABI and compiler version. There are too many cases. gl_cv_cc_long_double_expbit0="unknown" + case "$host_os" in + mingw*) # On native Windows (little-endian), we know the result + # in two cases: mingw, MSVC. + AC_EGREP_CPP([Known], [ +#ifdef __MINGW32__ + Known +#endif + ], [gl_cv_cc_long_double_expbit0="word 2 bit 0"]) + AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], [gl_cv_cc_long_double_expbit0="word 1 bit 20"]) + ;; + esac ]) rm -f conftest.out ]) diff --git a/gdb/gnulib/import/m4/extensions.m4 b/gdb/gnulib/import/m4/extensions.m4 index e114a6f..71a854f 100644 --- a/gdb/gnulib/import/m4/extensions.m4 +++ b/gdb/gnulib/import/m4/extensions.m4 @@ -1,7 +1,7 @@ -# serial 15 -*- Autoconf -*- +# serial 18 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2018 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. @@ -68,6 +68,14 @@ dnl configure.ac when using autoheader 2.62. #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif +/* Enable NetBSD extensions on NetBSD. */ +#ifndef _NETBSD_SOURCE +# undef _NETBSD_SOURCE +#endif +/* Enable OpenBSD extensions on NetBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS @@ -110,6 +118,11 @@ dnl configure.ac when using autoheader 2.62. #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ @@ -128,6 +141,8 @@ dnl configure.ac when using autoheader 2.62. AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) + AC_DEFINE([_NETBSD_SOURCE]) + AC_DEFINE([_OPENBSD_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) @@ -153,6 +168,7 @@ dnl configure.ac when using autoheader 2.62. [ac_cv_should_define__xopen_source=yes])])]) test $ac_cv_should_define__xopen_source = yes && AC_DEFINE([_XOPEN_SOURCE], [500]) + AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) ])# AC_USE_SYSTEM_EXTENSIONS # gl_USE_SYSTEM_EXTENSIONS diff --git a/gdb/gnulib/import/m4/extern-inline.m4 b/gdb/gnulib/import/m4/extern-inline.m4 index 1e578f3..3661cbd 100644 --- a/gdb/gnulib/import/m4/extern-inline.m4 +++ b/gdb/gnulib/import/m4/extern-inline.m4 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2016 Free Software Foundation, Inc. +dnl Copyright 2012-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE], [/* Please see the Gnulib manual for how to use these macros. Suppress extern inline with HP-UX cc, as it appears to be broken; see - <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. + <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>. Suppress extern inline with Sun C in standards-conformance mode, as it mishandles inline functions that call each other. E.g., for 'inline void f @@ -25,20 +25,32 @@ AC_DEFUN([gl_EXTERN_INLINE], if isdigit is mistakenly implemented via a static inline function, a program containing an extern inline function that calls isdigit may not work since the C standard prohibits extern inline functions - from calling static functions. This bug is known to occur on: + from calling static functions (ISO C 99 section 6.7.4.(3). + This bug is known to occur on: OS X 10.8 and earlier; see: - http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html + https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html DragonFly; see http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log FreeBSD; see: - http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html + https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and - for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. - Assume DragonFly and FreeBSD will be similar. */ + for clang but remains for g++; see <https://trac.macports.org/ticket/41033>. + Assume DragonFly and FreeBSD will be similar. + + GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. It defines a macro + __GNUC_STDC_INLINE__ to indicate this situation or a macro + __GNUC_GNU_INLINE__ to indicate the opposite situation. + GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline + semantics but warns, unless -fgnu89-inline is used: + warning: C99 inline functions are not supported; using GNU89 + warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute + It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. + */ #if (((defined __APPLE__ && defined __MACH__) \ || defined __DragonFly__ || defined __FreeBSD__) \ && (defined __header_inline \ diff --git a/gdb/gnulib/import/m4/fchdir.m4 b/gdb/gnulib/import/m4/fchdir.m4 index 4264166..470b228 100644 --- a/gdb/gnulib/import/m4/fchdir.m4 +++ b/gdb/gnulib/import/m4/fchdir.m4 @@ -1,5 +1,5 @@ -# fchdir.m4 serial 21 -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +# fchdir.m4 serial 24 +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -31,10 +31,14 @@ AC_DEFUN([gl_FUNC_FCHDIR], [gl_cv_func_open_directory_works=yes], [gl_cv_func_open_directory_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_open_directory_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_open_directory_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_open_directory_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_open_directory_works="guessing no" ;; esac ])]) case "$gl_cv_func_open_directory_works" in diff --git a/gdb/gnulib/import/m4/fcntl-o.m4 b/gdb/gnulib/import/m4/fcntl-o.m4 index 24fcf88..4dc3daa 100644 --- a/gdb/gnulib/import/m4/fcntl-o.m4 +++ b/gdb/gnulib/import/m4/fcntl-o.m4 @@ -1,5 +1,5 @@ -# fcntl-o.m4 serial 4 -dnl Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc. +# fcntl-o.m4 serial 5 +dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_FCNTL_O_FLAGS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_GNU_SOURCE])]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_FUNCS_ONCE([symlink]) AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], @@ -116,7 +117,13 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( *) gl_cv_header_working_fcntl_h='no';; esac], - [gl_cv_header_working_fcntl_h=cross-compiling])]) + [case "$host_os" in + # Guess 'no' on native Windows. + mingw*) gl_cv_header_working_fcntl_h='no' ;; + *) gl_cv_header_working_fcntl_h=cross-compiling ;; + esac + ]) + ]) case $gl_cv_header_working_fcntl_h in #( *O_NOATIME* | no | cross-compiling) ac_val=0;; #( diff --git a/gdb/gnulib/import/m4/fcntl.m4 b/gdb/gnulib/import/m4/fcntl.m4 index bb61470..46b2445 100644 --- a/gdb/gnulib/import/m4/fcntl.m4 +++ b/gdb/gnulib/import/m4/fcntl.m4 @@ -1,5 +1,5 @@ # fcntl.m4 serial 9 -dnl Copyright (C) 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/fcntl_h.m4 b/gdb/gnulib/import/m4/fcntl_h.m4 index ef0d78d..9fd3ab1 100644 --- a/gdb/gnulib/import/m4/fcntl_h.m4 +++ b/gdb/gnulib/import/m4/fcntl_h.m4 @@ -1,6 +1,6 @@ # serial 15 # Configure fcntl.h. -dnl Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/fdopendir.m4 b/gdb/gnulib/import/m4/fdopendir.m4 index cadbee3..df44d5e 100644 --- a/gdb/gnulib/import/m4/fdopendir.m4 +++ b/gdb/gnulib/import/m4/fdopendir.m4 @@ -1,7 +1,7 @@ # serial 10 # See if we need to provide fdopendir. -dnl Copyright (C) 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/filenamecat.m4 b/gdb/gnulib/import/m4/filenamecat.m4 index b794880..1387aeb 100644 --- a/gdb/gnulib/import/m4/filenamecat.m4 +++ b/gdb/gnulib/import/m4/filenamecat.m4 @@ -1,5 +1,5 @@ # filenamecat.m4 serial 11 -dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/flexmember.m4 b/gdb/gnulib/import/m4/flexmember.m4 index 155ae9b..db93cf3 100644 --- a/gdb/gnulib/import/m4/flexmember.m4 +++ b/gdb/gnulib/import/m4/flexmember.m4 @@ -1,7 +1,7 @@ -# serial 4 +# serial 5 # Check for flexible array member support. -# Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], [[#include <stdlib.h> #include <stdio.h> #include <stddef.h> - struct s { int n; double d[]; };]], + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; };]], [[int m = getchar (); size_t nbytes = offsetof (struct s, d) + m * sizeof (double); nbytes += sizeof (struct s) - 1; nbytes -= nbytes % sizeof (struct s); struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; p->d[0] = 0.0; return p->d != (double *) NULL;]])], [ac_cv_c_flexmember=yes], diff --git a/gdb/gnulib/import/m4/float_h.m4 b/gdb/gnulib/import/m4/float_h.m4 index e2887eb..02beb85 100644 --- a/gdb/gnulib/import/m4/float_h.m4 +++ b/gdb/gnulib/import/m4/float_h.m4 @@ -1,5 +1,5 @@ -# float_h.m4 serial 9 -dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc. +# float_h.m4 serial 12 +dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ AC_DEFUN([gl_FLOAT_H], aix* | beos* | openbsd* | mirbsd* | irix*) FLOAT_H=float.h ;; - freebsd*) + freebsd* | dragonfly*) case "$host_cpu" in changequote(,)dnl i[34567]86 ) @@ -24,10 +24,14 @@ changequote([,])dnl x86_64 ) # On x86_64 systems, the C compiler may still be generating # 32-bit code. - AC_EGREP_CPP([yes], - [#if defined __LP64__ || defined __x86_64__ || defined __amd64__ - yes - #endif], + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__ + int ok; + #else + error fail + #endif + ]])], [], [FLOAT_H=float.h]) ;; @@ -42,7 +46,7 @@ changequote([,])dnl ;; esac case "$host_os" in - aix* | freebsd* | linux*) + aix* | freebsd* | dragonfly* | linux*) if test -n "$FLOAT_H"; then REPLACE_FLOAT_LDBL=1 fi @@ -69,14 +73,20 @@ int main () [gl_cv_func_itold_works=no], [case "$host" in sparc*-*-linux*) - AC_EGREP_CPP([yes], - [#if defined __LP64__ || defined __arch64__ - yes - #endif], + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ || defined __arch64__ + int ok; + #else + error fail + #endif + ]])], [gl_cv_func_itold_works="guessing no"], [gl_cv_func_itold_works="guessing yes"]) ;; - *) gl_cv_func_itold_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_itold_works="guessing yes" ;; + *) gl_cv_func_itold_works="guessing yes" ;; esac ]) ]) diff --git a/gdb/gnulib/import/m4/fnmatch.m4 b/gdb/gnulib/import/m4/fnmatch.m4 index b38f56c..a61545a 100644 --- a/gdb/gnulib/import/m4/fnmatch.m4 +++ b/gdb/gnulib/import/m4/fnmatch.m4 @@ -1,6 +1,6 @@ -# Check for fnmatch - serial 9. -*- coding: utf-8 -*- +# Check for fnmatch - serial 13. -*- coding: utf-8 -*- -# Copyright (C) 2000-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2000-2007, 2009-2018 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. @@ -13,124 +13,120 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], [ m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX]) - dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc. - dnl This is only needed if gl_fnmatch_required = GNU. It would be possible - dnl to avoid this dependency for gl_FUNC_FNMATCH_POSIX by putting - dnl gl_FUNC_FNMATCH_GNU into a separate .m4 file. - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - - FNMATCH_H= + AC_REQUIRE([gl_FNMATCH_H]) gl_fnmatch_required_lowercase=` echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' ` - gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" - AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], - [$gl_fnmatch_cache_var], - [dnl Some versions of Solaris, SCO, and the GNU C Library - dnl have a broken or incompatible fnmatch. - dnl So we run a test program. If we are cross-compiling, take no chance. - dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this - dnl test. - if test $gl_fnmatch_required = GNU; then - gl_fnmatch_gnu_start= - gl_fnmatch_gnu_end= - else - gl_fnmatch_gnu_start='#if 0' - gl_fnmatch_gnu_end='#endif' - fi - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[#include <fnmatch.h> - static int - y (char const *pattern, char const *string, int flags) - { - return fnmatch (pattern, string, flags) == 0; - } - static int - n (char const *pattern, char const *string, int flags) - { - return fnmatch (pattern, string, flags) == FNM_NOMATCH; - } - ]], - [[char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; - char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; - static char const A_1[] = { 'A' - 1, 0 }; - static char const A01[] = { 'A' + 1, 0 }; - static char const a_1[] = { 'a' - 1, 0 }; - static char const a01[] = { 'a' + 1, 0 }; - static char const bs_1[] = { '\\\\' - 1, 0 }; - static char const bs01[] = { '\\\\' + 1, 0 }; - int result = 0; - if (!n ("a*", "", 0)) - return 1; - if (!y ("a*", "abc", 0)) - return 1; - if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ - return 1; - if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) - return 2; - if (!y ("a\\\\bc", "abc", 0)) - return 3; - if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) - return 3; - if (!y ("*x", ".x", 0)) - return 4; - if (!n ("*x", ".x", FNM_PERIOD)) - return 4; - if (!y (Apat, "\\\\", 0)) - return 5; - if (!y (Apat, "A", 0)) - return 5; - if (!y (apat, "\\\\", 0)) - return 5; - if (!y (apat, "a", 0)) - return 5; - if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) - return 5; - if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) - return 5; - if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) - return 5; - if (!(y (apat, a01, 0) == ('a' < '\\\\'))) - return 5; - if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) - return 5; - if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) - return 5; - if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) - return 5; - if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) - return 5; - $gl_fnmatch_gnu_start - if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) - result |= 8; - if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) - result |= 16; - if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) - result |= 32; - if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) - result |= 64; - if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) - result |= 64; - if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) - result |= 64; - $gl_fnmatch_gnu_end - return result; - ]])], - [eval "$gl_fnmatch_cache_var=yes"], - [eval "$gl_fnmatch_cache_var=no"], - [eval "$gl_fnmatch_cache_var=\"guessing no\""]) - ]) - eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" - if test "$gl_fnmatch_result" = yes; then - dnl Not strictly necessary. Only to avoid spurious leftover files if people - dnl don't do "make distclean". - rm -f "$gl_source_base/fnmatch.h" + AC_CHECK_FUNCS_ONCE([fnmatch]) + if test $ac_cv_func_fnmatch = no; then + HAVE_FNMATCH=0 else - FNMATCH_H=fnmatch.h + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], + [$gl_fnmatch_cache_var], + [dnl Some versions of Solaris, SCO, and the GNU C Library + dnl have a broken or incompatible fnmatch. + dnl So we run a test program. If we are cross-compiling, take no chance. + dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this + dnl test. + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <fnmatch.h> + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } + ]], + [[char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; + ]])], + [eval "$gl_fnmatch_cache_var=yes"], + [eval "$gl_fnmatch_cache_var=no"], + [eval "$gl_fnmatch_cache_var=\"guessing no\""]) + ]) + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" != yes; then + REPLACE_FNMATCH=1 + fi + fi + if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then + gl_REPLACE_FNMATCH_H fi - AC_SUBST([FNMATCH_H]) - AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) ]) # Request a POSIX compliant fnmatch function with GNU extensions. @@ -143,11 +139,6 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU], AC_DEFUN([gl_PREREQ_FNMATCH], [ - dnl We must choose a different name for our function, since on ELF systems - dnl a broken fnmatch() in libc.so would override our fnmatch() if it is - dnl compiled into a shared library. - AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch], - [Define to a replacement function name for fnmatch().]) dnl Prerequisites of lib/fnmatch.c. AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]]) diff --git a/gdb/gnulib/import/m4/fnmatch_h.m4 b/gdb/gnulib/import/m4/fnmatch_h.m4 new file mode 100644 index 0000000..077dfef --- /dev/null +++ b/gdb/gnulib/import/m4/fnmatch_h.m4 @@ -0,0 +1,75 @@ +# fnmatch_h.m4 serial 4 +dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. +dnl This file is free software; the Free 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_DEFUN_ONCE([gl_FNMATCH_H], +[ + AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) + AC_CHECK_HEADERS_ONCE([fnmatch.h]) + gl_CHECK_NEXT_HEADERS([fnmatch.h]) + + dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc. + dnl This is only needed if gl_fnmatch_required = GNU. It would be possible + dnl to avoid this dependency for gl_FUNC_FNMATCH_POSIX by putting + dnl gl_FUNC_FNMATCH_GNU into a separate .m4 file. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + if test $ac_cv_header_fnmatch_h = yes; then + HAVE_FNMATCH_H=1 + else + HAVE_FNMATCH_H=0 + fi + AC_SUBST([HAVE_FNMATCH_H]) + + m4_ifdef([gl_POSIXCHECK], + [FNMATCH_H=fnmatch.h], + [FNMATCH_H='' + if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then + dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE. + FNMATCH_H=fnmatch.h + else + if test $ac_cv_header_fnmatch_h != yes; then + dnl Provide a substitute <fnmatch.h> file. + FNMATCH_H=fnmatch.h + fi + fi + ]) + AC_SUBST([FNMATCH_H]) + AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_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 <fnmatch.h> + ]], + [fnmatch]) +]) + +dnl Unconditionally enables the replacement of <fnmatch.h>. +AC_DEFUN([gl_REPLACE_FNMATCH_H], +[ + AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) + FNMATCH_H='fnmatch.h' + AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) +]) + +AC_DEFUN([gl_FNMATCH_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FNMATCH_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_FNMATCH_H_DEFAULTS], +[ + GNULIB_FNMATCH=0; AC_SUBST([GNULIB_FNMATCH]) + dnl Assume POSIX behavior unless another module says otherwise. + HAVE_FNMATCH=1; AC_SUBST([HAVE_FNMATCH]) + REPLACE_FNMATCH=0; AC_SUBST([REPLACE_FNMATCH]) +]) diff --git a/gdb/gnulib/import/m4/fpieee.m4 b/gdb/gnulib/import/m4/fpieee.m4 index e11ac9f..b58840f 100644 --- a/gdb/gnulib/import/m4/fpieee.m4 +++ b/gdb/gnulib/import/m4/fpieee.m4 @@ -1,5 +1,5 @@ # fpieee.m4 serial 2 -*- coding: utf-8 -*- -dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -33,7 +33,7 @@ AC_DEFUN([gl_FP_IEEE], alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at - # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> + # <https://backdrift.org/man/tru64/man3/ieee.3.html> if test -n "$GCC"; then # GCC has the option -mieee. # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. diff --git a/gdb/gnulib/import/m4/frexp.m4 b/gdb/gnulib/import/m4/frexp.m4 index 23f5821..33e07f5 100644 --- a/gdb/gnulib/import/m4/frexp.m4 +++ b/gdb/gnulib/import/m4/frexp.m4 @@ -1,5 +1,5 @@ -# frexp.m4 serial 15 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# frexp.m4 serial 16 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -164,8 +164,17 @@ int main() [gl_cv_func_frexp_works=yes], [gl_cv_func_frexp_works=no], [case "$host_os" in - netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; - *) gl_cv_func_frexp_works="guessing yes";; + netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;; + mingw*) # Guess yes with MSVC, no with mingw. + AC_EGREP_CPP([Good], [ +#ifdef _MSC_VER + Good +#endif + ], + [gl_cv_func_frexp_works="guessing yes"], + [gl_cv_func_frexp_works="guessing no"]) + ;; + *) gl_cv_func_frexp_works="guessing yes" ;; esac ]) ]) diff --git a/gdb/gnulib/import/m4/frexpl.m4 b/gdb/gnulib/import/m4/frexpl.m4 index 0bc6afe..d7845d1 100644 --- a/gdb/gnulib/import/m4/frexpl.m4 +++ b/gdb/gnulib/import/m4/frexpl.m4 @@ -1,5 +1,5 @@ -# frexpl.m4 serial 20 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# frexpl.m4 serial 21 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -131,7 +131,7 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS], # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif -#if defined __i386__ && defined __FreeBSD__ +#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif diff --git a/gdb/gnulib/import/m4/fstat.m4 b/gdb/gnulib/import/m4/fstat.m4 index 29f9b81..f7fc383 100644 --- a/gdb/gnulib/import/m4/fstat.m4 +++ b/gdb/gnulib/import/m4/fstat.m4 @@ -1,22 +1,22 @@ -# fstat.m4 serial 4 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +# fstat.m4 serial 6 +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FSTAT], [ + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) - AC_REQUIRE([gl_MSVC_INVAL]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - REPLACE_FSTAT=1 - fi - - AC_REQUIRE([gl_HEADER_SYS_STAT_H]) - if test $WINDOWS_64_BIT_ST_SIZE = 1; then - REPLACE_FSTAT=1 - fi + case "$host_os" in + mingw* | solaris*) + dnl On MinGW, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + dnl Solaris stat can return a negative tv_nsec. + REPLACE_FSTAT=1 + ;; + esac dnl Replace fstat() for supporting the gnulib-defined open() on directories. m4_ifdef([gl_FUNC_FCHDIR], [ @@ -32,5 +32,8 @@ AC_DEFUN([gl_FUNC_FSTAT], ]) ]) -# Prerequisites of lib/fstat.c. -AC_DEFUN([gl_PREREQ_FSTAT], [:]) +# Prerequisites of lib/fstat.c and lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_FSTAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + : +]) diff --git a/gdb/gnulib/import/m4/fstatat.m4 b/gdb/gnulib/import/m4/fstatat.m4 index 84177f0..ac353bf 100644 --- a/gdb/gnulib/import/m4/fstatat.m4 +++ b/gdb/gnulib/import/m4/fstatat.m4 @@ -1,5 +1,5 @@ -# fstatat.m4 serial 3 -dnl Copyright (C) 2004-2016 Free Software Foundation, Inc. +# fstatat.m4 serial 4 +dnl Copyright (C) 2004-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,14 +13,14 @@ AC_DEFUN([gl_FUNC_FSTATAT], AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([fstatat]) if test $ac_cv_func_fstatat = no; then HAVE_FSTATAT=0 else dnl Test for an AIX 7.1 bug; see - dnl <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>. + dnl <https://lists.gnu.org/r/bug-tar/2011-09/msg00015.html>. AC_CACHE_CHECK([whether fstatat (..., 0) works], [gl_cv_func_fstatat_zero_flag], [AC_RUN_IFELSE( @@ -46,15 +46,20 @@ AC_DEFUN([gl_FUNC_FSTATAT], case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in *yes+*yes) ;; - *) REPLACE_FSTATAT=1 - case $gl_cv_func_fstatat_zero_flag in - *yes) + *) REPLACE_FSTATAT=1 ;; + esac + + case $host_os in + solaris*) + REPLACE_FSTATAT=1 ;; + esac + + case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in + 1,*yes) AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1], [Define to 1 if fstatat (..., 0) works. For example, it does not work in AIX 7.1.]) ;; - esac - ;; esac fi ]) diff --git a/gdb/gnulib/import/m4/getcwd-abort-bug.m4 b/gdb/gnulib/import/m4/getcwd-abort-bug.m4 index b73f474..8904360 100644 --- a/gdb/gnulib/import/m4/getcwd-abort-bug.m4 +++ b/gdb/gnulib/import/m4/getcwd-abort-bug.m4 @@ -1,9 +1,9 @@ -# serial 7 +# serial 9 # Determine whether getcwd aborts when the length of the working directory # name is unusually large. Any length between 4k and 16k trigger the bug # when using glibc-2.4.90-9 or older. -# Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2018 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. @@ -16,9 +16,15 @@ AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], AC_CHECK_DECLS_ONCE([getcwd]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ]) - AC_CHECK_FUNCS([getpagesize]) + + gl_CHECK_FUNC_GETPAGESIZE + if test $gl_cv_func_getpagesize = yes; then + AC_DEFINE_UNQUOTED([HAVE_GETPAGESIZE], [1], + [Define to 1 if the system has the 'getpagesize' function.]) + fi + AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k], - gl_cv_func_getcwd_abort_bug, + [gl_cv_func_getcwd_abort_bug], [# Remove any remnants of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. @@ -121,20 +127,20 @@ main () return fail; } ]])], - [gl_cv_func_getcwd_abort_bug=no], - [dnl An abort will provoke an exit code of something like 134 (128 + 6). - dnl An exit code of 4 can also occur (in OpenBSD 4.9, NetBSD 5.1 for - dnl example): getcwd (NULL, 0) fails rather than returning a string - dnl longer than PATH_MAX. This may be POSIX compliant (in some - dnl interpretations of POSIX). But gnulib's getcwd module wants to - dnl provide a non-NULL value in this case. - ret=$? - if test $ret -ge 128 || test $ret = 4; then - gl_cv_func_getcwd_abort_bug=yes - else - gl_cv_func_getcwd_abort_bug=no - fi], - [gl_cv_func_getcwd_abort_bug=yes]) - ]) + [gl_cv_func_getcwd_abort_bug=no], + [dnl An abort will provoke an exit code of something like 134 (128 + 6). + dnl An exit code of 4 can also occur (in OpenBSD 4.9, NetBSD 5.1 for + dnl example): getcwd (NULL, 0) fails rather than returning a string + dnl longer than PATH_MAX. This may be POSIX compliant (in some + dnl interpretations of POSIX). But gnulib's getcwd module wants to + dnl provide a non-NULL value in this case. + ret=$? + if test $ret -ge 128 || test $ret = 4; then + gl_cv_func_getcwd_abort_bug=yes + else + gl_cv_func_getcwd_abort_bug=no + fi], + [gl_cv_func_getcwd_abort_bug=yes]) + ]) AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2]) ]) diff --git a/gdb/gnulib/import/m4/getcwd-path-max.m4 b/gdb/gnulib/import/m4/getcwd-path-max.m4 index 2531ccf..90b1eff 100644 --- a/gdb/gnulib/import/m4/getcwd-path-max.m4 +++ b/gdb/gnulib/import/m4/getcwd-path-max.m4 @@ -1,4 +1,4 @@ -# serial 19 +# serial 21 # Check for several getcwd bugs with long file names. # If so, arrange to compile the wrapper function. @@ -6,7 +6,7 @@ # I've heard that this is due to a Linux kernel bug, and that it has # been fixed between 2.4.21-pre3 and 2.4.21-pre4. -# Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2003-2007, 2009-2018 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. @@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX], AC_CHECK_HEADERS_ONCE([unistd.h]) AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ]) AC_CACHE_CHECK([whether getcwd handles long file names properly], - gl_cv_func_getcwd_path_max, + [gl_cv_func_getcwd_path_max], [# Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir3" dnl Please keep this in sync with tests/test-getcwd.c. @@ -202,16 +202,28 @@ main () #endif } ]])], - [gl_cv_func_getcwd_path_max=yes], - [case $? in - 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';; - 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; - 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';; - *) gl_cv_func_getcwd_path_max=no;; - esac], - [case "$host_os" in - aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; - *) gl_cv_func_getcwd_path_max=no;; - esac]) - ]) + [gl_cv_func_getcwd_path_max=yes], + [case $? in + 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';; + 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; + 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';; + *) gl_cv_func_getcwd_path_max=no;; + esac], + [# Cross-compilation guesses: + case "$host_os" in + aix*) # On AIX, it has the AIX bug. + gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;; + gnu*) # On Hurd, it is 'yes'. + gl_cv_func_getcwd_path_max=yes ;; + linux* | kfreebsd*) + # On older Linux+glibc it's 'no, but it is partly working', + # on newer Linux+glibc it's 'yes'. + # On Linux+musl libc, it's 'no, but it is partly working'. + # On kFreeBSD+glibc, it's 'no, but it is partly working'. + gl_cv_func_getcwd_path_max='no, but it is partly working' ;; + *) # If we don't know, assume the worst. + gl_cv_func_getcwd_path_max=no ;; + esac + ]) + ]) ]) diff --git a/gdb/gnulib/import/m4/getcwd.m4 b/gdb/gnulib/import/m4/getcwd.m4 index 566c3c1..019934d 100644 --- a/gdb/gnulib/import/m4/getcwd.m4 +++ b/gdb/gnulib/import/m4/getcwd.m4 @@ -1,12 +1,12 @@ # getcwd.m4 - check for working getcwd that is compatible with glibc -# Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2018 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. -# serial 13 +# serial 16 AC_DEFUN([gl_FUNC_GETCWD_NULL], [ @@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], char *getcwd (); # endif ]], [[ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* mingw cwd does not start with '/', but getcwd does allocate. However, mingw fails to honor non-zero size. */ #else @@ -37,9 +37,9 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], if (! f) return 2; if (f[0] != '/') - return 3; + { free (f); return 3; } if (f[1] != '\0') - return 4; + { free (f); return 4; } free (f); return 0; } @@ -48,12 +48,12 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], [gl_cv_func_getcwd_null=yes], [gl_cv_func_getcwd_null=no], [[case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_getcwd_null="guessing yes";; - # Guess yes on Cygwin. - cygwin*) gl_cv_func_getcwd_null="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_getcwd_null="guessing no";; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; esac ]])]) ]) diff --git a/gdb/gnulib/import/m4/getdtablesize.m4 b/gdb/gnulib/import/m4/getdtablesize.m4 index 1bf4db0..4cc1a8f 100644 --- a/gdb/gnulib/import/m4/getdtablesize.m4 +++ b/gdb/gnulib/import/m4/getdtablesize.m4 @@ -1,5 +1,5 @@ -# getdtablesize.m4 serial 6 -dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. +# getdtablesize.m4 serial 7 +dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,29 +12,43 @@ AC_DEFUN([gl_FUNC_GETDTABLESIZE], AC_CHECK_DECLS_ONCE([getdtablesize]) if test $ac_cv_func_getdtablesize = yes && test $ac_cv_have_decl_getdtablesize = yes; then - # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit - # up to an unchangeable hard limit; all other platforms correctly - # require setrlimit before getdtablesize() can report a larger value. AC_CACHE_CHECK([whether getdtablesize works], [gl_cv_func_getdtablesize_works], - [AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[#include <unistd.h>]], - [int size = getdtablesize(); - if (dup2 (0, getdtablesize()) != -1) - return 1; - if (size != getdtablesize()) - return 2; - ])], - [gl_cv_func_getdtablesize_works=yes], - [gl_cv_func_getdtablesize_works=no], - [case "$host_os" in - cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows - gl_cv_func_getdtablesize_works="guessing no" ;; - *) gl_cv_func_getdtablesize_works="guessing yes" ;; - esac]) + [dnl There are two concepts: the "maximum possible file descriptor value + 1" + dnl and the "maximum number of open file descriptors in a process". + dnl Per SUSv2 and POSIX, getdtablesize() should return the first one. + dnl On most platforms, the first and the second concept are the same. + dnl On OpenVMS, however, they are different and getdtablesize() returns + dnl the second one; thus the test below fails. But we don't care + dnl because there's no good way to write a replacement getdtablesize(). + case "$host_os" in + vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; + *) + dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft + dnl limit up to an unchangeable hard limit; all other platforms + dnl correctly require setrlimit before getdtablesize() can report + dnl a larger value. + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[#include <unistd.h>]], + [int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + ])], + [gl_cv_func_getdtablesize_works=yes], + [gl_cv_func_getdtablesize_works=no], + [case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac + ]) + ;; + esac ]) case "$gl_cv_func_getdtablesize_works" in - *yes) ;; + *yes | "no (limitation)") ;; *) REPLACE_GETDTABLESIZE=1 ;; esac else diff --git a/gdb/gnulib/import/m4/getlogin.m4 b/gdb/gnulib/import/m4/getlogin.m4 new file mode 100644 index 0000000..a564db2 --- /dev/null +++ b/gdb/gnulib/import/m4/getlogin.m4 @@ -0,0 +1,32 @@ +# getlogin.m4 serial 5 +dnl Copyright (C) 2010-2018 Free Software Foundation, Inc. +dnl This file is free software; the Free 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_GETLOGIN], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([getlogin]) + if test $ac_cv_have_decl_getlogin = no; then + HAVE_DECL_GETLOGIN=0 + fi + AC_CHECK_FUNCS_ONCE([getlogin]) + if test $ac_cv_func_getlogin = no; then + HAVE_GETLOGIN=0 + fi +]) + +dnl Determines the library needed by the implementation of the +dnl getlogin and getlogin_r functions. +AC_DEFUN([gl_LIB_GETLOGIN], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case $host_os in + mingw*) + LIB_GETLOGIN='-ladvapi32' ;; + *) + LIB_GETLOGIN= ;; + esac + AC_SUBST([LIB_GETLOGIN]) +]) diff --git a/gdb/gnulib/import/m4/getlogin_r.m4 b/gdb/gnulib/import/m4/getlogin_r.m4 index 80f82f4..0b04a5f 100644 --- a/gdb/gnulib/import/m4/getlogin_r.m4 +++ b/gdb/gnulib/import/m4/getlogin_r.m4 @@ -1,6 +1,6 @@ -#serial 11 +#serial 12 -# Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -30,8 +30,8 @@ AC_DEFUN([gl_FUNC_GETLOGIN_R], HAVE_GETLOGIN_R=0 else HAVE_GETLOGIN_R=1 - dnl On OSF/1 5.1, getlogin_r returns a truncated result if the buffer is - dnl not large enough. + dnl On Mac OS X 10.12 and OSF/1 5.1, getlogin_r returns a truncated result + dnl if the buffer is not large enough. AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether getlogin_r works with small buffers], [gl_cv_func_getlogin_r_works], @@ -39,15 +39,16 @@ AC_DEFUN([gl_FUNC_GETLOGIN_R], dnl Initial guess, used when cross-compiling. changequote(,)dnl case "$host_os" in - # Guess no on OSF/1. - osf*) gl_cv_func_getlogin_r_works="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_getlogin_r_works="guessing yes" ;; + # Guess no on Mac OS X, OSF/1. + darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_getlogin_r_works="guessing yes" ;; esac changequote([,])dnl AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include <stddef.h> +#include <string.h> #include <unistd.h> #if !HAVE_DECL_GETLOGIN_R extern @@ -63,16 +64,19 @@ main (void) char buf[100]; if (getlogin_r (buf, 0) == 0) - result |= 16; + result |= 1; if (getlogin_r (buf, 1) == 0) - result |= 17; + result |= 2; + if (getlogin_r (buf, 100) == 0) + { + size_t n = strlen (buf); + if (getlogin_r (buf, n) == 0) + result |= 4; + } return result; }]])], [gl_cv_func_getlogin_r_works=yes], - [case $? in - 16 | 17) gl_cv_func_getlogin_r_works=no ;; - esac - ], + [gl_cv_func_getlogin_r_works=no], [:]) ]) case "$gl_cv_func_getlogin_r_works" in diff --git a/gdb/gnulib/import/m4/getpagesize.m4 b/gdb/gnulib/import/m4/getpagesize.m4 new file mode 100644 index 0000000..eb17d60 --- /dev/null +++ b/gdb/gnulib/import/m4/getpagesize.m4 @@ -0,0 +1,49 @@ +# getpagesize.m4 serial 10 +dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2018 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. + +AC_DEFUN([gl_FUNC_GETPAGESIZE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + gl_CHECK_FUNC_GETPAGESIZE + if test $gl_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + AC_CHECK_HEADERS([OS.h]) + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + AC_CHECK_HEADERS([sys/param.h]) + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi + case "$host_os" in + mingw*) + REPLACE_GETPAGESIZE=1 + ;; + esac + dnl Also check whether it's declared. + dnl mingw has getpagesize() in libgcc.a but doesn't declare it. + AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0]) +]) + +dnl Tests whether the function getpagesize() exists. +dnl Sets gl_cv_func_getpagesize. +AC_DEFUN([gl_CHECK_FUNC_GETPAGESIZE], +[ + dnl We can't use AC_CHECK_FUNC here, because getpagesize() is defined as a + dnl static inline function when compiling for Android 4.4 or older. + AC_CACHE_CHECK([for getpagesize], [gl_cv_func_getpagesize], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h>]], + [[return getpagesize();]]) + ], + [gl_cv_func_getpagesize=yes], + [gl_cv_func_getpagesize=no]) + ]) +]) diff --git a/gdb/gnulib/import/m4/getprogname.m4 b/gdb/gnulib/import/m4/getprogname.m4 index f027037..3a9ba8b 100644 --- a/gdb/gnulib/import/m4/getprogname.m4 +++ b/gdb/gnulib/import/m4/getprogname.m4 @@ -1,6 +1,6 @@ # getprogname.m4 - check for getprogname or replacements for it -# Copyright (C) 2016 Free Software Foundation, Inc. +# Copyright (C) 2016-2018 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/gdb/gnulib/import/m4/gettimeofday.m4 b/gdb/gnulib/import/m4/gettimeofday.m4 index 4ae5d63..198695e 100644 --- a/gdb/gnulib/import/m4/gettimeofday.m4 +++ b/gdb/gnulib/import/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ -# serial 21 +# serial 25 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2018 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. @@ -9,9 +9,10 @@ dnl From Jim Meyering. AC_DEFUN([gl_FUNC_GETTIMEOFDAY], [ + AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_HEADER_SYS_TIME_H]) - AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([gettimeofday]) gl_gettimeofday_timezone=void @@ -54,19 +55,11 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); if test $REPLACE_STRUCT_TIMEVAL = 1; then REPLACE_GETTIMEOFDAY=1 fi - m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ - gl_FUNC_TZSET_CLOBBER - case "$gl_cv_func_tzset_clobber" in - *yes) - REPLACE_GETTIMEOFDAY=1 - gl_GETTIMEOFDAY_REPLACE_LOCALTIME - AC_DEFINE([tzset], [rpl_tzset], - [Define to rpl_tzset if the wrapper function should be used.]) - AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], - [Define if tzset clobbers localtime's static buffer.]) - ;; - esac - ]) + dnl On mingw, the original gettimeofday has only a precision of 15.6 + dnl milliseconds. So override it. + case "$host_os" in + mingw*) REPLACE_GETTIMEOFDAY=1 ;; + esac fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], [Define this to 'void' or 'struct timezone' to match the system's @@ -85,6 +78,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], [ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], [gl_cv_func_gettimeofday_clobber], @@ -109,30 +103,24 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], [gl_cv_func_gettimeofday_clobber=yes], [# When cross-compiling: case "$host_os" in - # Guess all is fine on glibc systems. - *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + # Guess all is fine on glibc systems. + *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; esac ])]) case "$gl_cv_func_gettimeofday_clobber" in *yes) REPLACE_GETTIMEOFDAY=1 - gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) + gl_LOCALTIME_BUFFER_NEEDED ;; esac ]) -AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - REPLACE_GMTIME=1 - REPLACE_LOCALTIME=1 -]) - # Prerequisites of lib/gettimeofday.c. -AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ - AC_CHECK_HEADERS([sys/timeb.h]) - AC_CHECK_FUNCS([_ftime]) -]) +AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) diff --git a/gdb/gnulib/import/m4/glibc21.m4 b/gdb/gnulib/import/m4/glibc21.m4 deleted file mode 100644 index dafebf5..0000000 --- a/gdb/gnulib/import/m4/glibc21.m4 +++ /dev/null @@ -1,34 +0,0 @@ -# glibc21.m4 serial 5 -dnl Copyright (C) 2000-2002, 2004, 2008, 2010-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, -dnl with or without modifications, as long as this notice is preserved. - -# Test for the GNU C Library, version 2.1 or newer, or uClibc. -# From Bruno Haible. - -AC_DEFUN([gl_GLIBC21], - [ - AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc], - [ac_cv_gnu_library_2_1], - [AC_EGREP_CPP([Lucky], - [ -#include <features.h> -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif -#ifdef __UCLIBC__ - Lucky user -#endif - ], - [ac_cv_gnu_library_2_1=yes], - [ac_cv_gnu_library_2_1=no]) - ] - ) - AC_SUBST([GLIBC21]) - GLIBC21="$ac_cv_gnu_library_2_1" - ] -) diff --git a/gdb/gnulib/import/m4/glob.m4 b/gdb/gnulib/import/m4/glob.m4 index adf5fe2..53a1911 100644 --- a/gdb/gnulib/import/m4/glob.m4 +++ b/gdb/gnulib/import/m4/glob.m4 @@ -1,5 +1,5 @@ -# glob.m4 serial 14 -dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc. +# glob.m4 serial 21 +dnl Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,68 +9,74 @@ dnl with or without modifications, as long as this notice is preserved. # always include <glob.h> for the glob prototypes. AC_DEFUN([gl_GLOB], -[ GLOB_H= - AC_CHECK_HEADERS([glob.h], [], [GLOB_H=glob.h]) +[ + AC_REQUIRE([gl_GLOB_H]) + + AC_CHECK_FUNCS_ONCE([glob glob_pattern_p]) + if test $ac_cv_func_glob = no; then + HAVE_GLOB=0 + else - if test -z "$GLOB_H"; then - AC_CACHE_CHECK([for GNU glob interface version 1], - [gl_cv_gnu_glob_interface_version_1], + AC_CACHE_CHECK([for GNU glob interface version 1 or 2], + [gl_cv_gnu_glob_interface_version_1_2], [ AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[#include <gnu-versions.h> -char a[_GNU_GLOB_INTERFACE_VERSION == 1 ? 1 : -1];]])], - [gl_cv_gnu_glob_interface_version_1=yes], - [gl_cv_gnu_glob_interface_version_1=no])]) - - if test "$gl_cv_gnu_glob_interface_version_1" = "no"; then - GLOB_H=glob.h +char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];]])], + [gl_cv_gnu_glob_interface_version_1_2=yes], + [gl_cv_gnu_glob_interface_version_1_2=no])]) + if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then + REPLACE_GLOB=1 fi - fi - if test -z "$GLOB_H"; then - AC_CACHE_CHECK([whether glob lists broken symlinks], - [gl_cv_glob_lists_symlinks], -[ if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then - gl_cv_glob_lists_symlinks=maybe - else - # If we can't make a symlink, then we cannot test this issue. Be - # pessimistic about this. - gl_cv_glob_lists_symlinks=no + if test $REPLACE_GLOB = 0; then + AC_CACHE_CHECK([whether glob lists broken symlinks], + [gl_cv_glob_lists_symlinks], + [if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then + gl_cv_glob_lists_symlinks=maybe + else + # If we can't make a symlink, then we cannot test this issue. Be + # pessimistic about this. + gl_cv_glob_lists_symlinks=no + fi + if test $gl_cv_glob_lists_symlinks = maybe; then + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stddef.h> + #include <glob.h>]], + [[glob_t found; + if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) + return 1; + ]])], + [gl_cv_glob_lists_symlinks=yes], + [gl_cv_glob_lists_symlinks=no], + [gl_cv_glob_lists_symlinks=no]) + fi + rm -f conf$$-globtest + ]) + if test $gl_cv_glob_lists_symlinks = no; then + REPLACE_GLOB=1 fi + fi - if test $gl_cv_glob_lists_symlinks = maybe; then - AC_RUN_IFELSE([ -AC_LANG_PROGRAM( -[[#include <stddef.h> -#include <glob.h>]], -[[glob_t found; -if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) return 1;]])], - [gl_cv_glob_lists_symlinks=yes], - [gl_cv_glob_lists_symlinks=no], [gl_cv_glob_lists_symlinks=no]) - fi]) + fi - if test $gl_cv_glob_lists_symlinks = no; then - GLOB_H=glob.h + if test $ac_cv_func_glob_pattern_p = no; then + HAVE_GLOB_PATTERN_P=0 + else + if test $REPLACE_GLOB = 1; then + REPLACE_GLOB_PATTERN_P=1 fi fi - rm -f conf$$-globtest - - AC_SUBST([GLOB_H]) - AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"]) + if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then + gl_REPLACE_GLOB_H + fi ]) -# Prerequisites of lib/glob.*. +# Prerequisites of lib/glob.c and lib/globfree.c. AC_DEFUN([gl_PREREQ_GLOB], [ - AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])dnl - AC_REQUIRE([AC_C_RESTRICT])dnl - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl - AC_CHECK_HEADERS_ONCE([sys/cdefs.h unistd.h])dnl - if test $ac_cv_header_sys_cdefs_h = yes; then - HAVE_SYS_CDEFS_H=1 - else - HAVE_SYS_CDEFS_H=0 - fi - AC_SUBST([HAVE_SYS_CDEFS_H]) - AC_CHECK_FUNCS_ONCE([fstatat getlogin_r getpwnam_r])dnl + AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE]) + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([getlogin_r getpwnam_r]) ]) diff --git a/gdb/gnulib/import/m4/glob_h.m4 b/gdb/gnulib/import/m4/glob_h.m4 new file mode 100644 index 0000000..3ac78a8 --- /dev/null +++ b/gdb/gnulib/import/m4/glob_h.m4 @@ -0,0 +1,72 @@ +# glob_h.m4 serial 5 +dnl Copyright (C) 2018 Free Software Foundation, Inc. +dnl This file is free software; the Free 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_DEFUN_ONCE([gl_GLOB_H], +[ + AC_REQUIRE([gl_GLOB_H_DEFAULTS]) + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) + AC_REQUIRE([AC_C_RESTRICT]) + AC_CHECK_HEADERS_ONCE([glob.h]) + gl_CHECK_NEXT_HEADERS([glob.h]) + + if test $ac_cv_header_glob_h = yes; then + HAVE_GLOB_H=1 + else + HAVE_GLOB_H=0 + fi + AC_SUBST([HAVE_GLOB_H]) + + m4_ifdef([gl_POSIXCHECK], + [GLOB_H=glob.h], + [GLOB_H='' + if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then + dnl Override <glob.h> always, to support the C++ GNULIB_NAMESPACE. + GLOB_H=glob.h + else + if test $ac_cv_header_glob_h != yes; then + dnl Provide a substitute <glob.h> file. + GLOB_H=glob.h + fi + fi + ]) + AC_SUBST([GLOB_H]) + AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_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 <glob.h> + ]], + [glob globfree glob_pattern_p]) +]) + +dnl Unconditionally enables the replacement of <glob.h>. +AC_DEFUN([gl_REPLACE_GLOB_H], +[ + AC_REQUIRE([gl_GLOB_H_DEFAULTS]) + GLOB_H='glob.h' + AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"]) +]) + +AC_DEFUN([gl_GLOB_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_GLOB_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_GLOB_H_DEFAULTS], +[ + GNULIB_GLOB=0; AC_SUBST([GNULIB_GLOB]) + dnl Assume POSIX and GNU behavior unless another module says otherwise. + HAVE_GLOB=1; AC_SUBST([HAVE_GLOB]) + HAVE_GLOB_PATTERN_P=1; AC_SUBST([HAVE_GLOB_PATTERN_P]) + REPLACE_GLOB=0; AC_SUBST([REPLACE_GLOB]) + REPLACE_GLOB_PATTERN_P=0; AC_SUBST([REPLACE_GLOB_PATTERN_P]) +]) diff --git a/gdb/gnulib/import/m4/gnulib-cache.m4 b/gdb/gnulib/import/m4/gnulib-cache.m4 index 225b52a..457f291 100644 --- a/gdb/gnulib/import/m4/gnulib-cache.m4 +++ b/gdb/gnulib/import/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2016 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -11,7 +11,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this file. If not, see <http://www.gnu.org/licenses/>. +# along with this file. If not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that @@ -27,7 +27,48 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl getcwd glob inttypes limits-h lstat memchr memmem mkdir mkstemp pathmax rawmemchr readlink rename setenv signal-h strchrnul strstr strtok_r sys_stat unistd unsetenv update-copyright wchar wctype-h +# gnulib-tool --import \ +# --lib=libgnu \ +# --source-base=import \ +# --m4-base=import/m4 \ +# --doc-base=doc \ +# --tests-base=tests \ +# --aux-dir=import/extra \ +# --no-conditional-dependencies \ +# --no-libtool \ +# --macro-prefix=gl \ +# --no-vc-files \ +# alloca \ +# canonicalize-lgpl \ +# dirent \ +# dirfd \ +# errno \ +# fnmatch-gnu \ +# frexpl \ +# getcwd \ +# glob \ +# inttypes \ +# limits-h \ +# lstat \ +# memchr \ +# memmem \ +# mkdir \ +# mkstemp \ +# pathmax \ +# rawmemchr \ +# readlink \ +# rename \ +# setenv \ +# signal-h \ +# strchrnul \ +# strstr \ +# strtok_r \ +# sys_stat \ +# unistd \ +# unsetenv \ +# update-copyright \ +# wchar \ +# wctype-h # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) diff --git a/gdb/gnulib/import/m4/gnulib-common.m4 b/gdb/gnulib/import/m4/gnulib-common.m4 index f8454c8..5f07855 100644 --- a/gdb/gnulib/import/m4/gnulib-common.m4 +++ b/gdb/gnulib/import/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 36 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# gnulib-common.m4 serial 39 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -72,6 +72,13 @@ AC_DEFUN([gl_COMMON_BODY], [ #else # define _GL_ATTRIBUTE_CONST /* empty */ #endif + +/* The __malloc__ attribute was added in gcc 3. */ +#if 3 <= __GNUC__ +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#else +# define _GL_ATTRIBUTE_MALLOC /* empty */ +#endif ]) dnl Preparation for running test programs: dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not @@ -228,13 +235,13 @@ m4_ifndef([AS_VAR_IF], # 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>, +# <https://lists.gnu.org/r/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>. +# <https://lists.gnu.org/r/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>. +# <https://lists.gnu.org/r/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], [ @@ -256,7 +263,8 @@ AC_DEFUN([gl_PROG_AR_RANLIB], dnl library formats. In particular, the GNU binutils programs ar and ranlib dnl produce libraries that work only with gcc, not with cc. AC_REQUIRE([AC_PROG_CC]) - AC_BEFORE([$0], [AM_PROG_AR]) + dnl The '][' hides this use from 'aclocal'. + AC_BEFORE([$0], [A][M_PROG_AR]) AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], [ AC_EGREP_CPP([Amsterdam], @@ -288,7 +296,9 @@ Amsterdam dnl __ACK__. It may seem like its easier to avoid calling the macro here, dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good dnl default value and automake should usually know them). - m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:]) + dnl + dnl The '][' hides this use from 'aclocal'. + m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:]) fi dnl In case the code above has not helped with setting AR/ARFLAGS, use @@ -344,16 +354,16 @@ AC_DEFUN([AC_C_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 bar (int [$ac_kw]); /* Catch GCC bug 14050. */ - int bar (int ip[$ac_kw]) { return ip[0]; } - ]], - [[int s[1]; - int *$ac_kw t = s; - t[0] = 0; - return foo (t) + bar (t); - ]])], + [[typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + ]], + [[int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done @@ -456,7 +466,9 @@ m4_ifndef([AC_PROG_SED], else ac_cv_path_SED=$SED fi + ]) SED="$ac_cv_path_SED" AC_SUBST([SED])dnl rm -f conftest.sed -])])]) +]) +]) diff --git a/gdb/gnulib/import/m4/gnulib-comp.m4 b/gdb/gnulib/import/m4/gnulib-comp.m4 index 6fee9ef..b8f20da 100644 --- a/gdb/gnulib/import/m4/gnulib-comp.m4 +++ b/gdb/gnulib/import/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2016 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 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 @@ -12,7 +12,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this file. If not, see <http://www.gnu.org/licenses/>. +# along with this file. If not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that @@ -42,18 +42,20 @@ AC_DEFUN([gl_EARLY], AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) + AC_REQUIRE([AM_PROG_CC_C_O]) # Code from module absolute-header: # Code from module alloca: # Code from module alloca-opt: # Code from module assure: # Code from module at-internal: + # Code from module builtin-expect: + # Code from module c99: # Code from module canonicalize-lgpl: # Code from module chdir: # Code from module chdir-long: # Code from module cloexec: # Code from module close: # Code from module closedir: - # Code from module configmake: # Code from module d-ino: # Code from module d-type: # Code from module dirent: @@ -73,6 +75,7 @@ AC_DEFUN([gl_EARLY], # Code from module fcntl: # Code from module fcntl-h: # Code from module fd-hook: + # Code from module fd-safer-flag: # Code from module fdopendir: # Code from module filename: # Code from module filenamecat-lgpl: @@ -80,6 +83,7 @@ AC_DEFUN([gl_EARLY], # Code from module float: # Code from module fnmatch: # Code from module fnmatch-gnu: + # Code from module fnmatch-h: # Code from module fpieee: AC_REQUIRE([gl_FP_IEEE]) # Code from module fpucw: @@ -95,6 +99,7 @@ AC_DEFUN([gl_EARLY], # Code from module gettext-h: # Code from module gettimeofday: # Code from module glob: + # Code from module glob-h: # Code from module hard-locale: # Code from module include_next: # Code from module intprops: @@ -104,8 +109,10 @@ AC_DEFUN([gl_EARLY], # Code from module isnanl-nolibm: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) + # Code from module libc-config: # Code from module limits-h: # Code from module localcharset: + # Code from module localtime-buffer: # Code from module lstat: # Code from module malloc-posix: # Code from module malloca: @@ -139,7 +146,7 @@ AC_DEFUN([gl_EARLY], # Code from module rmdir: # Code from module same-inode: # Code from module save-cwd: - # Code from module secure_getenv: + # Code from module scratch_buffer: # Code from module setenv: # Code from module signal-h: # Code from module snippet/_Noreturn: @@ -148,6 +155,8 @@ AC_DEFUN([gl_EARLY], # Code from module snippet/warn-on-use: # Code from module ssize_t: # Code from module stat: + # Code from module stat-time: + # Code from module std-gnu11: # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -175,6 +184,7 @@ AC_DEFUN([gl_EARLY], # Code from module verify: # Code from module wchar: # Code from module wctype-h: + # Code from module xalloc-oversized: ]) # This macro should be invoked from ./configure.ac, in the section @@ -195,6 +205,7 @@ AC_DEFUN([gl_INIT], gl_source_base='import' gl_FUNC_ALLOCA AC_LIBOBJ([openat-proc]) + gl___BUILTIN_EXPECT gl_CANONICALIZE_LGPL if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then AC_LIBOBJ([canonicalize-lgpl]) @@ -219,7 +230,6 @@ AC_DEFUN([gl_INIT], AC_LIBOBJ([closedir]) fi gl_DIRENT_MODULE_INDICATOR([closedir]) - gl_CONFIGMAKE_PREP gl_CHECK_TYPE_STRUCT_DIRENT_D_INO gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE gl_DIRENT_H @@ -264,6 +274,7 @@ AC_DEFUN([gl_INIT], fi gl_FCNTL_MODULE_INDICATOR([fcntl]) gl_FCNTL_H + gl_MODULE_INDICATOR([fd-safer-flag]) gl_FUNC_FDOPENDIR if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then AC_LIBOBJ([fdopendir]) @@ -280,21 +291,24 @@ AC_DEFUN([gl_INIT], AC_LIBOBJ([itold]) fi gl_FUNC_FNMATCH_POSIX - if test -n "$FNMATCH_H"; then + if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then AC_LIBOBJ([fnmatch]) gl_PREREQ_FNMATCH fi + gl_FNMATCH_MODULE_INDICATOR([fnmatch]) gl_FUNC_FNMATCH_GNU - if test -n "$FNMATCH_H"; then + if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then AC_LIBOBJ([fnmatch]) gl_PREREQ_FNMATCH fi - gl_FUNC_FREXP + gl_MODULE_INDICATOR([fnmatch-gnu]) + gl_FNMATCH_H + AC_REQUIRE([gl_FUNC_FREXP]) if test $gl_func_frexp != yes; then AC_LIBOBJ([frexp]) fi gl_MATH_MODULE_INDICATOR([frexp]) - gl_FUNC_FREXPL + AC_REQUIRE([gl_FUNC_FREXPL]) if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then AC_LIBOBJ([frexpl]) fi @@ -302,6 +316,11 @@ AC_DEFUN([gl_INIT], gl_FUNC_FSTAT if test $REPLACE_FSTAT = 1; then AC_LIBOBJ([fstat]) + case "$host_os" in + mingw*) + AC_LIBOBJ([stat-w32]) + ;; + esac gl_PREREQ_FSTAT fi gl_SYS_STAT_MODULE_INDICATOR([fstat]) @@ -334,6 +353,7 @@ AC_DEFUN([gl_INIT], gl_PREREQ_GETLOGIN_R fi gl_UNISTD_MODULE_INDICATOR([getlogin_r]) + AC_REQUIRE([gl_LIB_GETLOGIN]) gl_FUNC_GETPROGNAME AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) @@ -344,11 +364,16 @@ AC_DEFUN([gl_INIT], fi gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) gl_GLOB - if test -n "$GLOB_H"; then + if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then AC_LIBOBJ([glob]) + AC_LIBOBJ([globfree]) gl_PREREQ_GLOB fi - gl_HARD_LOCALE + if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then + AC_LIBOBJ([glob_pattern_p]) + fi + gl_GLOB_MODULE_INDICATOR([glob]) + gl_GLOB_H gl_INTTYPES_H gl_INTTYPES_INCOMPLETE gl_FUNC_ISNAND_NO_LIBM @@ -362,10 +387,14 @@ AC_DEFUN([gl_INIT], gl_PREREQ_ISNANL fi AC_REQUIRE([gl_LARGEFILE]) + gl___INLINE gl_LIMITS_H gl_LOCALCHARSET - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + dnl For backward compatibility. Some packages still use this. + LOCALCHARSET_TESTS_ENVIRONMENT= AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_LIBOBJ([localtime-buffer]) gl_FUNC_LSTAT if test $REPLACE_LSTAT = 1; then AC_LIBOBJ([lstat]) @@ -443,6 +472,7 @@ AC_DEFUN([gl_INIT], if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-nothrow]) fi + gl_MODULE_INDICATOR([msvc-nothrow]) gl_MULTIARCH gl_FUNC_OPEN if test $REPLACE_OPEN = 1; then @@ -501,12 +531,6 @@ AC_DEFUN([gl_INIT], fi gl_UNISTD_MODULE_INDICATOR([rmdir]) gl_SAVE_CWD - gl_FUNC_SECURE_GETENV - if test $HAVE_SECURE_GETENV = 0; then - AC_LIBOBJ([secure_getenv]) - gl_PREREQ_SECURE_GETENV - fi - gl_STDLIB_MODULE_INDICATOR([secure_getenv]) gl_FUNC_SETENV if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then AC_LIBOBJ([setenv]) @@ -517,9 +541,16 @@ AC_DEFUN([gl_INIT], gl_FUNC_STAT if test $REPLACE_STAT = 1; then AC_LIBOBJ([stat]) + case "$host_os" in + mingw*) + AC_LIBOBJ([stat-w32]) + ;; + esac gl_PREREQ_STAT fi gl_SYS_STAT_MODULE_INDICATOR([stat]) + gl_STAT_TIME + gl_STAT_BIRTHTIME AM_STDBOOL_H gl_STDDEF_H gl_STDINT_H @@ -723,30 +754,30 @@ 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/snippet/_Noreturn.h - build-aux/snippet/arg-nonnull.h - build-aux/snippet/c++defs.h - build-aux/snippet/warn-on-use.h build-aux/update-copyright + lib/_Noreturn.h lib/alloca.c lib/alloca.in.h + lib/arg-nonnull.h lib/assure.h lib/at-func.c lib/basename-lgpl.c + lib/c++defs.h lib/canonicalize-lgpl.c + lib/cdefs.h lib/chdir-long.c lib/chdir-long.h lib/cloexec.c lib/cloexec.h lib/close.c lib/closedir.c - lib/config.charset lib/dirent-private.h lib/dirent.in.h lib/dirfd.c lib/dirname-lgpl.c lib/dirname.h lib/dosname.h + lib/dup-safer-flag.c lib/dup-safer.c lib/dup.c lib/dup2.c @@ -760,6 +791,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/fcntl.in.h lib/fd-hook.c lib/fd-hook.h + lib/fd-safer-flag.c lib/fd-safer.c lib/fdopendir.c lib/filename.h @@ -788,6 +820,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/glob-libc.h lib/glob.c lib/glob.in.h + lib/glob_internal.h + lib/glob_pattern_p.c + lib/globfree.c lib/hard-locale.c lib/hard-locale.h lib/intprops.h @@ -798,14 +833,20 @@ AC_DEFUN([gl_FILE_LIST], [ lib/isnanl-nolibm.h lib/isnanl.c lib/itold.c + lib/libc-config.h lib/limits.in.h lib/localcharset.c lib/localcharset.h + lib/localtime-buffer.c + lib/localtime-buffer.h lib/lstat.c lib/malloc.c + lib/malloc/scratch_buffer.h + lib/malloc/scratch_buffer_grow.c + lib/malloc/scratch_buffer_grow_preserve.c + lib/malloc/scratch_buffer_set_array_size.c lib/malloca.c lib/malloca.h - lib/malloca.valgrind lib/math.c lib/math.in.h lib/mbrtowc.c @@ -838,17 +879,19 @@ AC_DEFUN([gl_FILE_LIST], [ lib/readdir.c lib/readlink.c lib/realloc.c - lib/ref-add.sin - lib/ref-del.sin lib/rename.c lib/rewinddir.c lib/rmdir.c lib/same-inode.h lib/save-cwd.c lib/save-cwd.h - lib/secure_getenv.c + lib/scratch_buffer.h lib/setenv.c lib/signal.in.h + lib/stat-time.c + lib/stat-time.h + lib/stat-w32.c + lib/stat-w32.h lib/stat.c lib/stdbool.in.h lib/stddef.in.h @@ -881,18 +924,21 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unistd.in.h lib/unsetenv.c lib/verify.h + lib/warn-on-use.h lib/wchar.in.h lib/wctype-h.c lib/wctype.in.h + lib/xalloc-oversized.h m4/00gnulib.m4 + m4/__inline.m4 m4/absolute-header.m4 m4/alloca.m4 + m4/builtin-expect.m4 m4/canonicalize.m4 m4/chdir-long.m4 m4/close.m4 m4/closedir.m4 m4/codeset.m4 - m4/configmake.m4 m4/d-ino.m4 m4/d-type.m4 m4/dirent_h.m4 @@ -918,6 +964,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/flexmember.m4 m4/float_h.m4 m4/fnmatch.m4 + m4/fnmatch_h.m4 m4/fpieee.m4 m4/frexp.m4 m4/frexpl.m4 @@ -927,13 +974,14 @@ AC_DEFUN([gl_FILE_LIST], [ m4/getcwd-path-max.m4 m4/getcwd.m4 m4/getdtablesize.m4 + m4/getlogin.m4 m4/getlogin_r.m4 + m4/getpagesize.m4 m4/getprogname.m4 m4/gettimeofday.m4 - m4/glibc21.m4 m4/glob.m4 + m4/glob_h.m4 m4/gnulib-common.m4 - m4/hard-locale.m4 m4/include_next.m4 m4/inttypes-pri.m4 m4/inttypes.m4 @@ -945,6 +993,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-zh.m4 + m4/localtime-buffer.m4 m4/longlong.m4 m4/lstat.m4 m4/malloc.m4 @@ -968,6 +1017,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/nocrash.m4 m4/off_t.m4 m4/onceonly.m4 + m4/open-cloexec.m4 m4/open.m4 m4/openat.m4 m4/opendir.m4 @@ -980,11 +1030,12 @@ AC_DEFUN([gl_FILE_LIST], [ m4/rewinddir.m4 m4/rmdir.m4 m4/save-cwd.m4 - m4/secure_getenv.m4 m4/setenv.m4 m4/signal_h.m4 m4/ssize_t.m4 + m4/stat-time.m4 m4/stat.m4 + m4/std-gnu11.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 diff --git a/gdb/gnulib/import/m4/gnulib-tool.m4 b/gdb/gnulib/import/m4/gnulib-tool.m4 index 0d2ee44..3088e0b 100644 --- a/gdb/gnulib/import/m4/gnulib-tool.m4 +++ b/gdb/gnulib/import/m4/gnulib-tool.m4 @@ -1,5 +1,5 @@ # gnulib-tool.m4 serial 2 -dnl Copyright (C) 2004-2005, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2005, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/hard-locale.m4 b/gdb/gnulib/import/m4/hard-locale.m4 deleted file mode 100644 index 4661bfc..0000000 --- a/gdb/gnulib/import/m4/hard-locale.m4 +++ /dev/null @@ -1,11 +0,0 @@ -# hard-locale.m4 serial 8 -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. - -dnl No prerequisites of lib/hard-locale.c. -AC_DEFUN([gl_HARD_LOCALE], -[ - : -]) diff --git a/gdb/gnulib/import/m4/include_next.m4 b/gdb/gnulib/import/m4/include_next.m4 index db0f2c0..a363cb0 100644 --- a/gdb/gnulib/import/m4/include_next.m4 +++ b/gdb/gnulib/import/m4/include_next.m4 @@ -1,12 +1,13 @@ -# include_next.m4 serial 23 -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +# include_next.m4 serial 24 +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Derek Price. -dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER. +dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER, +dnl and PRAGMA_COLUMNS. dnl dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to dnl 'include' otherwise. diff --git a/gdb/gnulib/import/m4/inttypes-pri.m4 b/gdb/gnulib/import/m4/inttypes-pri.m4 index ae20183..c844262 100644 --- a/gdb/gnulib/import/m4/inttypes-pri.m4 +++ b/gdb/gnulib/import/m4/inttypes-pri.m4 @@ -1,5 +1,5 @@ # inttypes-pri.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1997-2002, 2006, 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2002, 2006, 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/inttypes.m4 b/gdb/gnulib/import/m4/inttypes.m4 index 61cdb1a..d756f01 100644 --- a/gdb/gnulib/import/m4/inttypes.m4 +++ b/gdb/gnulib/import/m4/inttypes.m4 @@ -1,5 +1,5 @@ -# inttypes.m4 serial 26 -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +# inttypes.m4 serial 27 +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -147,6 +147,7 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS], HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) + HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T]) REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) diff --git a/gdb/gnulib/import/m4/isnand.m4 b/gdb/gnulib/import/m4/isnand.m4 index bcf3840..03da55d 100644 --- a/gdb/gnulib/import/m4/isnand.m4 +++ b/gdb/gnulib/import/m4/isnand.m4 @@ -1,5 +1,5 @@ # isnand.m4 serial 11 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/isnanl.m4 b/gdb/gnulib/import/m4/isnanl.m4 index 9766e47..74014d6 100644 --- a/gdb/gnulib/import/m4/isnanl.m4 +++ b/gdb/gnulib/import/m4/isnanl.m4 @@ -1,5 +1,5 @@ -# isnanl.m4 serial 19 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# isnanl.m4 serial 20 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -231,6 +231,18 @@ int main () }]])], [gl_cv_func_isnanl_works=yes], [gl_cv_func_isnanl_works=no], - [gl_cv_func_isnanl_works="guessing yes"]) + [case "$host_os" in + mingw*) # Guess yes on mingw, no on MSVC. + AC_EGREP_CPP([Known], [ +#ifdef __MINGW32__ + Known +#endif + ], + [gl_cv_func_isnanl_works="guessing yes"], + [gl_cv_func_isnanl_works="guessing no"]) + ;; + *) gl_cv_func_isnanl_works="guessing yes" ;; + esac + ]) ]) ]) diff --git a/gdb/gnulib/import/m4/largefile.m4 b/gdb/gnulib/import/m4/largefile.m4 index 8bbdfaa..bec7cd1 100644 --- a/gdb/gnulib/import/m4/largefile.m4 +++ b/gdb/gnulib/import/m4/largefile.m4 @@ -1,6 +1,6 @@ # Enable large files on systems where this is not the default. -# Copyright 1992-1996, 1998-2016 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2018 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. @@ -126,9 +126,24 @@ AC_DEFUN([gl_LARGEFILE], else WINDOWS_64_BIT_OFF_T=0 fi - dnl But all native Windows platforms (including mingw64) have a 32-bit - dnl st_size member in 'struct stat'. - WINDOWS_64_BIT_ST_SIZE=1 + dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat' + dnl to 'struct _stat32i64' or 'struct _stat64' (depending on + dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member. + AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + ]], + [[]])], + [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no]) + ]) + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi ;; *) dnl Nothing to do on gnulib's side. diff --git a/gdb/gnulib/import/m4/limits-h.m4 b/gdb/gnulib/import/m4/limits-h.m4 index 31fdf0a..8388663 100644 --- a/gdb/gnulib/import/m4/limits-h.m4 +++ b/gdb/gnulib/import/m4/limits-h.m4 @@ -1,6 +1,6 @@ dnl Check whether limits.h has needed features. -dnl Copyright 2016 Free Software Foundation, Inc. +dnl Copyright 2016-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,3 +29,11 @@ AC_DEFUN_ONCE([gl_LIMITS_H], AC_SUBST([LIMITS_H]) AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) ]) + +dnl Unconditionally enables the replacement of <limits.h>. +AC_DEFUN([gl_REPLACE_LIMITS_H], +[ + AC_REQUIRE([gl_LIMITS_H]) + LIMITS_H='limits.h' + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +]) diff --git a/gdb/gnulib/import/m4/localcharset.m4 b/gdb/gnulib/import/m4/localcharset.m4 index 22c311b..d38a2c9 100644 --- a/gdb/gnulib/import/m4/localcharset.m4 +++ b/gdb/gnulib/import/m4/localcharset.m4 @@ -1,5 +1,5 @@ -# localcharset.m4 serial 7 -dnl Copyright (C) 2002, 2004, 2006, 2009-2016 Free Software Foundation, Inc. +# localcharset.m4 serial 8 +dnl Copyright (C) 2002, 2004, 2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,10 +8,4 @@ AC_DEFUN([gl_LOCALCHARSET], [ dnl Prerequisites of lib/localcharset.c. AC_REQUIRE([AM_LANGINFO_CODESET]) - AC_REQUIRE([gl_FCNTL_O_FLAGS]) - AC_CHECK_DECLS_ONCE([getc_unlocked]) - - dnl Prerequisites of the lib/Makefile.am snippet. - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([gl_GLIBC21]) ]) diff --git a/gdb/gnulib/import/m4/locale-fr.m4 b/gdb/gnulib/import/m4/locale-fr.m4 index 92896a0..a37a0d2 100644 --- a/gdb/gnulib/import/m4/locale-fr.m4 +++ b/gdb/gnulib/import/m4/locale-fr.m4 @@ -1,5 +1,5 @@ -# locale-fr.m4 serial 17 -dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc. +# locale-fr.m4 serial 19 +dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,8 +24,14 @@ changequote(,)dnl struct tm t; char buf[16]; int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if defined __BEOS__ || defined __HAIKU__ + return 1; +#else /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -33,9 +39,9 @@ int main () { if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; -#else +# else if (setlocale (LC_ALL, "") == NULL) return 1; -#endif +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. @@ -44,32 +50,33 @@ int main () { some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET +# if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } -#endif -#ifdef __CYGWIN__ +# endif +# ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif +# endif /* Check whether in the abbreviation of the second month, the second character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only one byte long. This excludes the UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; -#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ +# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; -#endif +# endif return 0; +#endif } changequote([,])dnl ])]) @@ -153,7 +160,7 @@ int main () { variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE diff --git a/gdb/gnulib/import/m4/locale-ja.m4 b/gdb/gnulib/import/m4/locale-ja.m4 index f222a08..9f16231 100644 --- a/gdb/gnulib/import/m4/locale-ja.m4 +++ b/gdb/gnulib/import/m4/locale-ja.m4 @@ -1,5 +1,5 @@ -# locale-ja.m4 serial 12 -dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc. +# locale-ja.m4 serial 14 +dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,9 +25,14 @@ struct tm t; char buf[16]; int main () { - const char *p; + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if defined __BEOS__ || defined __HAIKU__ + return 1; +#else /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -35,9 +40,9 @@ int main () if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; -#else +# else if (setlocale (LC_ALL, "") == NULL) return 1; -#endif +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. @@ -46,32 +51,36 @@ int main () some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET +# if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } -#endif -#ifdef __CYGWIN__ +# endif +# ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif +# endif /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales on Cygwin 1.5.x. */ if (MB_CUR_MAX == 1) return 1; /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; + { + const char *p; + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + } return 0; +#endif } changequote([,])dnl ])]) diff --git a/gdb/gnulib/import/m4/locale-zh.m4 b/gdb/gnulib/import/m4/locale-zh.m4 index 2271f77..cfb447f 100644 --- a/gdb/gnulib/import/m4/locale-zh.m4 +++ b/gdb/gnulib/import/m4/locale-zh.m4 @@ -1,5 +1,5 @@ -# locale-zh.m4 serial 12 -dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc. +# locale-zh.m4 serial 14 +dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -26,9 +26,14 @@ struct tm t; char buf[16]; int main () { - const char *p; + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if defined __BEOS__ || defined __HAIKU__ + return 1; +#else /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -36,9 +41,9 @@ int main () if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; -#else +# else if (setlocale (LC_ALL, "") == NULL) return 1; -#endif +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. @@ -47,32 +52,36 @@ int main () some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET +# if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } -#endif -#ifdef __CYGWIN__ +# endif +# ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif +# endif /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; + { + const char *p; + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + } /* Check whether a typical GB18030 multibyte sequence is recognized as a single wide character. This excludes the GB2312 and GBK encodings. */ if (mblen ("\203\062\332\066", 5) != 4) return 1; return 0; +#endif } changequote([,])dnl ])]) diff --git a/gdb/gnulib/import/m4/localtime-buffer.m4 b/gdb/gnulib/import/m4/localtime-buffer.m4 new file mode 100644 index 0000000..4b3ec57 --- /dev/null +++ b/gdb/gnulib/import/m4/localtime-buffer.m4 @@ -0,0 +1,21 @@ +# localtime-buffer.m4 serial 1 +dnl Copyright (C) 2017-2018 Free Software Foundation, Inc. +dnl This file is free software; the Free 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_LOCALTIME_BUFFER_DEFAULTS], +[ + NEED_LOCALTIME_BUFFER=0 +]) + +dnl Macro invoked from other modules, to signal that the compilation of +dnl module 'localtime-buffer' is needed. +AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], +[ + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 +]) diff --git a/gdb/gnulib/import/m4/longlong.m4 b/gdb/gnulib/import/m4/longlong.m4 index 36d8b12..27e6326 100644 --- a/gdb/gnulib/import/m4/longlong.m4 +++ b/gdb/gnulib/import/m4/longlong.m4 @@ -1,5 +1,5 @@ # longlong.m4 serial 17 -dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 1999-2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/lstat.m4 b/gdb/gnulib/import/m4/lstat.m4 index e143d5c..3694e4c 100644 --- a/gdb/gnulib/import/m4/lstat.m4 +++ b/gdb/gnulib/import/m4/lstat.m4 @@ -1,6 +1,6 @@ -# serial 27 +# serial 32 -# Copyright (C) 1997-2001, 2003-2016 Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -10,14 +10,15 @@ dnl From Jim Meyering. AC_DEFUN([gl_FUNC_LSTAT], [ + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) dnl If lstat does not exist, the replacement <sys/stat.h> does dnl "#define lstat stat", and lstat.c is a no-op. AC_CHECK_FUNCS_ONCE([lstat]) if test $ac_cv_func_lstat = yes; then AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) - case "$gl_cv_func_lstat_dereferences_slashed_symlink" in - *no) + case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in + solaris* | *no) REPLACE_LSTAT=1 ;; esac @@ -33,6 +34,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], [ dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether lstat correctly handles trailing slash], [gl_cv_func_lstat_dereferences_slashed_symlink], [rm -f conftest.sym conftest.file @@ -51,9 +53,15 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], [gl_cv_func_lstat_dereferences_slashed_symlink=yes], [gl_cv_func_lstat_dereferences_slashed_symlink=no], [case "$host_os" in - *-gnu*) + linux-* | linux) + # Guess yes on Linux systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *-gnu* | gnu*) # Guess yes on glibc systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + mingw*) + # Guess no on native Windows. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; *) # If we don't know, assume the worst. gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; diff --git a/gdb/gnulib/import/m4/malloc.m4 b/gdb/gnulib/import/m4/malloc.m4 index c393690..4c182b4 100644 --- a/gdb/gnulib/import/m4/malloc.m4 +++ b/gdb/gnulib/import/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 15 -dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc. +# malloc.m4 serial 17 +dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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. m4_version_prereq([2.70], [] ,[ # This is adapted with modifications from upstream Autoconf here: -# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -32,7 +32,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], [ac_cv_func_malloc_0_nonnull=no], [case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* \ + *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. @@ -91,7 +91,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX], AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[]], - [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + [[#if defined _WIN32 && ! defined __CYGWIN__ choke me #endif ]])], diff --git a/gdb/gnulib/import/m4/malloca.m4 b/gdb/gnulib/import/m4/malloca.m4 index b368b20..2251e61 100644 --- a/gdb/gnulib/import/m4/malloca.m4 +++ b/gdb/gnulib/import/m4/malloca.m4 @@ -1,5 +1,5 @@ # malloca.m4 serial 1 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2018 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/gdb/gnulib/import/m4/math_h.m4 b/gdb/gnulib/import/m4/math_h.m4 index 35d07ee..d0c7ed1 100644 --- a/gdb/gnulib/import/m4/math_h.m4 +++ b/gdb/gnulib/import/m4/math_h.m4 @@ -1,5 +1,5 @@ -# math_h.m4 serial 114 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# math_h.m4 serial 116 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -256,11 +256,18 @@ 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_ACOSF=0; AC_SUBST([REPLACE_ACOSF]) + REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF]) + REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF]) + REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F]) REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF]) REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL]) REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) + REPLACE_COSF=0; AC_SUBST([REPLACE_COSF]) + REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF]) + REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF]) REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) @@ -284,6 +291,7 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) + REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL]) REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) @@ -315,7 +323,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) + REPLACE_SINF=0; AC_SUBST([REPLACE_SINF]) + REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF]) + REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF]) REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) + REPLACE_TANF=0; AC_SUBST([REPLACE_TANF]) + REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF]) REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) diff --git a/gdb/gnulib/import/m4/mbrtowc.m4 b/gdb/gnulib/import/m4/mbrtowc.m4 index d370fcc..c706d04 100644 --- a/gdb/gnulib/import/m4/mbrtowc.m4 +++ b/gdb/gnulib/import/m4/mbrtowc.m4 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 27 -*- coding: utf-8 -*- -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2016 Free Software Foundation, +# mbrtowc.m4 serial 31 -*- coding: utf-8 -*- +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2018 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, @@ -164,7 +164,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; }]])], @@ -224,7 +224,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; }]])], @@ -352,7 +352,7 @@ int main () mbrtowc (&wc, NULL, 5, &state); /* Check that wc was not modified. */ if (wc != (wchar_t) 0xBADFACE) - return 1; + return 2; } return 0; }]])], @@ -539,7 +539,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "", 1, &state) != 0) - return 1; + return 2; } return 0; }]])], @@ -563,10 +563,11 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on AIX and glibc systems. - aix* | *-gnu*) - gl_cv_func_mbrtowc_empty_input="guessing no" ;; - *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + # Guess no on AIX and glibc systems. + aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; esac changequote([,])dnl AC_RUN_IFELSE( @@ -592,6 +593,7 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932 AC_DEFUN([gl_MBRTOWC_C_LOCALE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether the C locale is free of encoding errors], [gl_cv_C_locale_sans_EILSEQ], [ @@ -608,7 +610,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE], int i; char *locale = setlocale (LC_ALL, "C"); if (! locale) - return 1; + return 2; for (i = CHAR_MIN; i <= CHAR_MAX; i++) { char c = i; @@ -616,17 +618,23 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE], mbstate_t mbs = { 0, }; size_t ss = mbrtowc (&wc, &c, 1, &mbs); if (1 < ss) - return 1; + return 3; } return 0; ]])], [gl_cv_C_locale_sans_EILSEQ=yes], [gl_cv_C_locale_sans_EILSEQ=no], - [:])]) + [case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_C_locale_sans_EILSEQ="guessing yes" ;; + esac + ]) + ]) ]) # Prerequisites of lib/mbrtowc.c. AC_DEFUN([gl_PREREQ_MBRTOWC], [ + AC_REQUIRE([AC_C_INLINE]) : ]) @@ -639,7 +647,7 @@ AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], - gl_cv_func_mbrtowc, + [gl_cv_func_mbrtowc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be @@ -655,8 +663,8 @@ AC_DEFUN([AC_FUNC_MBRTOWC], size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], - gl_cv_func_mbrtowc=yes, - gl_cv_func_mbrtowc=no)]) + [gl_cv_func_mbrtowc=yes], + [gl_cv_func_mbrtowc=no])]) if test $gl_cv_func_mbrtowc = yes; then AC_DEFINE([HAVE_MBRTOWC], [1], [Define to 1 if mbrtowc and mbstate_t are properly declared.]) diff --git a/gdb/gnulib/import/m4/mbsinit.m4 b/gdb/gnulib/import/m4/mbsinit.m4 index 88f0836..5cba3df 100644 --- a/gdb/gnulib/import/m4/mbsinit.m4 +++ b/gdb/gnulib/import/m4/mbsinit.m4 @@ -1,5 +1,5 @@ # mbsinit.m4 serial 8 -dnl Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/mbsrtowcs.m4 b/gdb/gnulib/import/m4/mbsrtowcs.m4 index 3b5dc6e..871dd96 100644 --- a/gdb/gnulib/import/m4/mbsrtowcs.m4 +++ b/gdb/gnulib/import/m4/mbsrtowcs.m4 @@ -1,5 +1,5 @@ # mbsrtowcs.m4 serial 13 -dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/mbstate_t.m4 b/gdb/gnulib/import/m4/mbstate_t.m4 index 0a8eae2..004aa0d 100644 --- a/gdb/gnulib/import/m4/mbstate_t.m4 +++ b/gdb/gnulib/import/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ # mbstate_t.m4 serial 13 -dnl Copyright (C) 2000-2002, 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/memchr.m4 b/gdb/gnulib/import/m4/memchr.m4 index 25d32f0..83c65c1 100644 --- a/gdb/gnulib/import/m4/memchr.m4 +++ b/gdb/gnulib/import/m4/memchr.m4 @@ -1,11 +1,13 @@ -# memchr.m4 serial 12 -dnl Copyright (C) 2002-2004, 2009-2016 Free Software Foundation, Inc. +# memchr.m4 serial 13 +dnl Copyright (C) 2002-2004, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_FUNC_MEMCHR], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl Check for prerequisites for memory fence checks. gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) @@ -23,10 +25,10 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], 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 + # https://bugzilla.redhat.com/show_bug.cgi?id=499689 # memchr should not dereference overestimated length after a match - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 # Assume that memchr works on platforms that lack mprotect. AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ @@ -73,12 +75,21 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], result |= 4; } 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 +]])], + [gl_cv_func_memchr_works=yes], + [gl_cv_func_memchr_works=no], + [case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_memchr_works="guessing yes" ;; + # Be pessimistic for now. + *) gl_cv_func_memchr_works="guessing no" ;; + esac + ]) + ]) + case "$gl_cv_func_memchr_works" in + *yes) ;; + *) REPLACE_MEMCHR=1 ;; + esac fi ]) diff --git a/gdb/gnulib/import/m4/memmem.m4 b/gdb/gnulib/import/m4/memmem.m4 index 981ede7..609971e 100644 --- a/gdb/gnulib/import/m4/memmem.m4 +++ b/gdb/gnulib/import/m4/memmem.m4 @@ -1,5 +1,5 @@ -# memmem.m4 serial 24 -dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc. +# memmem.m4 serial 25 +dnl Copyright (C) 2002-2004, 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_FUNC_MEMMEM_SIMPLE], if test $ac_cv_have_decl_memmem = no; then HAVE_DECL_MEMMEM=0 else - dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092. + dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092. dnl Also check that we handle empty needles correctly. AC_CACHE_CHECK([whether memmem works], [gl_cv_func_memmem_works_always], @@ -113,6 +113,9 @@ static void quit (int sig) { _exit (sig + 128); } if (!memmem (haystack, 2 * m + 1, needle, m + 1)) result |= 1; } + /* Free allocated memory, in case some sanitizer is watching. */ + free (haystack); + free (needle); return result; ]])], [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no], diff --git a/gdb/gnulib/import/m4/mempcpy.m4 b/gdb/gnulib/import/m4/mempcpy.m4 index 6991f29..eedf931 100644 --- a/gdb/gnulib/import/m4/mempcpy.m4 +++ b/gdb/gnulib/import/m4/mempcpy.m4 @@ -1,5 +1,5 @@ # mempcpy.m4 serial 11 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2018 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/gdb/gnulib/import/m4/memrchr.m4 b/gdb/gnulib/import/m4/memrchr.m4 index 6e7df5c..a036b39 100644 --- a/gdb/gnulib/import/m4/memrchr.m4 +++ b/gdb/gnulib/import/m4/memrchr.m4 @@ -1,5 +1,5 @@ # memrchr.m4 serial 10 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2018 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/gdb/gnulib/import/m4/mkdir.m4 b/gdb/gnulib/import/m4/mkdir.m4 index 574092b..1452999 100644 --- a/gdb/gnulib/import/m4/mkdir.m4 +++ b/gdb/gnulib/import/m4/mkdir.m4 @@ -1,6 +1,6 @@ -# serial 11 +# serial 14 -# Copyright (C) 2001, 2003-2004, 2006, 2008-2016 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2004, 2006, 2008-2018 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. @@ -23,10 +23,21 @@ AC_DEFUN([gl_FUNC_MKDIR], [gl_cv_func_mkdir_trailing_slash_works=yes], [gl_cv_func_mkdir_trailing_slash_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_mkdir_trailing_slash_works="guessing yes"], + [gl_cv_func_mkdir_trailing_slash_works="guessing no"]) + ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;; esac ]) rm -rf conftest.dir @@ -49,10 +60,12 @@ AC_DEFUN([gl_FUNC_MKDIR], [gl_cv_func_mkdir_trailing_dot_works=yes], [gl_cv_func_mkdir_trailing_dot_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; esac ]) rm -rf conftest.dir diff --git a/gdb/gnulib/import/m4/mkstemp.m4 b/gdb/gnulib/import/m4/mkstemp.m4 index 131e4a7..1407ed9 100644 --- a/gdb/gnulib/import/m4/mkstemp.m4 +++ b/gdb/gnulib/import/m4/mkstemp.m4 @@ -1,6 +1,6 @@ -#serial 23 +#serial 25 -# Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2018 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. @@ -57,10 +57,12 @@ AC_DEFUN([gl_FUNC_MKSTEMP], [gl_cv_func_working_mkstemp=yes], [gl_cv_func_working_mkstemp=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_working_mkstemp="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_working_mkstemp="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_mkstemp="guessing no" ;; esac ]) rm -rf conftest.mkstemp diff --git a/gdb/gnulib/import/m4/mmap-anon.m4 b/gdb/gnulib/import/m4/mmap-anon.m4 index 853c89d..55fea82 100644 --- a/gdb/gnulib/import/m4/mmap-anon.m4 +++ b/gdb/gnulib/import/m4/mmap-anon.m4 @@ -1,5 +1,5 @@ # mmap-anon.m4 serial 10 -dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/mode_t.m4 b/gdb/gnulib/import/m4/mode_t.m4 index 0cd40db..83e276c 100644 --- a/gdb/gnulib/import/m4/mode_t.m4 +++ b/gdb/gnulib/import/m4/mode_t.m4 @@ -1,5 +1,5 @@ # mode_t.m4 serial 2 -dnl Copyright (C) 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/msvc-inval.m4 b/gdb/gnulib/import/m4/msvc-inval.m4 index f5e4c89..55baeec 100644 --- a/gdb/gnulib/import/m4/msvc-inval.m4 +++ b/gdb/gnulib/import/m4/msvc-inval.m4 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/msvc-nothrow.m4 b/gdb/gnulib/import/m4/msvc-nothrow.m4 index 58f5c0b..74ae427 100644 --- a/gdb/gnulib/import/m4/msvc-nothrow.m4 +++ b/gdb/gnulib/import/m4/msvc-nothrow.m4 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/multiarch.m4 b/gdb/gnulib/import/m4/multiarch.m4 index 43b5d05..38a11cc 100644 --- a/gdb/gnulib/import/m4/multiarch.m4 +++ b/gdb/gnulib/import/m4/multiarch.m4 @@ -1,5 +1,5 @@ # multiarch.m4 serial 7 -dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/nocrash.m4 b/gdb/gnulib/import/m4/nocrash.m4 index d8dd8f1..4914007 100644 --- a/gdb/gnulib/import/m4/nocrash.m4 +++ b/gdb/gnulib/import/m4/nocrash.m4 @@ -1,5 +1,5 @@ -# nocrash.m4 serial 4 -dnl Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc. +# nocrash.m4 serial 5 +dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -79,7 +79,7 @@ nocrash_init (void) } } } -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include <windows.h> diff --git a/gdb/gnulib/import/m4/off_t.m4 b/gdb/gnulib/import/m4/off_t.m4 index 282751b..f4d5787 100644 --- a/gdb/gnulib/import/m4/off_t.m4 +++ b/gdb/gnulib/import/m4/off_t.m4 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/onceonly.m4 b/gdb/gnulib/import/m4/onceonly.m4 index c0c9e2c..5ab3dd7 100644 --- a/gdb/gnulib/import/m4/onceonly.m4 +++ b/gdb/gnulib/import/m4/onceonly.m4 @@ -1,5 +1,5 @@ # onceonly.m4 serial 9 -dnl Copyright (C) 2002-2003, 2005-2006, 2008-2016 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2008-2018 Free Software Foundation, dnl Inc. dnl dnl This file is free software; you can redistribute it and/or modify @@ -13,7 +13,7 @@ dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License -dnl along with this file. If not, see <http://www.gnu.org/licenses/>. +dnl along with this file. If not, see <https://www.gnu.org/licenses/>. dnl dnl As a special exception to the GNU General Public License, dnl this file may be distributed as part of a program diff --git a/gdb/gnulib/import/m4/open-cloexec.m4 b/gdb/gnulib/import/m4/open-cloexec.m4 new file mode 100644 index 0000000..a272784 --- /dev/null +++ b/gdb/gnulib/import/m4/open-cloexec.m4 @@ -0,0 +1,21 @@ +# Test whether O_CLOEXEC is defined. + +dnl Copyright 2017-2018 Free Software Foundation, Inc. +dnl This file is free software; the Free 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_PREPROC_O_CLOEXEC], +[ + AC_CACHE_CHECK([for O_CLOEXEC], + [gl_cv_macro_O_CLOEXEC], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <fcntl.h> + #ifndef O_CLOEXEC + choke me; + #endif + ]], + [[return O_CLOEXEC;]])], + [gl_cv_macro_O_CLOEXEC=yes], + [gl_cv_macro_O_CLOEXEC=no])]) +]) diff --git a/gdb/gnulib/import/m4/open.m4 b/gdb/gnulib/import/m4/open.m4 index 53d3038..8b3d402 100644 --- a/gdb/gnulib/import/m4/open.m4 +++ b/gdb/gnulib/import/m4/open.m4 @@ -1,5 +1,5 @@ -# open.m4 serial 14 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# open.m4 serial 15 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_OPEN], [ AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) case "$host_os" in mingw* | pw*) REPLACE_OPEN=1 @@ -15,6 +16,9 @@ AC_DEFUN([gl_FUNC_OPEN], dnl open("foo/") should not create a file when the file name has a dnl trailing slash. FreeBSD only has the problem on symlinks. AC_CHECK_FUNCS_ONCE([lstat]) + if test "$gl_cv_macro_O_CLOEXEC" != yes; then + REPLACE_OPEN=1 + fi AC_CACHE_CHECK([whether open recognizes a trailing slash], [gl_cv_func_open_slash], [# Assume that if we have lstat, we can also check symlinks. diff --git a/gdb/gnulib/import/m4/openat.m4 b/gdb/gnulib/import/m4/openat.m4 index fdeb1de..e837720 100644 --- a/gdb/gnulib/import/m4/openat.m4 +++ b/gdb/gnulib/import/m4/openat.m4 @@ -1,7 +1,7 @@ -# serial 45 +# serial 46 # See if we need to use our replacement for Solaris' openat et al functions. -dnl Copyright (C) 2004-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,10 +14,12 @@ AC_DEFUN([gl_FUNC_OPENAT], AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_FUNCS_ONCE([openat]) AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) - case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in - yes+*yes) + AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) + case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in + yes+*yes+yes) ;; yes+*) + # Solaris 10 lacks O_CLOEXEC. # Solaris 9 has *at functions, but uniformly mishandles trailing # slash in all of them. REPLACE_OPENAT=1 diff --git a/gdb/gnulib/import/m4/opendir.m4 b/gdb/gnulib/import/m4/opendir.m4 index ffaa6ae..5609536 100644 --- a/gdb/gnulib/import/m4/opendir.m4 +++ b/gdb/gnulib/import/m4/opendir.m4 @@ -1,5 +1,5 @@ -# opendir.m4 serial 4 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +# opendir.m4 serial 5 +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_OPENDIR], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS([opendir]) if test $ac_cv_func_opendir = no; then diff --git a/gdb/gnulib/import/m4/pathmax.m4 b/gdb/gnulib/import/m4/pathmax.m4 index 6f8e59a..292a256 100644 --- a/gdb/gnulib/import/m4/pathmax.m4 +++ b/gdb/gnulib/import/m4/pathmax.m4 @@ -1,5 +1,5 @@ -# pathmax.m4 serial 10 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation, +# pathmax.m4 serial 11 +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 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, @@ -29,7 +29,7 @@ AC_DEFUN([gl_PATHMAX_SNIPPET], [[ # undef PATH_MAX # define PATH_MAX 1024 #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # undef PATH_MAX # define PATH_MAX 260 #endif diff --git a/gdb/gnulib/import/m4/rawmemchr.m4 b/gdb/gnulib/import/m4/rawmemchr.m4 index d3ccb7e..b7497b8 100644 --- a/gdb/gnulib/import/m4/rawmemchr.m4 +++ b/gdb/gnulib/import/m4/rawmemchr.m4 @@ -1,5 +1,5 @@ # rawmemchr.m4 serial 2 -dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/readdir.m4 b/gdb/gnulib/import/m4/readdir.m4 index eda3acf..f45a45f 100644 --- a/gdb/gnulib/import/m4/readdir.m4 +++ b/gdb/gnulib/import/m4/readdir.m4 @@ -1,5 +1,5 @@ # readdir.m4 serial 1 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/readlink.m4 b/gdb/gnulib/import/m4/readlink.m4 index ede0378..4d0ab48 100644 --- a/gdb/gnulib/import/m4/readlink.m4 +++ b/gdb/gnulib/import/m4/readlink.m4 @@ -1,5 +1,5 @@ -# readlink.m4 serial 12 -dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc. +# readlink.m4 serial 14 +dnl Copyright (C) 2003, 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,12 @@ AC_DEFUN([gl_FUNC_READLINK], return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_readlink_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; esac ]) rm -f conftest.link conftest.lnk2]) diff --git a/gdb/gnulib/import/m4/realloc.m4 b/gdb/gnulib/import/m4/realloc.m4 index fc22825..23c0d5d 100644 --- a/gdb/gnulib/import/m4/realloc.m4 +++ b/gdb/gnulib/import/m4/realloc.m4 @@ -1,5 +1,5 @@ -# realloc.m4 serial 14 -dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc. +# realloc.m4 serial 15 +dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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. m4_version_prereq([2.70], [] ,[ # This is adapted with modifications from upstream Autoconf here: -# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_REALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -32,7 +32,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], [ac_cv_func_realloc_0_nonnull=no], [case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* \ + *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) ac_cv_func_realloc_0_nonnull=yes ;; # If we don't know, assume the worst. diff --git a/gdb/gnulib/import/m4/rename.m4 b/gdb/gnulib/import/m4/rename.m4 index fbcc758..e7ff1bf 100644 --- a/gdb/gnulib/import/m4/rename.m4 +++ b/gdb/gnulib/import/m4/rename.m4 @@ -1,6 +1,6 @@ -# serial 26 +# serial 30 -# Copyright (C) 2001, 2003, 2005-2006, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005-2006, 2009-2018 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. @@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_RENAME], AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([lstat]) - dnl Solaris 10, AIX 7.1 mistakenly allow rename("file","name/"). + dnl Solaris 11, AIX 7.1 mistakenly allow rename("file","name/"). dnl NetBSD 1.6 mistakenly forbids rename("dir","name/"). dnl FreeBSD 7.2 mistakenly allows rename("file","link-to-file/"). dnl The Solaris bug can be worked around without stripping @@ -55,10 +55,14 @@ AC_DEFUN([gl_FUNC_RENAME], [gl_cv_func_rename_slash_dst_works=no], dnl When crosscompiling, assume rename is broken. [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_slash_dst_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_slash_dst_works="guessing no" ;; esac ]) rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk @@ -69,7 +73,7 @@ AC_DEFUN([gl_FUNC_RENAME], REPLACE_RENAME=1 AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1], [Define if rename does not correctly handle slashes on the destination - argument, such as on Solaris 10 or NetBSD 1.6.]) + argument, such as on Solaris 11 or NetBSD 1.6.]) ;; esac @@ -107,10 +111,14 @@ AC_DEFUN([gl_FUNC_RENAME], [gl_cv_func_rename_slash_src_works=no], dnl When crosscompiling, assume rename is broken. [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_slash_src_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_slash_src_works="guessing no" ;; esac ]) rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk @@ -132,11 +140,12 @@ AC_DEFUN([gl_FUNC_RENAME], AC_CACHE_CHECK([whether rename manages hard links correctly], [gl_cv_func_rename_link_works], [if test $ac_cv_func_link = yes; then - rm -rf conftest.f conftest.f1 - if touch conftest.f && ln conftest.f conftest.f1 && + rm -rf conftest.f conftest.f1 conftest.f2 + if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 && set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ +# include <errno.h> # include <stdio.h> # include <stdlib.h> # include <unistd.h> @@ -146,26 +155,38 @@ AC_DEFUN([gl_FUNC_RENAME], result |= 1; if (unlink ("conftest.f1")) result |= 2; - if (rename ("conftest.f", "conftest.f")) + + /* Allow either the POSIX-required behavior, where the + previous rename kept conftest.f, or the (better) NetBSD + behavior, where it removed conftest.f. */ + if (rename ("conftest.f", "conftest.f") != 0 + && errno != ENOENT) result |= 4; + if (rename ("conftest.f1", "conftest.f1") == 0) result |= 8; + if (rename ("conftest.f2", "conftest.f2") != 0) + result |= 16; return result; ]])], [gl_cv_func_rename_link_works=yes], [gl_cv_func_rename_link_works=no], dnl When crosscompiling, assume rename is broken. [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_link_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_rename_link_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_link_works="guessing no" ;; esac ]) else gl_cv_func_rename_link_works="guessing no" fi - rm -rf conftest.f conftest.f1 + rm -rf conftest.f conftest.f1 conftest.f2 else gl_cv_func_rename_link_works=yes fi @@ -205,10 +226,14 @@ AC_DEFUN([gl_FUNC_RENAME], [gl_cv_func_rename_dest_works=no], dnl When crosscompiling, assume rename is broken. [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_dest_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_rename_dest_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_dest_works="guessing no" ;; esac ]) rm -rf conftest.f conftest.d1 conftest.d2 diff --git a/gdb/gnulib/import/m4/rewinddir.m4 b/gdb/gnulib/import/m4/rewinddir.m4 index 0d3d6c6..4a78c1f 100644 --- a/gdb/gnulib/import/m4/rewinddir.m4 +++ b/gdb/gnulib/import/m4/rewinddir.m4 @@ -1,5 +1,5 @@ # rewinddir.m4 serial 1 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/rmdir.m4 b/gdb/gnulib/import/m4/rmdir.m4 index ebb3b5d..a24d845 100644 --- a/gdb/gnulib/import/m4/rmdir.m4 +++ b/gdb/gnulib/import/m4/rmdir.m4 @@ -1,5 +1,5 @@ -# rmdir.m4 serial 13 -dnl Copyright (C) 2002, 2005, 2009-2016 Free Software Foundation, Inc. +# rmdir.m4 serial 16 +dnl Copyright (C) 2002, 2005, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -33,10 +33,14 @@ AC_DEFUN([gl_FUNC_RMDIR], ]])], [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rmdir_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_rmdir_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rmdir_works="guessing no" ;; esac ]) rm -rf conftest.dir conftest.file]) diff --git a/gdb/gnulib/import/m4/save-cwd.m4 b/gdb/gnulib/import/m4/save-cwd.m4 index d6e2410..d0270ea 100644 --- a/gdb/gnulib/import/m4/save-cwd.m4 +++ b/gdb/gnulib/import/m4/save-cwd.m4 @@ -1,5 +1,5 @@ # serial 10 -dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/secure_getenv.m4 b/gdb/gnulib/import/m4/secure_getenv.m4 deleted file mode 100644 index 3983173..0000000 --- a/gdb/gnulib/import/m4/secure_getenv.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# Look up an environment variable more securely. -dnl Copyright 2013-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_SECURE_GETENV], -[ - dnl Persuade glibc <stdlib.h> to declare secure_getenv(). - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - - AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([secure_getenv]) - if test $ac_cv_func_secure_getenv = no; then - HAVE_SECURE_GETENV=0 - fi -]) - -# Prerequisites of lib/secure_getenv.c. -AC_DEFUN([gl_PREREQ_SECURE_GETENV], [ - AC_CHECK_FUNCS([__secure_getenv]) - if test $ac_cv_func___secure_getenv = no; then - AC_CHECK_FUNCS([issetugid]) - fi - AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid]) -]) diff --git a/gdb/gnulib/import/m4/setenv.m4 b/gdb/gnulib/import/m4/setenv.m4 index 5d49aba..5d257f7 100644 --- a/gdb/gnulib/import/m4/setenv.m4 +++ b/gdb/gnulib/import/m4/setenv.m4 @@ -1,5 +1,5 @@ -# setenv.m4 serial 26 -dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc. +# setenv.m4 serial 27 +dnl Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -35,10 +35,10 @@ AC_DEFUN([gl_FUNC_SETENV], ]])], [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], [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" ;; + # Guess yes on glibc systems. + *-gnu* | 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 diff --git a/gdb/gnulib/import/m4/signal_h.m4 b/gdb/gnulib/import/m4/signal_h.m4 index bcfd7b4..394b91d 100644 --- a/gdb/gnulib/import/m4/signal_h.m4 +++ b/gdb/gnulib/import/m4/signal_h.m4 @@ -1,5 +1,5 @@ # signal_h.m4 serial 18 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/ssize_t.m4 b/gdb/gnulib/import/m4/ssize_t.m4 index 3e7b9e6..0977f20 100644 --- a/gdb/gnulib/import/m4/ssize_t.m4 +++ b/gdb/gnulib/import/m4/ssize_t.m4 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/stat-time.m4 b/gdb/gnulib/import/m4/stat-time.m4 new file mode 100644 index 0000000..d0d17ed --- /dev/null +++ b/gdb/gnulib/import/m4/stat-time.m4 @@ -0,0 +1,83 @@ +# Checks for stat-related time functions. + +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2018 Free Software +# Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# st_atim.tv_nsec - Linux, Solaris, Cygwin +# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE +# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE +# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) + +# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) +# st_birthtim - Cygwin 1.7.0+ + +AC_DEFUN([gl_STAT_TIME], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + + AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], + [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ + #include <sys/types.h> + #include <sys/stat.h> + #if HAVE_SYS_TIME_H + # include <sys/time.h> + #endif + #include <time.h> + struct timespec ts; + struct stat st; + ]], + [[ + st.st_atim = ts; + ]])], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1], + [Define to 1 if the type of the st_atim member of a struct stat is + struct timespec.]) + fi], + [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>]) +]) + +# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.) +# and NTFS (Cygwin). +# There was a time when this field was named st_createtime (21 June +# 2002 to 16 July 2002) But that window is very small and applied only +# to development code, so systems still using that configuration are +# not supported. See revisions 1.10 and 1.11 of FreeBSD's +# src/sys/ufs/ufs/dinode.h. +# +AC_DEFUN([gl_STAT_BIRTHTIME], +[ + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>])], + [#include <sys/types.h> + #include <sys/stat.h>]) +]) diff --git a/gdb/gnulib/import/m4/stat.m4 b/gdb/gnulib/import/m4/stat.m4 index a794975..e8ec3b2 100644 --- a/gdb/gnulib/import/m4/stat.m4 +++ b/gdb/gnulib/import/m4/stat.m4 @@ -1,6 +1,6 @@ -# serial 11 +# serial 15 -# Copyright (C) 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8,64 +8,67 @@ AC_DEFUN([gl_FUNC_STAT], [ - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([lstat]) - dnl mingw is the only known platform where stat(".") and stat("./") differ - AC_CACHE_CHECK([whether stat handles trailing slashes on directories], - [gl_cv_func_stat_dir_slash], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[#include <sys/stat.h> -]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])], - [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no], - [case $host_os in - mingw*) gl_cv_func_stat_dir_slash="guessing no";; - *) gl_cv_func_stat_dir_slash="guessing yes";; - esac])]) - dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). - dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) - dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). - AC_CACHE_CHECK([whether stat handles trailing slashes on files], - [gl_cv_func_stat_file_slash], - [touch conftest.tmp - # Assume that if we have lstat, we can also check symlinks. - if test $ac_cv_func_lstat = yes; then - ln -s conftest.tmp conftest.lnk - fi - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[#include <sys/stat.h> + case "$host_os" in + mingw*) + dnl On this platform, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + REPLACE_STAT=1 + ;; + *) + dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). + dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) + dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). + AC_CACHE_CHECK([whether stat handles trailing slashes on files], + [gl_cv_func_stat_file_slash], + [touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/stat.h> ]], [[int result = 0; - struct stat st; - if (!stat ("conftest.tmp/", &st)) - result |= 1; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; #if HAVE_LSTAT - if (!stat ("conftest.lnk/", &st)) - result |= 2; + if (!stat ("conftest.lnk/", &st)) + result |= 2; #endif - return result; - ]])], - [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], - [case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_stat_file_slash="guessing no" ;; - esac - ]) - rm -f conftest.tmp conftest.lnk]) - case $gl_cv_func_stat_dir_slash in - *no) REPLACE_STAT=1 - AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs - help when passed a directory name with a trailing slash]);; - esac - case $gl_cv_func_stat_file_slash in - *no) REPLACE_STAT=1 - AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs - help when passed a file name with a trailing slash]);; + return result; + ]])], + [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], + [case "$host_os" in + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac + ]) + rm -f conftest.tmp conftest.lnk]) + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs + help when passed a file name with a trailing slash]);; + esac + case $host_os in + dnl Solaris stat can return a negative tv_nsec. + solaris*) + REPLACE_FSTAT=1 ;; + esac + ;; esac ]) -# Prerequisites of lib/stat.c. -AC_DEFUN([gl_PREREQ_STAT], [:]) +# Prerequisites of lib/stat.c and lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_STAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + : +]) diff --git a/gdb/gnulib/import/m4/std-gnu11.m4 b/gdb/gnulib/import/m4/std-gnu11.m4 new file mode 100644 index 0000000..c85ac43 --- /dev/null +++ b/gdb/gnulib/import/m4/std-gnu11.m4 @@ -0,0 +1,824 @@ +# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- + +# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 +# commit 017d5ddd82854911f0119691d91ea8a1438824d6 +# dated Sun Apr 3 13:57:17 2016 -0700 +# This implementation will be obsolete once we can assume Autoconf 2.70 +# or later is installed everywhere a Gnulib program might be developed. + + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. + +# This program 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 program 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 program. If not, see <https://www.gnu.org/licenses/>. + +# Written by David MacKenzie, with help from +# Akim Demaille, Paul Eggert, +# François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + + +# AC_PROG_CC([COMPILER ...]) +# -------------------------- +# COMPILER ... is a space separated list of C compilers to search for. +# This just gives the user an opportunity to specify an alternative +# search list for the C compiler. +AC_DEFUN_ONCE([AC_PROG_CC], +[AC_LANG_PUSH(C)dnl +AC_ARG_VAR([CC], [C compiler command])dnl +AC_ARG_VAR([CFLAGS], [C compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +_AC_ARG_VAR_LIBS()dnl +_AC_ARG_VAR_CPPFLAGS()dnl +m4_ifval([$1], + [AC_CHECK_TOOLS(CC, [$1])], +[AC_CHECK_TOOL(CC, gcc) +if test -z "$CC"; then + dnl Here we want: + dnl AC_CHECK_TOOL(CC, cc) + dnl but without the check for a tool without the prefix. + dnl Until the check is removed from there, copy the code: + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc]) + fi +fi +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) +fi +if test -z "$CC"; then + AC_CHECK_TOOLS(CC, cl.exe) +fi +if test -z "$CC"; then + AC_CHECK_TOOL(CC, clang) +fi +]) + +test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) + +# Provide some information about the compiler. +_AS_ECHO_LOG([checking for _AC_LANG compiler version]) +set X $ac_compile +ac_compiler=$[2] +for ac_option in --version -v -V -qversion -version; do + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) +done + +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +_AC_LANG_COMPILER_GNU +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +_AC_PROG_CC_G +dnl +dnl Set ac_prog_cc_stdc to the supported C version. +dnl Also set the documented variable ac_cv_prog_cc_stdc; +dnl its name was chosen when it was cached, but it is no longer cached. +_AC_PROG_CC_C11([ac_prog_cc_stdc=c11 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11], + [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99], + [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89 + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89], + [ac_prog_cc_stdc=no + ac_cv_prog_cc_stdc=no])])]) +dnl +AC_LANG_POP(C)dnl +])# AC_PROG_CC + + + +# AC_PROG_CXX([LIST-OF-COMPILERS]) +# -------------------------------- +# LIST-OF-COMPILERS is a space separated list of C++ compilers to search +# for (if not specified, a default list is used). This just gives the +# user an opportunity to specify an alternative search list for the C++ +# compiler. +# aCC HP-UX C++ compiler much better than `CC', so test before. +# FCC Fujitsu C++ compiler +# KCC KAI C++ compiler +# RCC Rational C++ +# xlC_r AIX C Set++ (with support for reentrant code) +# xlC AIX C Set++ +AC_DEFUN([AC_PROG_CXX], +[AC_LANG_PUSH(C++)dnl +AC_ARG_VAR([CXX], [C++ compiler command])dnl +AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +_AC_ARG_VAR_LIBS()dnl +_AC_ARG_VAR_CPPFLAGS()dnl +_AC_ARG_VAR_PRECIOUS([CCC])dnl +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + AC_CHECK_TOOLS(CXX, + [m4_default([$1], + [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])], + g++) + fi +fi +# Provide some information about the compiler. +_AS_ECHO_LOG([checking for _AC_LANG compiler version]) +set X $ac_compile +ac_compiler=$[2] +for ac_option in --version -v -V -qversion; do + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) +done + +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +_AC_LANG_COMPILER_GNU +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +_AC_PROG_CXX_G +_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11 + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11], + [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98 + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98], + [ac_prog_cxx_stdcxx=no + ac_cv_prog_cxx_stdcxx=no])]) +AC_LANG_POP(C++)dnl +])# AC_PROG_CXX + + +# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, +# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) +# -------------------------------------------------------------- +# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') +# by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails, +# try again with each compiler option in the space-separated OPTION-LIST; if one +# helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE, +# else ACTION-IF-UNAVAILABLE. +AC_DEFUN([_AC_C_STD_TRY], +[AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features]) +AC_CACHE_VAL(ac_cv_prog_cc_$1, +[ac_cv_prog_cc_$1=no +ac_save_CC=$CC +AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) +for ac_arg in '' $4 +do + CC="$ac_save_CC $ac_arg" + _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) + test "x$ac_cv_prog_cc_$1" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +])# AC_CACHE_VAL +ac_prog_cc_stdc_options= +case "x$ac_cv_prog_cc_$1" in + x) + AC_MSG_RESULT([none needed]) ;; + xno) + AC_MSG_RESULT([unsupported]) ;; + *) + ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1" + CC=$CC$ac_prog_cc_stdc_options + AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;; +esac +AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6]) +])# _AC_C_STD_TRY + +# _AC_C_C99_TEST_HEADER +# --------------------- +# A C header suitable for testing for C99. +AC_DEFUN([_AC_C_C99_TEST_HEADER], +[[#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +}]])# _AC_C_C99_TEST_HEADER + +# _AC_C_C99_TEST_BODY +# ------------------- +# A C body suitable for testing for C99, assuming the corresponding header. +AC_DEFUN([_AC_C_C99_TEST_BODY], +[[ + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); +]]) + +# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +# ---------------------------------------------------------------- +# If the C compiler is not in ISO C99 mode by default, try to add an +# option to output variable CC to make it so. This macro tries +# various options that select ISO C99 on some system or another. It +# considers the compiler to be in ISO C99 mode if it handles _Bool, +# // comments, flexible array members, inline, long long int, mixed +# code and declarations, named initialization of structs, restrict, +# va_copy, varargs macros, variable declarations in for loops and +# variable length arrays. +AC_DEFUN([_AC_PROG_CC_C99], +[_AC_C_STD_TRY([c99], +[_AC_C_C99_TEST_HEADER], +[_AC_C_C99_TEST_BODY], +dnl Try +dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) +dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) +dnl IBM XL C -qlanglvl=extc99 +dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99) +dnl HP cc -AC99 +dnl Intel ICC -std=c99, -c99 (deprecated) +dnl IRIX -c99 +dnl Solaris -D_STDC_C99= +dnl cc's -xc99 option uses linker magic to define the external +dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 +dnl behavior for C library functions. This is not wanted here, +dnl because it means that a single module compiled with -xc99 +dnl alters C runtime behavior for the entire program, not for +dnl just the module. Instead, define the (private) symbol +dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>. +dnl The resulting compiler passes the test case here, and that's +dnl good enough. For more, please see the thread starting at: +dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html +dnl Tru64 -c99 +dnl with extended modes being tried first. +[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl +])# _AC_PROG_CC_C99 + + +# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +# ---------------------------------------------------------------- +# If the C compiler is not in ISO C11 mode by default, try to add an +# option to output variable CC to make it so. This macro tries +# various options that select ISO C11 on some system or another. It +# considers the compiler to be in ISO C11 mode if it handles _Alignas, +# _Alignof, _Noreturn, _Static_assert, UTF-8 string literals, +# duplicate typedefs, and anonymous structures and unions. +AC_DEFUN([_AC_PROG_CC_C11], +[_AC_C_STD_TRY([c11], +[_AC_C_C99_TEST_HEADER[ +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +]], +[_AC_C_C99_TEST_BODY[ + v1.i = 2; + v1.w.k = 5; + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); +]], +dnl Try +dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) +dnl with extended modes being tried first. +dnl +dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as +dnl of September 2012) does not pass the C11 test. For now, try extc1x when +dnl compiling the C99 test instead, since it enables _Static_assert and +dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes +dnl the C11 test in some future version of IBM XL C, we'll add it here, +dnl preferably extc11. +[[-std=gnu11]], [$1], [$2])[]dnl +])# _AC_PROG_CC_C11 + + +# AC_PROG_CC_C89 +# -------------- +# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC, +# as that'd be incompatible with how Automake redefines AC_PROG_CC. See +# <https://lists.gnu.org/r/autoconf/2012-10/msg00048.html>. +AU_DEFUN([AC_PROG_CC_C89], + [AC_REQUIRE([AC_PROG_CC])], + [$0 is obsolete; use AC_PROG_CC] +) + +# AC_PROG_CC_C99 +# -------------- +AU_DEFUN([AC_PROG_CC_C99], + [AC_REQUIRE([AC_PROG_CC])], + [$0 is obsolete; use AC_PROG_CC] +) + +# AC_PROG_CC_STDC +# --------------- +AU_DEFUN([AC_PROG_CC_STDC], + [AC_REQUIRE([AC_PROG_CC])], + [$0 is obsolete; use AC_PROG_CC] +) + + +# AC_C_PROTOTYPES +# --------------- +# Check if the C compiler supports prototypes, included if it needs +# options. +AC_DEFUN([AC_C_PROTOTYPES], +[AC_REQUIRE([AC_PROG_CC])dnl +if test "$ac_prog_cc_stdc" != no; then + AC_DEFINE(PROTOTYPES, 1, + [Define to 1 if the C compiler supports function prototypes.]) + AC_DEFINE(__PROTOTYPES, 1, + [Define like PROTOTYPES; this can be used by system headers.]) +fi +])# AC_C_PROTOTYPES + + +# _AC_CXX_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, +# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) +# ---------------------------------------------------------------- +# Check whether the C++ compiler accepts features of STANDARD (e.g +# `cxx98', `cxx11') by trying to compile a program of TEST-PROLOGUE +# and TEST-BODY. If this fails, try again with each compiler option +# in the space-separated OPTION-LIST; if one helps, append it to CXX. +# If eventually successful, run ACTION-IF-AVAILABLE, else +# ACTION-IF-UNAVAILABLE. +AC_DEFUN([_AC_CXX_STD_TRY], +[AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features]) +AC_LANG_PUSH(C++)dnl +AC_CACHE_VAL(ac_cv_prog_cxx_$1, +[ac_cv_prog_cxx_$1=no +ac_save_CXX=$CXX +AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) +for ac_arg in '' $4 +do + CXX="$ac_save_CXX $ac_arg" + _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg]) + test "x$ac_cv_prog_cxx_$1" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +])# AC_CACHE_VAL +ac_prog_cxx_stdcxx_options= +case "x$ac_cv_prog_cxx_$1" in + x) + AC_MSG_RESULT([none needed]) ;; + xno) + AC_MSG_RESULT([unsupported]) ;; + *) + ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1" + CXX=$CXX$ac_prog_cxx_stdcxx_options + AC_MSG_RESULT([$ac_cv_prog_cxx_$1]) ;; +esac +AC_LANG_POP(C++)dnl +AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$5], [$6]) +])# _AC_CXX_STD_TRY + +# _AC_CXX_CXX98_TEST_HEADER +# ------------------------- +# A C++ header suitable for testing for CXX98. +AC_DEFUN([_AC_CXX_CXX98_TEST_HEADER], +[[ +#include <algorithm> +#include <cstdlib> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <list> +#include <map> +#include <set> +#include <sstream> +#include <stdexcept> +#include <string> +#include <utility> +#include <vector> + +namespace test { + typedef std::vector<std::string> string_vec; + typedef std::pair<int,bool> map_value; + typedef std::map<std::string,map_value> map_type; + typedef std::set<int> set_type; + + template<typename T> + class printer { + public: + printer(std::ostringstream& os): os(os) {} + void operator() (T elem) { os << elem << std::endl; } + private: + std::ostringstream& os; + }; +} +]])# _AC_CXX_CXX98_TEST_HEADER + +# _AC_CXX_CXX98_TEST_BODY +# ----------------------- +# A C++ body suitable for testing for CXX98, assuming the corresponding header. +AC_DEFUN([_AC_CXX_CXX98_TEST_BODY], +[[ + +try { + // Basic string. + std::string teststr("ASCII text"); + teststr += " string"; + + // Simple vector. + test::string_vec testvec; + testvec.push_back(teststr); + testvec.push_back("foo"); + testvec.push_back("bar"); + if (testvec.size() != 3) { + throw std::runtime_error("vector size is not 1"); + } + + // Dump vector into stringstream and obtain string. + std::ostringstream os; + for (test::string_vec::const_iterator i = testvec.begin(); + i != testvec.end(); ++i) { + if (i + 1 != testvec.end()) { + os << teststr << '\n'; + } + } + // Check algorithms work. + std::for_each(testvec.begin(), testvec.end(), test::printer<std::string>(os)); + std::string os_out = os.str(); + + // Test pair and map. + test::map_type testmap; + testmap.insert(std::make_pair(std::string("key"), + std::make_pair(53,false))); + + // Test set. + int values[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + test::set_type testset(values, values + sizeof(values)/sizeof(values[0])); + std::list<int> testlist(testset.begin(), testset.end()); + std::copy(testset.begin(), testset.end(), std::back_inserter(testlist)); +} catch (const std::exception& e) { + std::cerr << "Caught exception: " << e.what() << std::endl; + + // Test fstream + std::ofstream of("test.txt"); + of << "Test ASCII text\n" << std::flush; + of << "N= " << std::hex << std::setw(8) << std::left << 534 << std::endl; + of.close(); +} +std::exit(0); +]]) + +# _AC_CXX_CXX11_TEST_HEADER +# ------------------------- +# A C++ header suitable for testing for CXX11. +AC_DEFUN([_AC_CXX_CXX11_TEST_HEADER], +[[ +#include <deque> +#include <functional> +#include <memory> +#include <tuple> +#include <array> +#include <regex> +#include <iostream> + +namespace cxx11test +{ + typedef std::shared_ptr<std::string> sptr; + typedef std::weak_ptr<std::string> wptr; + + typedef std::tuple<std::string,int,double> tp; + typedef std::array<int, 20> int_array; + + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; +} +]])# _AC_CXX_CXX11_TEST_HEADER + +# _AC_CXX_CXX11_TEST_BODY +# ----------------------- +# A C++ body suitable for testing for CXX11, assuming the corresponding header. +AC_DEFUN([_AC_CXX_CXX11_TEST_BODY], +[[ +{ + // Test auto and decltype + std::deque<int> d; + d.push_front(43); + d.push_front(484); + d.push_front(3); + d.push_front(844); + int total = 0; + for (auto i = d.begin(); i != d.end(); ++i) { total += *i; } + + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for and lambda + cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (int &x : array) { x += 23; } + std::for_each(array.begin(), array.end(), [](int v1){ std::cout << v1; }); +} +{ + using cxx11test::sptr; + using cxx11test::wptr; + + sptr sp(new std::string("ASCII string")); + wptr wp(sp); + sptr sp2(wp); +} +{ + cxx11test::tp tuple("test", 54, 45.53434); + double d = std::get<2>(tuple); + std::string s; + int i; + std::tie(s,i,d) = tuple; +} +{ + static std::regex filename_regex("^_?([a-z0-9_.]+-)+[a-z0-9]+$"); + std::string testmatch("Test if this string matches"); + bool match = std::regex_search(testmatch, filename_regex); +} +{ + cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + cxx11test::int_array::size_type size = array.size(); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + std::vector<std::pair<int,char*>> v1; +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +]]) + +# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +# ------------------------------------------------------------------- + +# If the C++ compiler is not in ISO C++98 mode by default, try to add +# an option to output variable CXX to make it so. This macro tries +# various options that select ISO C++98 on some system or another. It +# considers the compiler to be in ISO C++98 mode if it handles basic +# features of the std namespace including: string, containers (list, +# map, set, vector), streams (fstreams, iostreams, stringstreams, +# iomanip), pair, exceptions and algorithms. + + +AC_DEFUN([_AC_PROG_CXX_CXX98], +[_AC_CXX_STD_TRY([cxx98], +[_AC_CXX_CXX98_TEST_HEADER], +[_AC_CXX_CXX98_TEST_BODY], +dnl Try +dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98) +dnl IBM XL C -qlanglvl=extended +dnl HP aC++ -AA +dnl Intel ICC -std=gnu++98 +dnl Solaris N/A (default) +dnl Tru64 N/A (default, but -std gnu could be used) +dnl with extended modes being tried first. +[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl +])# _AC_PROG_CXX_CXX98 + +# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +# ------------------------------------------------------------------- +# If the C++ compiler is not in ISO CXX11 mode by default, try to add +# an option to output variable CXX to make it so. This macro tries +# various options that select ISO C++11 on some system or another. It +# considers the compiler to be in ISO C++11 mode if it handles all the +# tests from the C++98 checks, plus the following: Language features +# (auto, constexpr, decltype, default/deleted constructors, delegate +# constructors, final, initializer lists, lambda functions, nullptr, +# override, range-based for loops, template brackets without spaces, +# unicode literals) and library features (array, memory (shared_ptr, +# weak_ptr), regex and tuple types). +AC_DEFUN([_AC_PROG_CXX_CXX11], +[_AC_CXX_STD_TRY([cxx11], +[_AC_CXX_CXX11_TEST_HEADER +_AC_CXX_CXX98_TEST_HEADER], +[_AC_CXX_CXX11_TEST_BODY +_AC_CXX_CXX98_TEST_BODY], +dnl Try +dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants] +dnl IBM XL C -qlanglvl=extended0x +dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11) +dnl HP aC++ -AA +dnl Intel ICC -std=c++11 -std=c++0x +dnl Solaris N/A (no support) +dnl Tru64 N/A (no support) +dnl with extended modes being tried first. +[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl +])# _AC_PROG_CXX_CXX11 diff --git a/gdb/gnulib/import/m4/stdbool.m4 b/gdb/gnulib/import/m4/stdbool.m4 index 2a9b1db..f8c0577 100644 --- a/gdb/gnulib/import/m4/stdbool.m4 +++ b/gdb/gnulib/import/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -87,8 +87,8 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL], 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 + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html */ Bool q = true; Bool *pq = &q; diff --git a/gdb/gnulib/import/m4/stddef_h.m4 b/gdb/gnulib/import/m4/stddef_h.m4 index c045c65..ba3d201 100644 --- a/gdb/gnulib/import/m4/stddef_h.m4 +++ b/gdb/gnulib/import/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-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/stdint.m4 b/gdb/gnulib/import/m4/stdint.m4 index 05b6ab7..38dbbed 100644 --- a/gdb/gnulib/import/m4/stdint.m4 +++ b/gdb/gnulib/import/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 48 -dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. +# stdint.m4 serial 52 +dnl Copyright (C) 2001-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,8 +10,10 @@ dnl Test whether <stdint.h> is supported or must be substituted. AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_LIMITS_H]) + AC_REQUIRE([gt_TYPE_WINT_T]) dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -287,8 +289,12 @@ static const char *macro_values[] = ]])], [gl_cv_header_working_stdint_h=yes], [], - [dnl When cross-compiling, assume it works. - gl_cv_header_working_stdint_h=yes + [case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; + # In general, assume it works. + *) gl_cv_header_working_stdint_h="guessing yes" ;; + esac ]) ]) ]) @@ -298,15 +304,16 @@ static const char *macro_values[] = HAVE_SYS_BITYPES_H=0 HAVE_SYS_INTTYPES_H=0 STDINT_H=stdint.h - if test "$gl_cv_header_working_stdint_h" = yes; then - 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([[ + case "$gl_cv_header_working_stdint_h" in + *yes) + 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> ] @@ -314,49 +321,50 @@ gl_STDINT_INCLUDES [ intmax_t im = INTMAX_MAX; int32_t i32 = INT32_C (0x7fffffff); - ]])], - [gl_cv_header_stdint_predates_cxx11_h=no])]) + ]])], + [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 - fi - if test $ac_cv_header_sys_bitypes_h = yes; then - HAVE_SYS_BITYPES_H=1 - fi - gl_STDINT_TYPE_PROPERTIES - fi + 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 + ;; + *) + 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 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi + gl_STDINT_TYPE_PROPERTIES + ;; + esac - # 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"]) + dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. + gl_REPLACE_LIMITS_H AC_SUBST([HAVE_C99_STDINT_H]) AC_SUBST([HAVE_SYS_BITYPES_H]) @@ -528,7 +536,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], 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 + if test $GNULIB_OVERRIDES_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi ]) diff --git a/gdb/gnulib/import/m4/stdio_h.m4 b/gdb/gnulib/import/m4/stdio_h.m4 index eaa25a0..0debe69 100644 --- a/gdb/gnulib/import/m4/stdio_h.m4 +++ b/gdb/gnulib/import/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 48 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# stdio_h.m4 serial 49 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,7 +28,7 @@ AC_DEFUN([gl_STDIO_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__) && \ + #if (defined _WIN32 && ! defined __CYGWIN__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; #endif diff --git a/gdb/gnulib/import/m4/stdlib_h.m4 b/gdb/gnulib/import/m4/stdlib_h.m4 index 3999068..49dc5d5 100644 --- a/gdb/gnulib/import/m4/stdlib_h.m4 +++ b/gdb/gnulib/import/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 43 -dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. +# stdlib_h.m4 serial 45 +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,6 +14,9 @@ AC_DEFUN([gl_STDLIB_H], dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include <stdlib.h> #if HAVE_SYS_LOADAVG_H +/* OpenIndiana has a bug: <sys/time.h> must be included before + <sys/loadavg.h>. */ +# include <sys/time.h> # include <sys/loadavg.h> #endif #if HAVE_RANDOM_H @@ -21,9 +24,9 @@ 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 qsort_r random random_r realpath rpmatch - secure_getenv setenv setstate setstate_r srandom srandom_r - strtod strtoll strtoull unlockpt unsetenv]) + posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray + realpath rpmatch secure_getenv setenv setstate setstate_r srandom + srandom_r strtod strtoll strtoull unlockpt unsetenv]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -58,6 +61,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], 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_REALLOCARRAY=0; AC_SUBST([GNULIB_REALLOCARRAY]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) @@ -77,6 +81,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) + HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) @@ -89,11 +94,13 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], 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_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY]) 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_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) diff --git a/gdb/gnulib/import/m4/strchrnul.m4 b/gdb/gnulib/import/m4/strchrnul.m4 index ac5c211..689f128 100644 --- a/gdb/gnulib/import/m4/strchrnul.m4 +++ b/gdb/gnulib/import/m4/strchrnul.m4 @@ -1,5 +1,5 @@ # strchrnul.m4 serial 9 -dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/strdup.m4 b/gdb/gnulib/import/m4/strdup.m4 index ff7060a..dddaa01 100644 --- a/gdb/gnulib/import/m4/strdup.m4 +++ b/gdb/gnulib/import/m4/strdup.m4 @@ -1,6 +1,6 @@ # strdup.m4 serial 13 -dnl Copyright (C) 2002-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2018 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/gdb/gnulib/import/m4/strerror.m4 b/gdb/gnulib/import/m4/strerror.m4 index e286594..b886b8d 100644 --- a/gdb/gnulib/import/m4/strerror.m4 +++ b/gdb/gnulib/import/m4/strerror.m4 @@ -1,5 +1,5 @@ -# strerror.m4 serial 17 -dnl Copyright (C) 2002, 2007-2016 Free Software Foundation, Inc. +# strerror.m4 serial 19 +dnl Copyright (C) 2002, 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,10 +24,10 @@ AC_DEFUN([gl_FUNC_STRERROR], [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" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; esac ]) ]) @@ -78,10 +78,12 @@ AC_DEFUN([gl_FUNC_STRERROR_0], [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" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) 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 ]) ]) diff --git a/gdb/gnulib/import/m4/string_h.m4 b/gdb/gnulib/import/m4/string_h.m4 index 0c5ec6f..97c80dc 100644 --- a/gdb/gnulib/import/m4/string_h.m4 +++ b/gdb/gnulib/import/m4/string_h.m4 @@ -1,11 +1,11 @@ # Configure a GNU-like replacement for <string.h>. -# Copyright (C) 2007-2016 Free Software Foundation, Inc. +# Copyright (C) 2007-2018 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 21 +# serial 22 # Written by Paul Eggert. @@ -43,6 +43,7 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR], AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ + GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) @@ -82,6 +83,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], 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_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) @@ -105,16 +107,16 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) + REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) + REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) + REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) + REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) - REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) + REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) 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]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) - REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) diff --git a/gdb/gnulib/import/m4/strstr.m4 b/gdb/gnulib/import/m4/strstr.m4 index bfe4c85..aa590a9 100644 --- a/gdb/gnulib/import/m4/strstr.m4 +++ b/gdb/gnulib/import/m4/strstr.m4 @@ -1,5 +1,5 @@ -# strstr.m4 serial 17 -dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. +# strstr.m4 serial 19 +dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,10 @@ 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 + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then REPLACE_STRSTR=1 else - dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092. + dnl Detect https://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([[ @@ -99,6 +99,9 @@ static void quit (int sig) { _exit (sig + 128); } if (!strstr (haystack, needle)) result |= 1; } + /* Free allocated memory, in case some sanitizer is watching. */ + free (haystack); + free (needle); return result; ]])], [gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no], diff --git a/gdb/gnulib/import/m4/strtok_r.m4 b/gdb/gnulib/import/m4/strtok_r.m4 index d010307..b777089 100644 --- a/gdb/gnulib/import/m4/strtok_r.m4 +++ b/gdb/gnulib/import/m4/strtok_r.m4 @@ -1,5 +1,5 @@ -# strtok_r.m4 serial 13 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation, +# strtok_r.m4 serial 15 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2018 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_STRTOK_R], dnl when the second argument to strtok_r is a constant string that has dnl exactly one byte and compiling with optimization. This bug is, for dnl example, present in the glibc 2.7-18 package in Debian "lenny". - dnl See <http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614>. + dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=5614>. AC_CACHE_CHECK([whether strtok_r works], [gl_cv_func_strtok_r_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ @@ -41,14 +41,13 @@ AC_DEFUN([gl_FUNC_STRTOK_R], ], [gl_cv_func_strtok_r_works=yes], [gl_cv_func_strtok_r_works=no], - [ -changequote(,)dnl - case "$host_os" in - # Guess no on glibc systems. - *-gnu*) gl_cv_func_strtok_r_works="guessing no";; - *) gl_cv_func_strtok_r_works="guessing yes";; + [case "$host_os" in + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_strtok_r_works="guessing yes" ;; + *) gl_cv_func_strtok_r_works="guessing yes" ;; esac -changequote([,])dnl ]) ]) case "$gl_cv_func_strtok_r_works" in diff --git a/gdb/gnulib/import/m4/sys_socket_h.m4 b/gdb/gnulib/import/m4/sys_socket_h.m4 index ae500c7..f210378 100644 --- a/gdb/gnulib/import/m4/sys_socket_h.m4 +++ b/gdb/gnulib/import/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 23 -dnl Copyright (C) 2005-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/sys_stat_h.m4 b/gdb/gnulib/import/m4/sys_stat_h.m4 index 3d43b6f..52f06aa 100644 --- a/gdb/gnulib/import/m4/sys_stat_h.m4 +++ b/gdb/gnulib/import/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ -# sys_stat_h.m4 serial 28 -*- Autoconf -*- -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +# sys_stat_h.m4 serial 31 -*- Autoconf -*- +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,18 +19,21 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) - dnl Whether to override 'struct stat'. + dnl Whether to enable precise timestamps in 'struct stat'. + m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [ + AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC]) + ], [ + WINDOWS_STAT_TIMESPEC=0 + ]) + AC_SUBST([WINDOWS_STAT_TIMESPEC]) + + dnl Whether to ensure that struct stat.st_size is 64-bit wide. m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([gl_LARGEFILE]) ], [ WINDOWS_64_BIT_ST_SIZE=0 ]) AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) - if test $WINDOWS_64_BIT_ST_SIZE = 1; then - AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1], - [Define to 1 if Gnulib overrides 'struct stat' on Windows so that - struct stat.st_size becomes 64-bit.]) - fi dnl Define types that are supposed to be defined in <sys/types.h> or dnl <sys/stat.h>. @@ -72,6 +75,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) + GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) diff --git a/gdb/gnulib/import/m4/sys_time_h.m4 b/gdb/gnulib/import/m4/sys_time_h.m4 index 3061a9c..d7e9268 100644 --- a/gdb/gnulib/import/m4/sys_time_h.m4 +++ b/gdb/gnulib/import/m4/sys_time_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for <sys/time.h>. -# serial 8 +# serial 9 -# Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2018 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. @@ -105,7 +105,6 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) - HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) ]) diff --git a/gdb/gnulib/import/m4/sys_types_h.m4 b/gdb/gnulib/import/m4/sys_types_h.m4 index 159b005..2debfb0 100644 --- a/gdb/gnulib/import/m4/sys_types_h.m4 +++ b/gdb/gnulib/import/m4/sys_types_h.m4 @@ -1,11 +1,14 @@ -# sys_types_h.m4 serial 6 -dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. +# sys_types_h.m4 serial 9 +dnl Copyright (C) 2011-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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], [ + dnl Use sane struct stat types in OpenVMS 8.2 and later. + AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.]) + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) gl_NEXT_HEADERS([sys/types.h]) @@ -17,6 +20,14 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], dnl Whether to override the 'off_t' type. AC_REQUIRE([gl_TYPE_OFF_T]) + + dnl Whether to override the 'dev_t' and 'ino_t' types. + m4_ifdef([gl_WINDOWS_STAT_INODES], [ + AC_REQUIRE([gl_WINDOWS_STAT_INODES]) + ], [ + WINDOWS_STAT_INODES=0 + ]) + AC_SUBST([WINDOWS_STAT_INODES]) ]) AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], @@ -24,12 +35,12 @@ 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> +# See <https://lists.gnu.org/r/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 +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e987d7ee695fb4294a82d987ec3dc9b974 m4_undefine([AC_HEADER_MAJOR]) AC_DEFUN([AC_HEADER_MAJOR], diff --git a/gdb/gnulib/import/m4/tempname.m4 b/gdb/gnulib/import/m4/tempname.m4 index acf4c8d..ed813f1 100644 --- a/gdb/gnulib/import/m4/tempname.m4 +++ b/gdb/gnulib/import/m4/tempname.m4 @@ -1,6 +1,6 @@ #serial 5 -# Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2006-2007, 2009-2018 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/gdb/gnulib/import/m4/time_h.m4 b/gdb/gnulib/import/m4/time_h.m4 index eb2a631..ad6f2f5 100644 --- a/gdb/gnulib/import/m4/time_h.m4 +++ b/gdb/gnulib/import/m4/time_h.m4 @@ -1,8 +1,8 @@ # Configure a more-standard replacement for <time.h>. -# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2018 Free Software Foundation, Inc. -# serial 9 +# serial 11 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -104,24 +104,34 @@ AC_DEFUN([gl_TIME_MODULE_INDICATOR], AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], [ + GNULIB_CTIME=0; AC_SUBST([GNULIB_CTIME]) GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) + GNULIB_LOCALTIME=0; AC_SUBST([GNULIB_LOCALTIME]) GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) + GNULIB_STRFTIME=0; AC_SUBST([GNULIB_STRFTIME]) GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) + GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) + HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) + dnl Even GNU libc does not have timezone_t yet. + HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) dnl If another module says to replace or to not replace, do that. dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; dnl this lets maintainers check for portability. + REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME]) REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) + REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET]) dnl Hack so that the time module doesn't depend on the sys_time module. dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. diff --git a/gdb/gnulib/import/m4/unistd-safer.m4 b/gdb/gnulib/import/m4/unistd-safer.m4 index ceb5cc6..2027f77 100644 --- a/gdb/gnulib/import/m4/unistd-safer.m4 +++ b/gdb/gnulib/import/m4/unistd-safer.m4 @@ -1,5 +1,5 @@ #serial 9 -dnl Copyright (C) 2002, 2005-2006, 2009-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/unistd_h.m4 b/gdb/gnulib/import/m4/unistd_h.m4 index 544dadb..3ba64da 100644 --- a/gdb/gnulib/import/m4/unistd_h.m4 +++ b/gdb/gnulib/import/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 68 -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +# unistd_h.m4 serial 74 +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -37,17 +37,17 @@ AC_DEFUN([gl_UNISTD_H], # include <fcntl.h> # include <stdio.h> # include <stdlib.h> -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ # include <io.h> # endif #endif ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups - gethostname getlogin getlogin_r getpagesize + gethostname getlogin getlogin_r getpagesize getpass 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]) + readlink readlinkat rmdir sethostname sleep symlink symlinkat + truncate ttyname_r unlink unlinkat usleep]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -83,6 +83,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETPASS=0; AC_SUBST([GNULIB_GETPASS]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) @@ -102,6 +103,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) + GNULIB_TRUNCATE=0; AC_SUBST([GNULIB_TRUNCATE]) 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]) @@ -125,6 +127,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS]) HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) @@ -145,10 +148,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], 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=1; AC_SUBST([HAVE_DECL_GETLOGIN]) 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_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE]) 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]) @@ -156,6 +161,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) + REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) @@ -164,6 +170,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS]) REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) @@ -178,6 +185,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) + REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE]) 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/gdb/gnulib/import/m4/warn-on-use.m4 b/gdb/gnulib/import/m4/warn-on-use.m4 index 08440ec..8e270cf 100644 --- a/gdb/gnulib/import/m4/warn-on-use.m4 +++ b/gdb/gnulib/import/m4/warn-on-use.m4 @@ -1,11 +1,13 @@ -# warn-on-use.m4 serial 5 -dnl Copyright (C) 2010-2016 Free Software Foundation, Inc. +# warn-on-use.m4 serial 6 +dnl Copyright (C) 2010-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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_WARN_ON_USE_PREPARE(INCLUDES, NAMES) # --------------------------------------- +# If the module 'posixcheck' is in use: +# # For each whitespace-separated element in the list of NAMES, define # HAVE_RAW_DECL_name if the function has a declaration among INCLUDES # even after being undefined as a macro. @@ -23,25 +25,27 @@ dnl with or without modifications, as long as this notice is preserved. # needing gl_WARN_ON_USE_PREPARE. AC_DEFUN([gl_WARN_ON_USE_PREPARE], [ - m4_foreach_w([gl_decl], [$2], - [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 + m4_ifdef([gl_POSIXCHECK], + [m4_foreach_w([gl_decl], [$2], + [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], - gl_Symbol, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], + 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], + gl_Symbol, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], [@%:@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]) - 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]) - AS_VAR_POPDEF([gl_Symbol])dnl - done + [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]) + 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]) + AS_VAR_POPDEF([gl_Symbol])dnl + done + ]) ]) diff --git a/gdb/gnulib/import/m4/wchar_h.m4 b/gdb/gnulib/import/m4/wchar_h.m4 index 16017a5..a062ca9 100644 --- a/gdb/gnulib/import/m4/wchar_h.m4 +++ b/gdb/gnulib/import/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-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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 40 +# wchar_h.m4 serial 43 AC_DEFUN([gl_WCHAR_H], [ @@ -35,6 +35,8 @@ AC_DEFUN([gl_WCHAR_H], fi AC_SUBST([HAVE_WINT_T]) + AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) + 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([[ @@ -53,7 +55,7 @@ AC_DEFUN([gl_WCHAR_H], 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 + wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ]) ]) @@ -61,8 +63,8 @@ dnl Check whether <wchar.h> is usable at all. AC_DEFUN([gl_WCHAR_H_INLINE_OK], [ dnl Test whether <wchar.h> suffers due to the transition from '__inline' to - dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022> - dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary, + dnl 'gnu_inline'. See <https://sourceware.org/bugzilla/show_bug.cgi?id=4022> + dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary, dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>. AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly], @@ -88,7 +90,8 @@ int main () { return zero(); } 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 + if echo '#include "conftest.c"' >conftest1.c && + AC_TRY_EVAL([ac_compile]); then AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before @@ -103,7 +106,8 @@ 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 + if echo '#include "conftest.c"' >conftest2.c && + AC_TRY_EVAL([ac_compile]); then if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then : else @@ -112,7 +116,7 @@ int zero (void) { return 0; } fi fi ac_compile="$save_ac_compile" - rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext ]) if test $gl_cv_header_wchar_h_correct_inline = no; then AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). @@ -120,7 +124,7 @@ This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in C99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or - Fix your include files, using parts of - <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or + <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or - Use a gcc version older than 4.3, or - Don't use the flags -std=c99 or -std=gnu99. Configuration aborted.]) @@ -177,6 +181,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) + GNULIB_WCSFTIME=0; AC_SUBST([GNULIB_WCSFTIME]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) @@ -215,6 +220,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) + HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) 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]) @@ -230,4 +236,5 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) + REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME]) ]) diff --git a/gdb/gnulib/import/m4/wchar_t.m4 b/gdb/gnulib/import/m4/wchar_t.m4 index 2db8c3f..83bc3d5 100644 --- a/gdb/gnulib/import/m4/wchar_t.m4 +++ b/gdb/gnulib/import/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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/gdb/gnulib/import/m4/wctype_h.m4 b/gdb/gnulib/import/m4/wctype_h.m4 index accc001..15d1ef3 100644 --- a/gdb/gnulib/import/m4/wctype_h.m4 +++ b/gdb/gnulib/import/m4/wctype_h.m4 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 18 +# wctype_h.m4 serial 21 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. -dnl Copyright (C) 2006-2016 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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,6 +30,8 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WINT_T]) + AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) + gl_CHECK_NEXT_HEADERS([wctype.h]) if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then @@ -51,7 +53,8 @@ AC_DEFUN([gl_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> + [dnl Guess no on Linux libc5, yes otherwise. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [])], diff --git a/gdb/gnulib/import/m4/wint_t.m4 b/gdb/gnulib/import/m4/wint_t.m4 index 8ff2a5b..95f6854 100644 --- a/gdb/gnulib/import/m4/wint_t.m4 +++ b/gdb/gnulib/import/m4/wint_t.m4 @@ -1,11 +1,12 @@ -# wint_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc. +# wint_t.m4 serial 7 +dnl Copyright (C) 2003, 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free 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 <wchar.h> has the 'wint_t' type. +dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's +dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], @@ -28,5 +29,46 @@ AC_DEFUN([gt_TYPE_WINT_T], [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.]) + + dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present, + dnl override 'wint_t'. + AC_CACHE_CHECK([whether wint_t is too small], + [gl_cv_type_wint_t_too_small], + [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>. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + ]])], + [gl_cv_type_wint_t_too_small=no], + [gl_cv_type_wint_t_too_small=yes])]) + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi + AC_SUBST([GNULIB_OVERRIDES_WINT_T]) +]) + +dnl Prerequisites of the 'wint_t' override. +AC_DEFUN([gl_TYPE_WINT_T_PREREQ], +[ + AC_CHECK_HEADERS_ONCE([crtdefs.h]) + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 fi + AC_SUBST([HAVE_CRTDEFS_H]) ]) |