[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new module 'dirent'
From: |
Bruno Haible |
Subject: |
new module 'dirent' |
Date: |
Sun, 19 Oct 2008 01:45:25 +0200 |
User-agent: |
KMail/1.5.4 |
As a preparation for next patches, it's useful to separate the 'dirent.h'
header file module from the 'fchdir' function's module. I'm committing this:
2008-10-18 Bruno Haible <address@hidden>
* 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.
========================== modules/dirent =================================
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 address@hidden $@
{ 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; \
} > address@hidden
mv address@hidden $@
MOSTLYCLEANFILES += dirent.h dirent.h-t
Include:
#include <dirent.h>
License:
LGPLv2+
Maintainer:
all
========================== m4/dirent_h.m4 =================================
# 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])
])
===========================================================================
*** doc/posix-headers/dirent.texi.orig 2008-10-19 01:40:39.000000000 +0200
--- doc/posix-headers/dirent.texi 2008-10-19 01:33:52.000000000 +0200
***************
*** 3,9 ****
POSIX specification: @url{http://www.opengroup.org/susv3xbd/dirent.h.html}
! Gnulib module: ---
Portability problems fixed by Gnulib:
@itemize
--- 3,9 ----
POSIX specification: @url{http://www.opengroup.org/susv3xbd/dirent.h.html}
! Gnulib module: dirent
Portability problems fixed by Gnulib:
@itemize
*** lib/dirent.in.h.orig 2008-10-19 01:40:39.000000000 +0200
--- lib/dirent.in.h 2008-10-19 01:18:18.000000000 +0200
***************
*** 1,4 ****
! /* Wrapper around <dirent.h>.
Copyright (C) 2006-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
--- 1,4 ----
! /* 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
*** m4/fchdir.m4.orig 2008-10-19 01:40:39.000000000 +0200
--- m4/fchdir.m4 2008-10-19 01:29:26.000000000 +0200
***************
*** 1,4 ****
! # fchdir.m4 serial 5
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,
--- 1,4 ----
! # 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,12 ****
--- 7,13 ----
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,27 ****
[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=
fi
- AC_SUBST([DIRENT_H])
])
# Prerequisites of lib/fchdir.c.
--- 17,24 ----
[Define if gnulib's fchdir() replacement is used.])
gl_REPLACE_OPEN
gl_REPLACE_CLOSE
! gl_REPLACE_DIRENT_H
fi
])
# Prerequisites of lib/fchdir.c.
*** modules/fchdir.orig 2008-10-19 01:40:39.000000000 +0200
--- modules/fchdir 2008-10-19 01:18:08.000000000 +0200
***************
*** 3,14 ****
Files:
lib/fchdir.c
- lib/dirent.in.h
m4/fchdir.m4
Depends-on:
canonicalize-lgpl
close
dirfd
dup2
fcntl
--- 3,14 ----
Files:
lib/fchdir.c
m4/fchdir.m4
Depends-on:
canonicalize-lgpl
close
+ dirent
dirfd
dup2
fcntl
***************
*** 22,42 ****
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 address@hidden $@
- { 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; \
- } > address@hidden
- mv address@hidden $@
- MOSTLYCLEANFILES += dirent.h dirent.h-t
Include:
#include <unistd.h>
--- 22,27 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- new module 'dirent',
Bruno Haible <=