blob: a43b563a6f8b8e6300ac98b05e5972208dfe4e10 [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001AC_INIT(strace.c)
2AC_CANONICAL_HOST()
3AC_MSG_CHECKING(for supported operating system)
4changequote(,)dnl
5
6case "$host_os" in
7linux*)
8 opsys=linux
9 ;;
10sunos4*)
11 opsys=sunos4
12 ;;
13solaris2*)
14 opsys=svr4
15 ;;
16sysv4*)
17 opsys=svr4
18 ;;
19irix5*)
20 opsys=svr4
21 ;;
22*)
23 AC_MSG_ERROR(this operating system is not yet supported by strace)
24 ;;
25esac
26AC_MSG_RESULT($opsys)
27
28# Autoheader trick. Heh, heh.
29opsys_list='
30@@@syms="$syms LINUX SUNOS4 SVR4"@@@
31'
32
33AC_MSG_CHECKING(for supported architecture)
34case "$host_cpu" in
35i[3456]86|pentium)
36 arch=i386
37 ;;
38m68k)
39 arch=m68k
40 ;;
41sparc)
42 arch=sparc
43 ;;
44mips)
45 arch=mips
46 ;;
47alpha*)
48 arch=alpha
49 ;;
50ppc|powerpc)
51 arch=powerpc
52 ;;
53arm)
54 arch=arm
55 ;;
56*)
57 AC_MSG_ERROR(this architecture is not yet supported by strace)
58 ;;
59esac
60AC_MSG_RESULT($arch)
61
62# Autoheader trick. Heh, heh.
63arch_list='
64@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM"@@@
65'
66
67osarch="$opsys"
68if [ -d "$srcdir/$opsys/$arch" ]; then
69 osarch="$opsys/$arch"
70fi
71
72OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
73ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
74
75changequote([,])dnl
76AC_CONFIG_HEADER(config.h)
77AC_SUBST(opsys)
78AC_DEFINE_UNQUOTED($OPSYS)
79AC_SUBST(arch)
80AC_DEFINE_UNQUOTED($ARCH)
81AC_SUBST(osarch)
82AC_PROG_CC
83AC_PROG_HOSTCC($host_alias $host)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000084AC_POLLABLE_PROCFS
85AC_STRUCT_PR_SYSCALL
86AC_STRUCT_MSG_CONTROL
87AC_INCLUDEDIR
88if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
89then
90 AC_MSG_CHECKING(for valid machine include directory)
91 if test -d "$includedir/sun4"
92 then
93 rm -f machine
94 ln -s $includedir/sun4 machine
95 AC_MSG_RESULT(yes)
96 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
97 else
98 AC_MSG_RESULT(no)
99 fi
100fi
101AC_WARNFLAGS
102if test "x$OPSYS" = "xSUNOS4"
103then
104 if test -n "$GCC"
105 then
106 # SunOS 4.x header files don't declare int functions.
107 WARNFLAGS="$WARNFLAGS -Wno-implicit"
108 fi
109fi
110AC_PROG_CPP
111AC_PROG_GCC_TRADITIONAL
112AC_PROG_INSTALL
113AC_C_CONST
114AC_HEADER_STDC
115AC_HEADER_DIRENT
116AC_TYPE_SIGNAL
117AC_STRUCT_ST_BLKSIZE
118AC_STRUCT_ST_BLOCKS
119AC_STRUCT_ST_RDEV
120AC_HEADER_STAT
121AC_TYPE_UID_T
122AC_TYPE_MODE_T
123AC_TYPE_GETGROUPS
124AC_HEADER_MAJOR
125AC_SIG_ATOMIC_T
126AC_CHECK_LIB(nsl, main)
127AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg)
128AC_CHECK_HEADERS(sys/filio.h sys/asynch.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h)
129AC_DECL_SYS_ERRLIST
130AC_DECL_SYS_SIGLIST
131AC_DECL__SYS_SIGLIST
132AC_OUTPUT(Makefile $osarch/Makefile)