summaryrefslogtreecommitdiff
path: root/source4/lib/replace/repdir.m4
blob: d15e4cb7af2bcc477727c1dbe9e5c7909e659730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
AC_CACHE_CHECK([for broken readdir],libreplace_READDIR_NEEDED,[
	AC_TRY_RUN([
#define test_readdir_os2_delete main
#error
#include "$libreplacedir/test/os2_delete.c"],
	[libreplace_READDIR_NEEDED=no],
	[libreplace_READDIR_NEEDED=yes],
	[libreplace_READDIR_NEEDED="assuming not"])
])

#
# try to replace with getdents() if needed
#
if test x"$libreplace_READDIR_NEEDED" = x"yes"; then
AC_CACHE_CHECK([for replacing readdir using getdents()],libreplace_READDIR_GETDENTS,[
	AC_TRY_RUN([
#include "confdefs.h"
#include "$libreplacedir/repdir_getdents.c"
#define test_readdir_os2_delete main
#include "$libreplacedir/test/os2_delete.c"],
	[libreplace_READDIR_GETDENTS=yes],
	[libreplace_READDIR_GETDENTS=no])
])
fi
if test x"$libreplace_READDIR_GETDENTS" = x"yes"; then
	AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
	AC_DEFINE(REPLACE_READDIR_GETDENTS,1,[replace readdir using getdents()])
	LIBREPLACEOBJ="${LIBREPLACEOBJ} repdir_getdents.o"
	libreplace_READDIR_NEEDED=no
fi