summaryrefslogtreecommitdiff
path: root/source4/lib/replace/repdir.m4
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/replace/repdir.m4')
-rw-r--r--source4/lib/replace/repdir.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/replace/repdir.m4 b/source4/lib/replace/repdir.m4
index d15e4cb7af..a2f7bfa009 100644
--- a/source4/lib/replace/repdir.m4
+++ b/source4/lib/replace/repdir.m4
@@ -28,3 +28,28 @@ if test x"$libreplace_READDIR_GETDENTS" = x"yes"; then
LIBREPLACEOBJ="${LIBREPLACEOBJ} repdir_getdents.o"
libreplace_READDIR_NEEDED=no
fi
+
+#
+# try to replace with getdirentries() if needed
+#
+if test x"$libreplace_READDIR_NEEDED" = x"yes"; then
+AC_CACHE_CHECK([for replacing readdir using getdirentries()],libreplace_READDIR_GETDIRENTRIES,[
+ AC_TRY_RUN([
+#include "confdefs.h"
+#include "$libreplacedir/repdir_getdirentries.c"
+#define test_readdir_os2_delete main
+#include "$libreplacedir/test/os2_delete.c"],
+ [libreplace_READDIR_GETDIRENTRIES=yes],
+ [libreplace_READDIR_GETDIRENTRIES=no])
+])
+fi
+if test x"$libreplace_READDIR_GETDIRENTRIES" = x"yes"; then
+ AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
+ AC_DEFINE(REPLACE_READDIR_GETDIRENTRIES,1,[replace readdir using getdirentries()])
+ LIBREPLACEOBJ="${LIBREPLACEOBJ} repdir_getdirentries.o"
+ libreplace_READDIR_NEEDED=no
+fi
+
+if test x"$libreplace_READDIR_NEEDED" = x"yes"; then
+ AC_MSG_WARN([the provides readdir() is broken])
+fi