summaryrefslogtreecommitdiff
path: root/source4/build/m4/rewrite.m4
blob: 62804a8ca917aaee7e34acb2c7f78f4807d88c1d (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
AC_SYS_LARGEFILE

case "$host_os" in
	*linux*)   AC_DEFINE(LINUX,1,[Whether the host os is linux])
		;;
	*solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
		AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
		;;
	*sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
		AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
		;;
	*netbsd* | *freebsd* | *dragonfly* )  
		AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
		;;
	*openbsd*)
		AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
		;;
	*irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
		case "$host_os" in
		*irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
		;;
		esac
		;;
	*aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
		AC_DEFINE(BROKEN_STRNLEN,1,[Does strnlen work correctly])
		AC_DEFINE(BROKEN_STRNDUP,1,[Does strndup work correctly])
		;;
	*hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
		;;
	*qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
		;;
	*osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
		AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
		;;
	*sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
		;;
	*unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
		;;
	*next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2])
		;;
	*dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
		;;
	*sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
		case "$host" in
			*-univel-*)
				if [ test "$GCC" != yes ]; then
					AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
				fi
				;;
			*mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
		esac
		;;
	*sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
		if [ test "$GCC" != yes ]; then
			AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
		fi
		;;
	*vos*)
		;;
	*darwin*)   AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX])
		;;
esac


AC_CHECK_HEADERS(stdarg.h string.h)

AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_ST_RDEV
AC_CHECK_TYPE(ino_t,unsigned)
AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,loff_t)
AC_CHECK_TYPES(long long)

AC_FUNC_MEMCMP

AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer)

AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
AC_TRY_RUN([#include "${srcdir-.}/build/tests/shared_mmap.c"],
           samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
    AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
fi

AC_CACHE_CHECK([for O_DIRECT flag to open(2)],samba_cv_HAVE_OPEN_O_DIRECT,[
AC_TRY_COMPILE([
#include <unistd.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif],
[int fd = open("/dev/null", O_DIRECT);],
samba_cv_HAVE_OPEN_O_DIRECT=yes,samba_cv_HAVE_OPEN_O_DIRECT=no)])
if test x"$samba_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
    AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT])
fi