Addendum to 2009-10-18 commit.
diff --git a/ChangeLog b/ChangeLog
index 3a791ab..8991d54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-06-04  Bruno Haible  <bruno@clisp.org>
 
+	Addendum to 2009-10-18 commit.
+	* m4/fcntl-o.m4: New file, from gnulib.
+	* configure.ac: Invoke gl_FCNTL_O_FLAGS.
+	* lib/config.h.in (HAVE_WORKING_O_NOFOLLOW): New macro.
+
+2010-06-04  Bruno Haible  <bruno@clisp.org>
+
 	* m4/libtool.m4: Update from libtool-2.2.8, with modifications:
 	2008-04-06  Bruno Haible  <bruno@clisp.org>
 		* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
diff --git a/configure.ac b/configure.ac
index 4ebe025..3585bd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-dnl Copyright (C) 1999-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2010 Free Software Foundation, Inc.
 dnl This file is part of the GNU LIBICONV Library.
 dnl
 dnl The GNU LIBICONV Library is free software; you can redistribute it
@@ -147,6 +147,7 @@
 AC_REPLACE_FUNCS([memmove])
 
 AM_LANGINFO_CODESET
+gl_FCNTL_O_FLAGS
 
 AC_EILSEQ
 
diff --git a/lib/config.h.in b/lib/config.h.in
index ac9dcff..6db23e1 100644
--- a/lib/config.h.in
+++ b/lib/config.h.in
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2003, 2005, 2007, 2010 Free Software Foundation, Inc.
    This file is part of the GNU LIBICONV Library.
 
    The GNU LIBICONV Library is free software; you can redistribute it
@@ -60,6 +60,9 @@
 /* Define if you have the wcrtomb() function. */
 #undef HAVE_WCRTOMB
 
+/* Define to 1 if O_NOFOLLOW works. */
+#undef HAVE_WORKING_O_NOFOLLOW
+
 /* Define if the machine's byte ordering is little endian. */
 #undef WORDS_LITTLEENDIAN
 
diff --git a/libcharset/ChangeLog b/libcharset/ChangeLog
index 3cbeab8..f168fb2 100644
--- a/libcharset/ChangeLog
+++ b/libcharset/ChangeLog
@@ -1,5 +1,11 @@
 2010-06-04  Bruno Haible  <bruno@clisp.org>
 
+	Addendum to 2009-10-18 commit.
+	* m4/fcntl-o.m4: New file, from gnulib.
+	* m4/fcntl_h.m4: Remove file.
+
+2010-06-04  Bruno Haible  <bruno@clisp.org>
+
 	* m4/libtool.m4: Update from libtool-2.2.8, with modifications:
 	2008-04-06  Bruno Haible  <bruno@clisp.org>
 		* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
