fix compile errors on readdir()-deficient platforms
[srvx.git] / configure.in
index 203ecfa2f2370523b7758869cabbdf55a54f46a3..26ef7dd08e71511e2bdd62c4fcdbfdba63800ce2 100644 (file)
@@ -66,7 +66,11 @@ AC_HEADER_TIME
 AC_STRUCT_TM
 
 dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi
-AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h,,)
+AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h dirent.h,,)
+
+dnl Cygwin does not have d_type in struct dirent.  We use stat() as a fallback.
+AC_CHECK_MEMBER([struct dirent.d_type],
+        [AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, [Define if struct dirent exists and includes the d_type element.])],,[#include <dirent.h>])
 
 dnl portability stuff, hurray! -Jedi
 AC_CHECK_FUNCS(gettimeofday)