Update from gnulib.
diff --git a/.gitignore b/.gitignore
index 36899db..bfad69e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@
 /libcharset/m4/glibc21.m4
 /libcharset/m4/relocatable-lib.m4
 /libcharset/m4/visibility.m4
+/srclib/_Noreturn.h
 /srclib/Makefile.gnulib
 /srclib/alloca.in.h
 /srclib/allocator.c
@@ -45,6 +46,7 @@
 /srclib/error.c
 /srclib/error.h
 /srclib/fcntl.in.h
+/srclib/filename.h
 /srclib/getprogname.c
 /srclib/getprogname.h
 /srclib/gettext.h
@@ -77,6 +79,10 @@
 /srclib/signal.in.h
 /srclib/sigprocmask.c
 /srclib/stat.c
+/srclib/stat-time.c
+/srclib/stat-time.h
+/srclib/stat-w32.c
+/srclib/stat-w32.h
 /srclib/stdbool.in.h
 /srclib/stddef.in.h
 /srclib/stdint.in.h
@@ -125,12 +131,12 @@
 /srcm4/fcntl_h.m4
 /srcm4/getprogname.m4
 /srcm4/gettext.m4
-/srcm4/gettimeofday.m4
 /srcm4/glibc2.m4
 /srcm4/glibc21.m4
 /srcm4/gnulib-common.m4
 /srcm4/gnulib-comp.m4
 /srcm4/gnulib-tool.m4
+/srcm4/host-cpu-c-abi.m4
 /srcm4/iconv.m4
 /srcm4/include_next.m4
 /srcm4/intdiv0.m4
@@ -175,6 +181,7 @@
 /srcm4/sigpipe.m4
 /srcm4/size_max.m4
 /srcm4/ssize_t.m4
+/srcm4/stat-time.m4
 /srcm4/stat.m4
 /srcm4/stdbool.m4
 /srcm4/stddef_h.m4
@@ -186,7 +193,6 @@
 /srcm4/string_h.m4
 /srcm4/sys_socket_h.m4
 /srcm4/sys_stat_h.m4
-/srcm4/sys_time_h.m4
 /srcm4/sys_types_h.m4
 /srcm4/threadlib.m4
 /srcm4/time_h.m4
diff --git a/ChangeLog b/ChangeLog
index c7e8357..bff964c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2018-05-04  Bruno Haible  <bruno@clisp.org>
 
+	* lib/relocatable.c: Update from gnulib.
+
+2018-05-04  Bruno Haible  <bruno@clisp.org>
+
 	Switch to automake 1.16.
 	* autogen.sh: Update comment.
 	* Makefile.devel (AUTOMAKE, ACLOCAL): Switch to version 1.16.
diff --git a/lib/relocatable.c b/lib/relocatable.c
index 63ef316..6a3268f 100644
--- a/lib/relocatable.c
+++ b/lib/relocatable.c
@@ -1,5 +1,5 @@
 /* Provide relocatable packages.
-   Copyright (C) 2003-2006, 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2006, 2008-2018 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 # include "xalloc.h"
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -77,7 +77,7 @@
    ISSLASH(C)           tests whether C is a directory separator character.
    IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
  */
-#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
   /* Native Windows, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 # define HAS_DEVICE(P) \
@@ -99,7 +99,7 @@
    platforms, see below.  Therefore we enable it by default only on native
    Windows platforms.  */
 #ifndef ENABLE_COSTLY_RELOCATABLE
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
 #  define ENABLE_COSTLY_RELOCATABLE 1
 # else
 #  define ENABLE_COSTLY_RELOCATABLE 0
@@ -256,7 +256,7 @@
             /* Do case-insensitive comparison if the file system is always or
                often case-insensitive.  It's better to accept the comparison
                if the difference is only in case, rather than to fail.  */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
             /* Native Windows, Cygwin, OS/2, DOS - case insignificant file system */
             if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
                 != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