diff --git a/libcharset/m4/fcntl-o.m4 b/libcharset/m4/fcntl-o.m4
new file mode 100644
index 0000000..d416a61
--- /dev/null
+++ b/libcharset/m4/fcntl-o.m4
@@ -0,0 +1,81 @@
+# fcntl-o.m4 serial 1
+dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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.
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+  dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+  AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>
+           #include <sys/stat.h>
+           #include <unistd.h>
+           #include <fcntl.h>
+           #ifndef O_NOATIME
+            #define O_NOATIME 0
+           #endif
+           #ifndef O_NOFOLLOW
+            #define O_NOFOLLOW 0
+           #endif
+           static int const constants[] =
+            {
+              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+            };
+          ]],
+          [[
+            int status = !constants;
+            {
+              static char const sym[] = "conftest.sym";
+              if (symlink (".", sym) != 0
+                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
+                status |= 32;
+              unlink (sym);
+            }
+            {
+              static char const file[] = "confdefs.h";
+              int fd = open (file, O_RDONLY | O_NOATIME);
+              char c;
+              struct stat st0, st1;
+              if (fd < 0
+                  || fstat (fd, &st0) != 0
+                  || sleep (1) != 0
+                  || read (fd, &c, 1) != 1
+                  || close (fd) != 0
+                  || stat (file, &st1) != 0
+                  || st0.st_atime != st1.st_atime)
+                status |= 64;
+            }
+            return status;]])],
+       [gl_cv_header_working_fcntl_h=yes],
+       [case $? in #(
+        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+         *) gl_cv_header_working_fcntl_h='no';;
+        esac],
+       [gl_cv_header_working_fcntl_h=cross-compiling])])
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+    [Define to 1 if O_NOATIME works.])
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+    [Define to 1 if O_NOFOLLOW works.])
+])
diff --git a/libcharset/m4/fcntl_h.m4 b/libcharset/m4/fcntl_h.m4
deleted file mode 100644
index 223fa48..0000000
--- a/libcharset/m4/fcntl_h.m4
+++ /dev/null
@@ -1,108 +0,0 @@
-# serial 6
-# Configure fcntl.h.
-dnl Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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_FCNTL_H],
-[
-  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  AC_REQUIRE([gl_FCNTL_O_FLAGS])
-  gl_CHECK_NEXT_HEADERS([fcntl.h])
-  FCNTL_H='fcntl.h'
-  AC_SUBST([FCNTL_H])
-])
-
-# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
-# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
-# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
-AC_DEFUN([gl_FCNTL_O_FLAGS],
-[
-  dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
-  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-  AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
-    [AC_RUN_IFELSE(
-       [AC_LANG_PROGRAM(
-	  [[#include <sys/types.h>
-	   #include <sys/stat.h>
-	   #include <unistd.h>
-	   #include <fcntl.h>
-	   #ifndef O_NOATIME
-	    #define O_NOATIME 0
-	   #endif
-	   #ifndef O_NOFOLLOW
-	    #define O_NOFOLLOW 0
-	   #endif
-	   static int const constants[] =
-	    {
-	      O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
-	      O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
-	    };
-	  ]],
-	  [[
-	    int status = !constants;
-	    {
-	      static char const sym[] = "conftest.sym";
-	      if (symlink (".", sym) != 0
-		  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
-		status |= 32;
-	      unlink (sym);
-	    }
-	    {
-	      static char const file[] = "confdefs.h";
-	      int fd = open (file, O_RDONLY | O_NOATIME);
-	      char c;
-	      struct stat st0, st1;
-	      if (fd < 0
-		  || fstat (fd, &st0) != 0
-		  || sleep (1) != 0
-		  || read (fd, &c, 1) != 1
-		  || close (fd) != 0
-		  || stat (file, &st1) != 0
-		  || st0.st_atime != st1.st_atime)
-		status |= 64;
-	    }
-	    return status;]])],
-       [gl_cv_header_working_fcntl_h=yes],
-       [case $? in #(
-	32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
-	64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-	96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
-	 *) gl_cv_header_working_fcntl_h='no';;
-	esac],
-       [gl_cv_header_working_fcntl_h=cross-compiling])])
-
-  case $gl_cv_header_working_fcntl_h in #(
-  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
-  *) ac_val=1;;
-  esac
-  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
-    [Define to 1 if O_NOATIME works.])
-
-  case $gl_cv_header_working_fcntl_h in #(
-  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
-  *) ac_val=1;;
-  esac
-  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
-    [Define to 1 if O_NOFOLLOW works.])
-])
-
-AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
-[
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
-])
-
-AC_DEFUN([gl_FCNTL_H_DEFAULTS],
-[
-  GNULIB_OPEN=0;    AC_SUBST([GNULIB_OPEN])
-  GNULIB_OPENAT=0;  AC_SUBST([GNULIB_OPENAT])
-  dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_OPENAT=1;    AC_SUBST([HAVE_OPENAT])
-  REPLACE_OPEN=0;   AC_SUBST([REPLACE_OPEN])
-  REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
-])
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
new file mode 100644
index 0000000..d416a61
--- /dev/null
+++ b/m4/fcntl-o.m4
@@ -0,0 +1,81 @@
+# fcntl-o.m4 serial 1
+dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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.
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+  dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+  AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>
+           #include <sys/stat.h>
+           #include <unistd.h>
+           #include <fcntl.h>
+           #ifndef O_NOATIME
+            #define O_NOATIME 0
+           #endif
+           #ifndef O_NOFOLLOW
+            #define O_NOFOLLOW 0
+           #endif
+           static int const constants[] =
+            {
+              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+            };
+          ]],
+          [[
+            int status = !constants;
+            {
+              static char const sym[] = "conftest.sym";
+              if (symlink (".", sym) != 0
+                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
+                status |= 32;
+              unlink (sym);
+            }
+            {
+              static char const file[] = "confdefs.h";
+              int fd = open (file, O_RDONLY | O_NOATIME);
+              char c;
+              struct stat st0, st1;
+              if (fd < 0
+                  || fstat (fd, &st0) != 0
+                  || sleep (1) != 0
+                  || read (fd, &c, 1) != 1
+                  || close (fd) != 0
+                  || stat (file, &st1) != 0
+                  || st0.st_atime != st1.st_atime)
+                status |= 64;
+            }
+            return status;]])],
+       [gl_cv_header_working_fcntl_h=yes],
+       [case $? in #(
+        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+         *) gl_cv_header_working_fcntl_h='no';;
+        esac],
+       [gl_cv_header_working_fcntl_h=cross-compiling])])
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+    [Define to 1 if O_NOATIME works.])
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+    [Define to 1 if O_NOFOLLOW works.])
+])