summaryrefslogtreecommitdiff
path: root/configure.in
blob: 1f4ef63b1200ae3539f3dcd84c2599fc27f3af51 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
AC_INIT(strace.c)
AC_CANONICAL_HOST()
AC_MSG_CHECKING(for supported operating system)
changequote(,)dnl

case "$host_os" in
linux*)
	opsys=linux
	;;
sunos4*)
	opsys=sunos4
	;;
solaris2*)
	opsys=svr4
	;;
sysv4*)
	opsys=svr4
	;;
irix5*)
	opsys=svr4
	;;
*)
	AC_MSG_ERROR(this operating system is not yet supported by strace)
	;;
esac
AC_MSG_RESULT($opsys)

# Autoheader trick.  Heh, heh.
opsys_list='
@@@syms="$syms LINUX SUNOS4 SVR4"@@@
'

AC_MSG_CHECKING(for supported architecture)
case "$host_cpu" in
i[3456]86|pentium)
	arch=i386
	;;
m68k)
	arch=m68k
	;;
sparc)
	arch=sparc
	;;
mips)
	arch=mips
	;;
alpha*)
	arch=alpha
	;;
ppc|powerpc)
	arch=powerpc
	;;
arm)
	arch=arm
	;;
*)
	AC_MSG_ERROR(this architecture is not yet supported by strace)
	;;
esac
AC_MSG_RESULT($arch)

# Autoheader trick.  Heh, heh.
arch_list='
@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
'

osarch="$opsys"
if [ -d "$srcdir/$opsys/$arch" ]; then
	osarch="$opsys/$arch"
fi

OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`

changequote([,])dnl
CFLAG="-D_GNU_SOURCE $CFLAGS"
AC_CONFIG_HEADER(config.h)
AC_SUBST(opsys)
AC_DEFINE_UNQUOTED($OPSYS)
AC_SUBST(arch)
AC_DEFINE_UNQUOTED($ARCH)
AC_SUBST(osarch)
AC_PROG_CC
AC_PROG_HOSTCC($host_alias $host)
AC_POLLABLE_PROCFS
AC_STRUCT_PR_SYSCALL
AC_STRUCT_MSG_CONTROL
AC_INCLUDEDIR
if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
then
	AC_MSG_CHECKING(for valid machine include directory)
	if test -d "$includedir/sun4"
	then
		rm -f machine
		ln -s $includedir/sun4 machine
		AC_MSG_RESULT(yes)
		AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
	else
		AC_MSG_RESULT(no)
	fi
fi
AC_WARNFLAGS
if test "x$OPSYS" = "xSUNOS4"
then
	if test -n "$GCC"
	then
		# SunOS 4.x header files don't declare int functions.
		WARNFLAGS="$WARNFLAGS -Wno-implicit"
	fi
fi
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_C_CONST
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_TYPE_SIGNAL
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_HEADER_STAT
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_GETGROUPS
AC_HEADER_MAJOR
AC_SIG_ATOMIC_T
AC_CHECK_LIB(nsl, main)
AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg)
AC_CHECK_HEADERS(sys/filio.h sys/asynch.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h)
AC_DECL_SYS_ERRLIST
AC_DECL_SYS_SIGLIST
AC_DECL__SYS_SIGLIST
AC_OUTPUT(Makefile $osarch/Makefile)