+2008-10-18 Bruno Haible <bruno@clisp.org>
+
+ * modules/dirent: New file.
+ * m4/dirent_h.m4: New file.
+ * m4/fchdir.m4 (gl_FUNC_FCHDIR): Require gl_DIRENT_H_DEFAULTS.
+ Invoke gl_REPLACE_DIRENT_H. Don't assign DIRENT_H directly.
+ * modules/fchdir (Files): Remove lib/dirent.in.h.
+ (Depends-on): Add dirent.
+ (Makefile.am): Move rules to modules/dirent.
+ * doc/posix-headers/dirent.texi: Mention the new module.
+
2008-10-18 Bruno Haible <bruno@clisp.org>
Avoid -Wunused-parameter warnings in public gnulib header files.
POSIX specification: @url{http://www.opengroup.org/susv3xbd/dirent.h.html}
-Gnulib module: ---
+Gnulib module: dirent
Portability problems fixed by Gnulib:
@itemize
-/* Wrapper around <dirent.h>.
+/* A GNU-like <dirent.h>.
Copyright (C) 2006-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
--- /dev/null
+# dirent_h.m4 serial 1
+dnl Copyright (C) 2008 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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 Bruno Haible.
+
+AC_DEFUN([gl_DIRENT_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ gl_CHECK_NEXT_HEADERS([dirent.h])
+])
+
+dnl Unconditionally enables the replacement of <dirent.h>.
+AC_DEFUN([gl_REPLACE_DIRENT_H],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ DIRENT_H='dirent.h'
+])
+
+AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_DIRENT_H_DEFAULTS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ DIRENT_H=''; AC_SUBST([DIRENT_H])
+])
-# fchdir.m4 serial 5
+# fchdir.m4 serial 6
dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_FCHDIR],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([fchdir])
if test $ac_cv_func_fchdir = no; then
REPLACE_FCHDIR=1
[Define if gnulib's fchdir() replacement is used.])
gl_REPLACE_OPEN
gl_REPLACE_CLOSE
- gl_CHECK_NEXT_HEADERS([dirent.h])
- DIRENT_H='dirent.h'
- else
- DIRENT_H=
+ gl_REPLACE_DIRENT_H
fi
- AC_SUBST([DIRENT_H])
])
# Prerequisites of lib/fchdir.c.
--- /dev/null
+Description:
+A GNU-like <dirent.h>.
+
+Files:
+lib/dirent.in.h
+m4/dirent_h.m4
+m4/unistd_h.m4
+
+Depends-on:
+include_next
+
+configure.ac:
+gl_DIRENT_H
+
+Makefile.am:
+BUILT_SOURCES += $(DIRENT_H)
+
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.in.h
+ rm -f $@-t $@
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+ < $(srcdir)/dirent.in.h; \
+ } > $@-t
+ mv $@-t $@
+MOSTLYCLEANFILES += dirent.h dirent.h-t
+
+Include:
+#include <dirent.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
Files:
lib/fchdir.c
-lib/dirent.in.h
m4/fchdir.m4
Depends-on:
canonicalize-lgpl
close
+dirent
dirfd
dup2
fcntl
gl_UNISTD_MODULE_INDICATOR([fchdir])
Makefile.am:
-BUILT_SOURCES += $(DIRENT_H)
-
-# We need the following in order to create <dirent.h> when the system
-# doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h
- rm -f $@-t $@
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
- -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
- < $(srcdir)/dirent.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += dirent.h dirent.h-t
Include:
#include <unistd.h>