Mercurial > hg > octave-lyh > gnulib-hg
changeset 10659:fb8bcb95d71a
New module 'dirent'.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 19 Oct 2008 01:44:46 +0200 |
parents | a6a1df49f669 |
children | 233e9f6eb098 |
files | ChangeLog doc/posix-headers/dirent.texi lib/dirent.in.h m4/dirent_h.m4 m4/fchdir.m4 modules/dirent modules/fchdir |
diffstat | 7 files changed, 93 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +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.
--- a/doc/posix-headers/dirent.texi +++ b/doc/posix-headers/dirent.texi @@ -3,7 +3,7 @@ POSIX specification: @url{http://www.opengroup.org/susv3xbd/dirent.h.html} -Gnulib module: --- +Gnulib module: dirent Portability problems fixed by Gnulib: @itemize
--- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -1,4 +1,4 @@ -/* 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
new file mode 100644 --- /dev/null +++ b/m4/dirent_h.m4 @@ -0,0 +1,37 @@ +# 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]) +])
--- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,4 +1,4 @@ -# 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, @@ -7,6 +7,7 @@ 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 @@ -16,12 +17,8 @@ [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.
new file mode 100644 --- /dev/null +++ b/modules/dirent @@ -0,0 +1,39 @@ +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
--- a/modules/fchdir +++ b/modules/fchdir @@ -3,12 +3,12 @@ Files: lib/fchdir.c -lib/dirent.in.h m4/fchdir.m4 Depends-on: canonicalize-lgpl close +dirent dirfd dup2 fcntl @@ -22,21 +22,6 @@ 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>