=== modified file 'ChangeLog'
--- ChangeLog	2010-07-25 19:09:54 +0000
+++ ChangeLog	2010-07-27 01:56:57 +0000
@@ -1,3 +1,7 @@
+2010-07-27  Chad Brown <yandros@mit.edu>
+
+	* configure.in: Check for dirent.h
+
 2010-07-25  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* configure.in: Check for __executable_start.

=== modified file 'configure.in'
--- configure.in	2010-07-25 19:09:54 +0000
+++ configure.in	2010-07-26 02:36:43 +0000
@@ -1204,7 +1204,7 @@
   linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
   stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
   sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
-  sys/utsname.h pwd.h utmp.h)
+  sys/utsname.h pwd.h utmp.h dirent.h)
 
 AC_MSG_CHECKING(if personality LINUX32 can be set)
 AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],

=== modified file 'msdos/ChangeLog'
--- msdos/ChangeLog	2010-07-24 11:53:19 +0000
+++ msdos/ChangeLog	2010-07-27 02:22:21 +0000
@@ -1,3 +1,7 @@
+2010-07-27  Chad Brown  <yandros@mit.edu>
+
+	* sed2v2.inp (HAVE_DIRENT_H): Edit to 1
+
 2010-07-12  Eli Zaretskii  <eliz@gnu.org>
 
 	* sed1v2.inp (C_WARNINGS_SWITCH, PROFILING_CFLAGS, PROFILING_LDFLAGS):

=== modified file 'msdos/sed2v2.inp'
--- msdos/sed2v2.inp	2010-07-11 13:43:10 +0000
+++ msdos/sed2v2.inp	2010-07-27 01:05:52 +0000
@@ -57,6 +57,7 @@
 /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/
 /^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION ""/
 /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/
+/^#undef HAVE_DIRENT_H/s/^.*$/#define HAVE_DIRENT_H 1/
 
 /^#undef GNU_MALLOC *$/s/^.*$/#define GNU_MALLOC 1/
 /^#undef REL_ALLOC *$/s/^.*$/#define REL_ALLOC 1/

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2010-07-26 00:43:58 +0000
+++ src/ChangeLog	2010-07-27 02:19:03 +0000
@@ -1,3 +1,11 @@
+2010-07-27  Chad Brown  <yandros@mit.edu>
+
+	Replace tests for SYSV_SYSTEM_DIR with HAVE_DIRENT_H, set via autoconf
+	* dired.c, sysdep.c: test HAVE_DIRENT_H instead of SYSV_SYSTEM_DIR
+
+	* s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h,
+	  s/msdos.h, s/usg5-4.h: don't define SYSV_SYSTEM_DIR
+
 2010-07-26  Juanma Barranquero  <lekktu@gmail.com>
 
 	* lread.c (unreadpure, mapatoms_1): Make static.

=== modified file 'src/config.in'
--- src/config.in	2010-07-25 19:09:54 +0000
+++ src/config.in	2010-07-26 02:43:53 +0000
@@ -737,6 +737,9 @@
 /* Define to 1 if you have the <utmp.h> header file. */
 #undef HAVE_UTMP_H
 
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
 /* Define to 1 if you have the `vfork' function. */
 #undef HAVE_VFORK
 

=== modified file 'src/dired.c'
--- src/dired.c	2010-07-25 00:20:51 +0000
+++ src/dired.c	2010-07-27 00:55:10 +0000
@@ -48,29 +48,22 @@
    Since applying strlen to the name always works, we'll just do that.  */
 #define NAMLEN(p) strlen (p->d_name)
 
-#ifdef SYSV_SYSTEM_DIR
+#ifdef HAVE_DIRENT_H
 
 #include <dirent.h>
 #define DIRENTRY struct dirent
 
-#else /* not SYSV_SYSTEM_DIR */
+#else /* not HAVE_DIRENT_H */
 
-#ifdef MSDOS
-#include <dirent.h>
-#else
 #include <sys/dir.h>
-#endif
-
 #include <sys/stat.h>
 
-#ifndef MSDOS
 #define DIRENTRY struct direct
 
 extern DIR *opendir (char *);
 extern struct direct *readdir (DIR *);
 
