blob: c59e583455895161f17e7cb75fc81479c5e6740c [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 ;;
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000019sysv5*)
20 opsys=svr4
21 ;;
Wichert Akkerman8829a551999-06-11 13:18:40 +000022irix[56]*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000023 opsys=svr4
24 ;;
25*)
26 AC_MSG_ERROR(this operating system is not yet supported by strace)
27 ;;
28esac
29AC_MSG_RESULT($opsys)
30
31# Autoheader trick. Heh, heh.
32opsys_list='
33@@@syms="$syms LINUX SUNOS4 SVR4"@@@
34'
35
36AC_MSG_CHECKING(for supported architecture)
37case "$host_cpu" in
38i[3456]86|pentium)
39 arch=i386
40 ;;
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +000041ia64)
42 arch=ia64
43 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000044m68k)
45 arch=m68k
46 ;;
47sparc)
48 arch=sparc
49 ;;
Wichert Akkermanf90da011999-10-31 21:15:38 +000050mips*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000051 arch=mips
52 ;;
53alpha*)
54 arch=alpha
55 ;;
56ppc|powerpc)
57 arch=powerpc
58 ;;
59arm)
60 arch=arm
61 ;;
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +000062s390)
63 arch=s390
64 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000065*)
66 AC_MSG_ERROR(this architecture is not yet supported by strace)
67 ;;
68esac
69AC_MSG_RESULT($arch)
70
71# Autoheader trick. Heh, heh.
72arch_list='
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +000073@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000074'
75
76osarch="$opsys"
77if [ -d "$srcdir/$opsys/$arch" ]; then
78 osarch="$opsys/$arch"
79fi
80
81OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
82ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
83
84changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000085CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000086AC_CONFIG_HEADER(config.h)
87AC_SUBST(opsys)
88AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000089case "$host_os" in
90sysv4.2uw*)
91 AC_DEFINE(UNIXWARE, 2)
92 ;;
93sysv5*)
94 AC_DEFINE(UNIXWARE, 7)
95 ;;
96esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000097AC_SUBST(arch)
98AC_DEFINE_UNQUOTED($ARCH)
99AC_SUBST(osarch)
100AC_PROG_CC
101AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000102AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000103AC_POLLABLE_PROCFS
104AC_STRUCT_PR_SYSCALL
105AC_STRUCT_MSG_CONTROL
106AC_INCLUDEDIR
107if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
108then
109 AC_MSG_CHECKING(for valid machine include directory)
110 if test -d "$includedir/sun4"
111 then
112 rm -f machine
113 ln -s $includedir/sun4 machine
114 AC_MSG_RESULT(yes)
115 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
116 else
117 AC_MSG_RESULT(no)
118 fi
119fi
120AC_WARNFLAGS
121if test "x$OPSYS" = "xSUNOS4"
122then
123 if test -n "$GCC"
124 then
125 # SunOS 4.x header files don't declare int functions.
126 WARNFLAGS="$WARNFLAGS -Wno-implicit"
127 fi
128fi
129AC_PROG_CPP
130AC_PROG_GCC_TRADITIONAL
131AC_PROG_INSTALL
132AC_C_CONST
133AC_HEADER_STDC
134AC_HEADER_DIRENT
135AC_TYPE_SIGNAL
136AC_STRUCT_ST_BLKSIZE
137AC_STRUCT_ST_BLOCKS
138AC_STRUCT_ST_RDEV
139AC_HEADER_STAT
140AC_TYPE_UID_T
141AC_TYPE_MODE_T
142AC_TYPE_GETGROUPS
143AC_HEADER_MAJOR
144AC_SIG_ATOMIC_T
Ulrich Drepperdfff33c1999-12-24 08:03:15 +0000145AC_STAT64
Wichert Akkerman16a03d22000-08-10 02:14:04 +0000146AC_LONG_LONG
Wichert Akkerman43a74822000-06-27 17:33:32 +0000147if test x$OPSYS != xLINUX; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000148AC_CHECK_LIB(nsl, main)
Wichert Akkerman43a74822000-06-27 17:33:32 +0000149fi
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000150AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
Wichert Akkerman7987cdf2000-07-05 16:05:39 +0000151AC_CHECK_HEADERS(sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h linux/icmp.h linux/in6.h sys/uio.h linux/netlink.h linux/if_packet.h sys/poll.h)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000152AC_DECL_SYS_ERRLIST
153AC_DECL_SYS_SIGLIST
154AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000155if test ! -d $osarch; then
156 mkdir -p $osarch
157fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000158AC_OUTPUT(Makefile $osarch/Makefile)