@@ -310,12 +310,12 @@
 /* Full pathname of shared library, or NULL.  */
 static char *shared_library_fullname;
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 /* Native Windows only.
    On Cygwin, it is better to use the Cygwin provided /proc interface, than
    to use native Windows API and cygwin_conv_to_posix_path, because it
    supports longer file names
-   (see <http://cygwin.com/ml/cygwin/2011-01/msg00410.html>).  */
+   (see <https://cygwin.com/ml/cygwin/2011-01/msg00410.html>).  */
 
 /* Determine the full pathname of the shared library when it is loaded.  */
 
@@ -445,8 +445,7 @@
 static char *
 get_shared_library_fullname ()
 {
-#if (!((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) \
-     && !defined __EMX__)
+#if !(defined _WIN32 && !defined __CYGWIN__) && !defined __EMX__
   static bool tried_find_shared_library_fullname;
   if (!tried_find_shared_library_fullname)
     {
diff --git a/libcharset/lib/ChangeLog b/libcharset/lib/ChangeLog
index cc0df68..1a27156 100644
--- a/libcharset/lib/ChangeLog
+++ b/libcharset/lib/ChangeLog
@@ -1,3 +1,17 @@
+2018-05-04  Bruno Haible  <bruno@clisp.org>
+
+	* localcharset.c: Update from gnulib.
+	2018-05-03  Bruno Haible  <bruno@clisp.org>
+		* localcharset.c: Simplify 'defined _WIN32 || defined __WIN32__'
+		to just 'defined _WIN32'.
+	2018-04-21  Benno Schulenberg  <bensberg@telfort.nl>  (tiny change)
+		* localcharset.c (get_charset_aliases): Add a tautological
+		UTF-8 entry to speed up the search for this case.
+	2017-09-14  Bruno Haible  <bruno@clisp.org>
+		all: Replace many more http URLs by https URLs.
+
+	* relocatable.c: Update from gnulib.
+
 2017-05-18  Bruno Haible  <bruno@clisp.org>
 
 	* localcharset.c: Update from gnulib.
diff --git a/libcharset/lib/localcharset.c b/libcharset/lib/localcharset.c
index ae98472..a631aea 100644
--- a/libcharset/lib/localcharset.c
+++ b/libcharset/lib/localcharset.c
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2018 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -32,7 +32,7 @@
 # define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 # define WINDOWS_NATIVE
 # include <locale.h>
 #endif
@@ -88,7 +88,7 @@
 # define O_NOFOLLOW 0
 #endif
 
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
   /* Native Windows, Cygwin, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 #endif
@@ -262,8 +262,10 @@
 # if defined DARWIN7
       /* To avoid the trouble of installing a file that is shared by many
          GNU packages -- many packaging systems have problems with this --,
-         simply inline the aliases here.  */
-      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+         simply inline the aliases here.
+         For speed, map the most frequent case first.  */
+      cp = "UTF-8" "\0" "UTF-8" "\0"
+           "ISO8859-1" "\0" "ISO-8859-1" "\0"
            "ISO8859-2" "\0" "ISO-8859-2" "\0"
            "ISO8859-4" "\0" "ISO-8859-4" "\0"
            "ISO8859-5" "\0" "ISO-8859-5" "\0"
@@ -355,7 +357,7 @@
          by Alex Taylor:
          <http://altsan.org/os2/toolkits/uls/index.html#codepages>.
          See also "IBM Globalization - Code page identifiers":
-         <http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>.  */
+         <https://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>.  */
       cp = "CP813" "\0" "ISO-8859-7" "\0"
            "CP878" "\0" "KOI8-R" "\0"
            "CP819" "\0" "ISO-8859-1" "\0"
diff --git a/libcharset/lib/relocatable.c b/libcharset/lib/relocatable.c
index 63ef316..6a3268f 100644
--- a/libcharset/lib/relocatable.c
+++ b/libcharset/lib/relocatable.c
@@ -1,5 +1,5 @@
 /* Provide relocatable packages.
-   Copyright (C) 2003-2006, 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2006, 2008-2018 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 # include "xalloc.h"
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -77,7 +77,7 @@
    ISSLASH(C)           tests whether C is a directory separator character.
    IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
  */
-#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
   /* Native Windows, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 # define HAS_DEVICE(P) \
@@ -99,7 +99,7 @@
    platforms, see below.  Therefore we enable it by default only on native
    Windows platforms.  */
 #ifndef ENABLE_COSTLY_RELOCATABLE
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
 #  define ENABLE_COSTLY_RELOCATABLE 1
 # else
 #  define ENABLE_COSTLY_RELOCATABLE 0
@@ -256,7 +256,7 @@
             /* Do case-insensitive comparison if the file system is always or
                often case-insensitive.  It's better to accept the comparison
                if the difference is only in case, rather than to fail.  */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
             /* Native Windows, Cygwin, OS/2, DOS - case insignificant file system */
             if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
                 != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
@@ -310,12 +310,12 @@
 /* Full pathname of shared library, or NULL.  */
 static char *shared_library_fullname;
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 /* Native Windows only.
    On Cygwin, it is better to use the Cygwin provided /proc interface, than
    to use native Windows API and cygwin_conv_to_posix_path, because it
    supports longer file names
-   (see <http://cygwin.com/ml/cygwin/2011-01/msg00410.html>).  */
+   (see <https://cygwin.com/ml/cygwin/2011-01/msg00410.html>).  */
 
 /* Determine the full pathname of the shared library when it is loaded.  */
 
@@ -445,8 +445,7 @@
 static char *
 get_shared_library_fullname ()
 {
-#if (!((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) \
-     && !defined __EMX__)
+#if !(defined _WIN32 && !defined __CYGWIN__) && !defined __EMX__
   static bool tried_find_shared_library_fullname;
   if (!tried_find_shared_library_fullname)
     {