-#endif /* not MSDOS */
-#endif /* not SYSV_SYSTEM_DIR */
+#endif /* HAVE_DIRENT_H */
 
 /* Some versions of Cygwin don't have d_ino in `struct dirent'.  */
 #if defined(MSDOS) || defined(__CYGWIN__)

=== modified file 'src/s/aix4-2.h'
--- src/s/aix4-2.h	2010-06-30 02:48:54 +0000
+++ src/s/aix4-2.h	2010-07-26 08:23:46 +0000
@@ -47,11 +47,6 @@
 /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
 #define HAVE_SOCKETS
 
-
-/* Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir library
-   functions.  Almost, but not quite the same as the 4.2 functions.  */
-#define SYSV_SYSTEM_DIR
-
 /* The file containing the kernel's symbol table is called /unix.  */
 #define KERNEL_FILE "/unix"
 

=== modified file 'src/s/bsd-common.h'
--- src/s/bsd-common.h	2010-06-06 08:57:39 +0000
+++ src/s/bsd-common.h	2010-07-26 08:23:45 +0000
@@ -45,8 +45,6 @@
 #define HAVE_TERMIOS
 #define NO_TERMIO
 
-#define SYSV_SYSTEM_DIR
-
 /* If the system's imake configuration file defines `NeedWidePrototypes'
    as `NO', we must define NARROWPROTO manually.  Such a define is
    generated in the Makefile generated by `xmkmf'.  If we don't

=== modified file 'src/s/cygwin.h'
--- src/s/cygwin.h	2010-06-06 08:57:39 +0000
+++ src/s/cygwin.h	2010-07-26 08:23:44 +0000
@@ -89,7 +89,6 @@
 #define CYGWIN 1
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
-#define SYSV_SYSTEM_DIR 1
 
 #define HAVE_SOCKETS
 

=== modified file 'src/s/gnu-linux.h'
--- src/s/gnu-linux.h	2010-06-06 08:57:39 +0000
+++ src/s/gnu-linux.h	2010-07-26 08:23:43 +0000
@@ -124,8 +124,6 @@
 #define INTERRUPT_INPUT
 #endif /* emacs */
 
-#define SYSV_SYSTEM_DIR       /* use dirent.h */
-
 #define POSIX                 /* affects getpagesize.h and systty.h */
 
 /* This is to work around mysterious gcc failures in some system versions.

=== modified file 'src/s/msdos.h'
--- src/s/msdos.h	2010-07-12 16:56:59 +0000
+++ src/s/msdos.h	2010-07-26 08:23:42 +0000
@@ -38,8 +38,6 @@
    It sets the Lisp variable system-type.  */
 #define SYSTEM_TYPE "ms-dos"
 
-#define SYSV_SYSTEM_DIR
-
 /* subprocesses should be defined if you want to have code for
    asynchronous subprocesses (as used in M-x compile and M-x shell).
    This is the only system that needs this.  */

=== modified file 'src/s/usg5-4.h'
--- src/s/usg5-4.h	2010-07-11 10:31:10 +0000
+++ src/s/usg5-4.h	2010-07-26 08:23:40 +0000
@@ -35,10 +35,6 @@
    for terminal control.  */
 #define HAVE_TERMIO
 
-/* Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir library
-   functions. Almost, but not quite the same as the 4.2 functions.  */
-#define SYSV_SYSTEM_DIR
-
 /* The file containing the kernel's symbol table is called /unix.  */
 #define KERNEL_FILE "/unix"
 

=== modified file 'src/sysdep.c'
--- src/sysdep.c	2010-07-13 10:57:00 +0000
+++ src/sysdep.c	2010-07-26 09:01:39 +0000
@@ -2447,7 +2447,7 @@
 
 /* Directory routines for systems that don't have them. */
 
-#ifdef SYSV_SYSTEM_DIR
+#ifdef HAVE_DIRENT_H
 
 #include <dirent.h>
 
@@ -2464,7 +2464,7 @@
   return rtnval;
 }
 #endif /* not HAVE_CLOSEDIR */
-#endif /* SYSV_SYSTEM_DIR */
+#endif /* HAVE_DIRENT_H */
 
 
 int

