summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-07-06 23:29:27 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-07-06 23:29:27 +0000
commitd76a6493392c315ba9da4a262efaa430b1a72476 (patch)
tree29bc6b934215253eb9be595df972a369d376feae
parent6123d7d37e64bc4e08924a6f2c21fd71dc63ec3e (diff)
downloadgnulib-d76a6493392c315ba9da4a262efaa430b1a72476.tar.gz
* lib/getloadavg.c: Use __VMS, not VMS.
* lib/getopt.c: Likewise. * lib/getpagesize.h: Likewise. * lib/glob.c: Remove most VMS cruft; it hasn't been tested for a while and probably does not work. * lib/backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't worry about this obsolete case any more. (HAVE_DIR): Remove. All uses removed; we now assume you can read directories. * lib/dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't worry about this obsolete case any more. * lib/fts.c: Likewise. * lib/getcwd.c: Likewise. * lib/glob.h: Likewise. * lib/savedir.c: Likewise. * m4/backupfile.m4 (gl_BACKUPFILE): Check for dirent.h, instead of invoking obsolescent AC_HEADER_DIRENT macro. * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise. * m4/d-type.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Likewise. * m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise. * m4/fts.m4 (gl_FUNC_FTS_CORE): Likewise. * m4/getcwd.m4 (gl_PREREQ_GETCWD): Likewise. * m4/glob.m4 (gl_PREREQ_GLOB): Likewise. * m4/savedir.m4 (gl_SAVEDIR): Likewise. * m4/readdir.m4: Remove; no longer needed.
-rw-r--r--lib/ChangeLog22
-rw-r--r--lib/backupfile.c23
-rw-r--r--lib/dirfd.h16
-rw-r--r--lib/fts.c25
-rw-r--r--lib/getcwd.c16
-rw-r--r--lib/getloadavg.c18
-rw-r--r--lib/getopt.c2
-rw-r--r--lib/getpagesize.h4
-rw-r--r--lib/glob.c17
-rw-r--r--lib/savedir.c10
-rw-r--r--m4/ChangeLog14
-rw-r--r--m4/backupfile.m46
-rw-r--r--m4/d-ino.m420
-rw-r--r--m4/d-type.m420
-rw-r--r--m4/dirfd.m418
-rw-r--r--m4/fts.m47
-rw-r--r--m4/getcwd.m42
-rw-r--r--m4/glob.m46
-rw-r--r--m4/readdir.m4140
-rw-r--r--m4/savedir.m44
20 files changed, 97 insertions, 293 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index d74990376b..1f247d4c76 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,27 @@
2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
+ * getloadavg.c: Use __VMS, not VMS.
+ * getopt.c: Likewise.
+ * getpagesize.h: Likewise.
+ * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
+ probably does not work.
+
+2006-07-06 Derek R. Price <derek@ximbiot.com>
+ and Paul Eggert <eggert@cs.ucla.edu>
+
+ * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
+ Don't worry about this obsolete case any more.
+ (HAVE_DIR): Remove. All uses removed; we now assume you can read
+ directories.
+ * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
+ worry about this obsolete case any more.
+ * fts.c: Likewise.
+ * getcwd.c: Likewise.
+ * glob.h: Likewise.
+ * savedir.c: Likewise.
+
+2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
+
* .cppi-disable: Add wcwidth.
* fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
(isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
diff --git a/lib/backupfile.c b/lib/backupfile.c
index 3dfaf45dc9..13c4715833 100644
--- a/lib/backupfile.c
+++ b/lib/backupfile.c
@@ -47,21 +47,7 @@
#else
# define dirent direct
# define NLENGTH(direct) ((size_t) (direct)->d_namlen)
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-
-#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H
-# define HAVE_DIR 1
-#else
-# define HAVE_DIR 0
+# include <ndir.h>
#endif
#if D_INO_IN_DIRENT
@@ -166,8 +152,6 @@ check_extension (char *file, size_t filelen, char e)
}
}
-#if HAVE_DIR
-
/* Returned values for NUMBERED_BACKUP. */
enum numbered_backup_result
@@ -282,7 +266,6 @@ numbered_backup (char **buffer, size_t buffer_size, size_t filelen)
*buffer = buf;
return result;
}
-#endif /* HAVE_DIR */
/* Return the name of the new backup file for the existing file FILE,
allocated with malloc. Report an error and fail if out of memory.
@@ -301,14 +284,13 @@ find_backup_file_name (char const *file, enum backup_type backup_type)
size_t simple_backup_suffix_size = strlen (simple_backup_suffix) + 1;
size_t backup_suffix_size_guess = simple_backup_suffix_size;
enum { GUESS = sizeof ".~12345~" };
- if (HAVE_DIR && backup_suffix_size_guess < GUESS)
+ if (backup_suffix_size_guess < GUESS)
backup_suffix_size_guess = GUESS;
ssize = filelen + backup_suffix_size_guess + 1;
s = xmalloc (ssize);
memcpy (s, file, filelen + 1);
-#if HAVE_DIR
if (backup_type != simple_backups)
switch (numbered_backup (&s, ssize, filelen))
{
@@ -323,7 +305,6 @@ find_backup_file_name (char const *file, enum backup_type backup_type)
simple = (backup_type == numbered_existing_backups);
break;
}
-#endif
if (simple)
memcpy (s + filelen, simple_backup_suffix, simple_backup_suffix_size);
diff --git a/lib/dirfd.h b/lib/dirfd.h
index 1223b51d2f..601332c8bd 100644
--- a/lib/dirfd.h
+++ b/lib/dirfd.h
@@ -1,5 +1,5 @@
/* Declare dirfd, if necessary.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,18 +21,10 @@
#if HAVE_DIRENT_H
# include <dirent.h>
-#else /* not HAVE_DIRENT_H */
+#else
# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* HAVE_SYS_NDIR_H */
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* HAVE_SYS_DIR_H */
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif /* HAVE_NDIR_H */
-#endif /* HAVE_DIRENT_H */
+# include <ndir.h>
+#endif
#ifndef HAVE_DECL_DIRFD
"this configure-time declaration test was not run"
diff --git a/lib/fts.c b/lib/fts.c
index 8666cff871..0938b9c227 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -75,26 +75,17 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
# include "lstat.h"
#endif
-#if defined _LIBC
+#if HAVE_DIRENT_H || _LIBC
# include <dirent.h>
-# define NAMLEN(dirent) _D_EXACT_NAMLEN (dirent)
-#else
-# if HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen ((dirent)->d_name)
+# ifdef _D_EXACT_NAMLEN
+# define NAMLEN(dirent) _D_EXACT_NAMLEN (dirent)
# else
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
+# define NAMLEN(dirent) strlen ((dirent)->d_name)
# endif
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# include <ndir.h>
#endif
#ifdef _LIBC
diff --git a/lib/getcwd.c b/lib/getcwd.c
index ba226799d3..a67dc0c07e 100644
--- a/lib/getcwd.c
+++ b/lib/getcwd.c
@@ -38,23 +38,13 @@
#if HAVE_DIRENT_H || _LIBC
# include <dirent.h>
-# ifndef _D_EXACT_NAMLEN
-# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
-# endif
#else
# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
+# define _D_EXACT_NAMLEN(d) (d)->d_namlen
+# include <ndir.h>
#endif
#ifndef _D_EXACT_NAMLEN
-# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
+# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
#endif
#ifndef _D_ALLOC_NAMLEN
# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 2a5013148e..98e2297dca 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -358,7 +358,7 @@
# ifdef LOAD_AVE_TYPE
-# ifndef VMS
+# ifndef __VMS
# ifndef __linux__
# ifndef NLIST_STRUCT
# include <a.out.h>
@@ -385,7 +385,7 @@
# endif /* LDAV_SYMBOL */
# endif /* __linux__ */
-# else /* VMS */
+# else /* __VMS */
# ifndef eunice
# include <iodef.h>
@@ -393,7 +393,7 @@
# else /* eunice */
# include <vms/iodef.h>
# endif /* eunice */
-# endif /* VMS */
+# endif /* __VMS */
# ifndef LDAV_CVT
# define LDAV_CVT(n) ((double) (n))
@@ -473,9 +473,9 @@ static bool getloadavg_initialized;
/* Offset in kmem to seek to read load average, or 0 means invalid. */
static long offset;
-# if !defined (VMS) && !defined (sgi) && !defined (__linux__)
+# if ! defined __VMS && ! defined sgi && ! defined __linux__
static struct nlist nl[2];
-# endif /* Not VMS or sgi */
+# endif
# ifdef SUNOS_5
static kvm_t *kd;
@@ -813,7 +813,7 @@ getloadavg (double loadavg[], int nelem)
: (load_ave.tl_avenrun.l[elem] / (double) load_ave.tl_lscale));
# endif /* OSF_ALPHA */
-# if !defined (LDAV_DONE) && defined (VMS)
+# if ! defined LDAV_DONE && defined __VMS
/* VMS specific code -- read from the Load Ave driver. */
LOAD_AVE_TYPE load_ave[3];
@@ -851,9 +851,9 @@ getloadavg (double loadavg[], int nelem)
if (!getloadavg_initialized)
return -1;
-# endif /* VMS */
+# endif /* ! defined LDAV_DONE && defined __VMS */
-# if !defined (LDAV_DONE) && defined (LOAD_AVE_TYPE) && !defined (VMS)
+# if ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS
/* UNIX-specific code -- read the average from /dev/kmem. */
@@ -953,7 +953,7 @@ getloadavg (double loadavg[], int nelem)
if (offset == 0 || !getloadavg_initialized)
return -1;
-# endif /* LOAD_AVE_TYPE and not VMS */
+# endif /* ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS */
# if !defined (LDAV_DONE) && defined (LOAD_AVE_TYPE) /* Including VMS. */
if (nelem > 0)
diff --git a/lib/getopt.c b/lib/getopt.c
index 83bd6db430..f37a837bcf 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <unistd.h>
-#ifdef VMS
+#ifdef __VMS
# include <unixlib.h>
#endif
diff --git a/lib/getpagesize.h b/lib/getpagesize.h
index 5cce3c9080..b09b2c24b1 100644
--- a/lib/getpagesize.h
+++ b/lib/getpagesize.h
@@ -21,12 +21,12 @@
#include <unistd.h>
#if !defined getpagesize && defined _SC_PAGESIZE
-# if !(defined VMS && __VMS_VER < 70000000)
+# if ! (defined __VMS && __VMS_VER < 70000000)
# define getpagesize() sysconf (_SC_PAGESIZE)
# endif
#endif
-#if !defined getpagesize && defined VMS
+#if !defined getpagesize && defined __VMS
# ifdef __ALPHA
# define getpagesize() 8192
# else
diff --git a/lib/glob.c b/lib/glob.c
index 28ca8a06b0..c1613f4ca0 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -53,18 +53,7 @@
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-# ifdef HAVE_VMSDIR_H
-# include "vmsdir.h"
-# endif /* HAVE_VMSDIR_H */
+# include <ndir.h>
#endif
@@ -511,7 +500,6 @@ glob (pattern, flags, errfunc, pglob)
oldcount = pglob->gl_pathc + pglob->gl_offs;
-#ifndef VMS
if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/')
@@ -679,7 +667,6 @@ glob (pattern, flags, errfunc, pglob)
}
# endif /* Not Amiga && not WINDOWS32. */
}
-#endif /* Not VMS. */
/* Now test whether we looked for "~" or "~NAME". In this case we
can give the answer now. */
@@ -1132,7 +1119,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
{
int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
| ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
-#if defined _AMIGA || defined VMS
+#if defined _AMIGA || defined __VMS
| FNM_CASEFOLD
#endif
);
diff --git a/lib/savedir.c b/lib/savedir.c
index d5ced6cd3d..c68547054f 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -33,15 +33,7 @@
# include <dirent.h>
#else
# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
+# include <ndir.h>
#endif
#include <stddef.h>
diff --git a/m4/ChangeLog b/m4/ChangeLog
index cb3b724f39..6d43370dd4 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,17 @@
+2006-07-06 Derek R. Price <derek@ximbiot.com>
+ and Paul Eggert <eggert@cs.ucla.edu>
+
+ * backupfile.m4 (gl_BACKUPFILE): Check for dirent.h, instead
+ of invoking obsolescent AC_HEADER_DIRENT macro.
+ * d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
+ * d-type.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Likewise.
+ * dirfd.m4 (gl_FUNC_DIRFD): Likewise.
+ * fts.m4 (gl_FUNC_FTS_CORE): Likewise.
+ * getcwd.m4 (gl_PREREQ_GETCWD): Likewise.
+ * glob.m4 (gl_PREREQ_GLOB): Likewise.
+ * savedir.m4 (gl_SAVEDIR): Likewise.
+ * readdir.m4: Remove; no longer needed.
+
2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* _inttypes_h.m4 (gl_INTTYPES_H): Use AC_CHECK_DECLS_ONCE
diff --git a/m4/backupfile.m4 b/m4/backupfile.m4
index 3c3f41b5e9..04b2556261 100644
--- a/m4/backupfile.m4
+++ b/m4/backupfile.m4
@@ -1,5 +1,5 @@
-# backupfile.m4 serial 9
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# backupfile.m4 serial 10
+dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 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.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_BACKUPFILE],
AC_LIBOBJ([backupfile])
dnl Prerequisites of lib/backupfile.c.
- AC_REQUIRE([AC_HEADER_DIRENT])
+ AC_CHECK_HEADERS_ONCE([dirent.h])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
diff --git a/m4/d-ino.m4 b/m4/d-ino.m4
index 4d2c4dbfe4..c86f7bb42d 100644
--- a/m4/d-ino.m4
+++ b/m4/d-ino.m4
@@ -1,11 +1,11 @@
-#serial 7
+#serial 8
dnl From Jim Meyering.
dnl
dnl Check whether struct dirent has a member named d_ino.
dnl
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004 Free Software
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2006 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -13,7 +13,7 @@ dnl
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
- [AC_REQUIRE([AC_HEADER_DIRENT])dnl
+ [AC_CHECK_HEADERS_ONCE([dirent.h])dnl
AC_CACHE_CHECK([for d_ino member in directory struct],
jm_cv_struct_dirent_d_ino,
[AC_TRY_LINK(dnl
@@ -21,18 +21,10 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
#include <sys/types.h>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
-#else /* not HAVE_DIRENT_H */
+#else
# define dirent direct
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* HAVE_SYS_NDIR_H */
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* HAVE_SYS_DIR_H */
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif /* HAVE_NDIR_H */
-#endif /* HAVE_DIRENT_H */
+# include <ndir.h>
+#endif
],
[struct dirent dp; dp.d_ino = 0;],
diff --git a/m4/d-type.m4 b/m4/d-type.m4
index 6f3125c7e0..f4be1ce62e 100644
--- a/m4/d-type.m4
+++ b/m4/d-type.m4
@@ -1,11 +1,11 @@
-#serial 8
+#serial 9
dnl From Jim Meyering.
dnl
dnl Check whether struct dirent has a member named d_type.
dnl
-# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
@@ -13,7 +13,7 @@ dnl
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
- [AC_REQUIRE([AC_HEADER_DIRENT])dnl
+ [AC_CHECK_HEADERS_ONCE([dirent.h])dnl
AC_CACHE_CHECK([for d_type member in directory struct],
jm_cv_struct_dirent_d_type,
[AC_TRY_LINK(dnl
@@ -21,18 +21,10 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
#include <sys/types.h>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
-#else /* not HAVE_DIRENT_H */
+#else
# define dirent direct
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* HAVE_SYS_NDIR_H */
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* HAVE_SYS_DIR_H */
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif /* HAVE_NDIR_H */
-#endif /* HAVE_DIRENT_H */
+# include <ndir.h>
+#endif
],
[struct dirent dp; dp.d_type = 0;],
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index 7c5cf96084..9e26d52104 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,4 +1,4 @@
-#serial 11 -*- Autoconf -*-
+#serial 12 -*- Autoconf -*-
dnl Find out how to get the file descriptor associated with an open DIR*.
@@ -17,23 +17,15 @@ AC_DEFUN([gl_FUNC_DIRFD],
dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
AC_REQUIRE([AC_PROG_CPP])
AC_REQUIRE([AC_PROG_EGREP])
- AC_REQUIRE([AC_HEADER_DIRENT])
+ AC_CHECK_HEADERS_ONCE([dirent.h])dnl
dirfd_headers='
#if HAVE_DIRENT_H
# include <dirent.h>
-#else /* not HAVE_DIRENT_H */
+#else
# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* HAVE_SYS_NDIR_H */
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* HAVE_SYS_DIR_H */
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif /* HAVE_NDIR_H */
-#endif /* HAVE_DIRENT_H */
+# include <ndir.h>
+#endif
'
AC_CHECK_FUNCS(dirfd)
AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
diff --git a/m4/fts.m4 b/m4/fts.m4
index 61457e3ced..f9f5f6b7b8 100644
--- a/m4/fts.m4
+++ b/m4/fts.m4
@@ -1,5 +1,5 @@
-#serial 6
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+#serial 7
+dnl Copyright (C) 2005, 2006 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.
@@ -29,6 +29,5 @@ AC_DEFUN([gl_FUNC_FTS_CORE],
dnl Prerequisites of lib/fts.c.
# Checks for header files.
- AC_REQUIRE([AC_HEADER_DIRENT])
- AC_CHECK_HEADERS_ONCE([sys/param.h])
+ AC_CHECK_HEADERS_ONCE([dirent.h sys/param.h])dnl
])
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 8f17432b5b..730ed42e2e 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -61,7 +61,7 @@ AC_DEFUN([gl_FUNC_GETCWD],
AC_DEFUN([gl_PREREQ_GETCWD],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([AC_HEADER_DIRENT])
+ AC_CHECK_HEADERS_ONCE([dirent.h])dnl
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
:
])
diff --git a/m4/glob.m4 b/m4/glob.m4
index 690318e228..d57e323eb7 100644
--- a/m4/glob.m4
+++ b/m4/glob.m4
@@ -1,5 +1,5 @@
-# glob.m4 serial 3
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# glob.m4 serial 4
+dnl Copyright (C) 2005, 2006 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.
@@ -74,7 +74,7 @@ if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) return 1;]]),
AC_DEFUN([gl_PREREQ_GLOB],
[ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])dnl
AC_REQUIRE([AC_GNU_SOURCE])dnl
- AC_REQUIRE([AC_HEADER_DIRENT])dnl
+ AC_CHECK_HEADERS_ONCE([dirent.h])dnl
AC_CHECK_HEADERS_ONCE([sys/cdefs.h unistd.h])dnl
AC_CHECK_FUNCS_ONCE([getlogin_r getpwnam_r])dnl
:])
diff --git a/m4/readdir.m4 b/m4/readdir.m4
deleted file mode 100644
index a20117c9ea..0000000000
--- a/m4/readdir.m4
+++ /dev/null
@@ -1,140 +0,0 @@
-#serial 9
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2006 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
-dnl to test whether a NULL return value really means there are no more files
-dnl in the directory.
-dnl
-dnl And the rm from coreutils-5.0 exposes a similar problem when there
-dnl are 338 or more files in a directory on a Darwin-6.5 system
-dnl
-dnl Detect the problem by creating a directory containing 500 files (254 not
-dnl counting . and .. is the minimum for SunOS, 338 for Darwin) and see
-dnl if a loop doing `readdir; unlink' removes all of them.
-dnl
-dnl Define HAVE_WORKING_READDIR if readdir does *not* have this problem.
-
-dnl Written by Jim Meyering.
-
-AC_DEFUN([GL_FUNC_READDIR],
-[dnl
-AC_REQUIRE([AC_HEADER_DIRENT])
-AC_CACHE_CHECK([for working readdir], gl_cv_func_working_readdir,
- [dnl
- # Arrange for deletion of the temporary directory this test creates, in
- # case the test itself fails to delete everything -- as happens on Sunos.
- ac_clean_files="$ac_clean_files conf-dir"
-
- AC_TRY_RUN(
-[# include <stdio.h>
-# include <stdlib.h>
-# include <sys/types.h>
-# include <string.h>
-
-# ifdef HAVE_DIRENT_H
-# include <dirent.h>
-# define NLENGTH(direct) (strlen((direct)->d_name))
-# else /* not HAVE_DIRENT_H */
-# define dirent direct
-# define NLENGTH(direct) ((direct)->d_namlen)
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* HAVE_SYS_NDIR_H */
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* HAVE_SYS_DIR_H */
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif /* HAVE_NDIR_H */
-# endif /* HAVE_DIRENT_H */
-
-# define DOT_OR_DOTDOT(Basename) \
- (Basename[0] == '.' && (Basename[1] == '\0' \
- || (Basename[1] == '.' && Basename[2] == '\0')))
-
-/* Don't try to use replacement mkdir; it wouldn't resolve at link time. */
-# undef mkdir
-
- static void
- create_N_file_dir (const char *dir, size_t n_files)
- {
- unsigned int i;
-
- if (mkdir (dir, 0700))
- abort ();
- if (chdir (dir))
- abort ();
-
- for (i = 0; i < n_files; i++)
- {
- char file_name[4];
- FILE *out;
-
- sprintf (file_name, "%03d", i);
- out = fopen (file_name, "w");
- if (!out)
- abort ();
- if (fclose (out) == EOF)
- abort ();
- }
-
- if (chdir (".."))
- abort ();
- }
-
- static void
- remove_dir (const char *dir)
- {
- DIR *dirp;
-
- if (chdir (dir))
- abort ();
-
- dirp = opendir (".");
- if (dirp == NULL)
- abort ();
-
- while (1)
- {
- struct dirent *dp = readdir (dirp);
- if (dp == NULL)
- break;
-
- if (DOT_OR_DOTDOT (dp->d_name))
- continue;
-
- if (unlink (dp->d_name))
- abort ();
- }
- closedir (dirp);
-
- if (chdir (".."))
- abort ();
-
- if (rmdir (dir))
- exit (1);
- }
-
- int
- main ()
- {
- const char *dir = "conf-dir";
- create_N_file_dir (dir, 500);
- remove_dir (dir);
- exit (0);
- }],
- gl_cv_func_working_readdir=yes,
- gl_cv_func_working_readdir=no,
- gl_cv_func_working_readdir=no)])
-
- if test $gl_cv_func_working_readdir = yes; then
- AC_DEFINE(HAVE_WORKING_READDIR, 1,
- [Define if readdir is found to work properly in some unusual cases. ])
- fi
-])
diff --git a/m4/savedir.m4 b/m4/savedir.m4
index 0c0ee09281..e207123533 100644
--- a/m4/savedir.m4
+++ b/m4/savedir.m4
@@ -1,4 +1,4 @@
-# savedir.m4 serial 5
+# savedir.m4 serial 7
dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,5 +10,5 @@ AC_DEFUN([gl_SAVEDIR],
AC_LIBOBJ([savedir])
dnl Prerequisites of lib/savedir.c.
- AC_REQUIRE([AC_HEADER_DIRENT])
+ AC_CHECK_HEADERS_ONCE([dirent.h])dnl
])