blob: 34ef1bc9e4c9412156481e0bf0080e321d1140aa [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001AC_INIT(strace.c)
Wichert Akkerman4f1bbbe2001-07-23 14:43:07 +00002AC_CANONICAL_SYSTEM()
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00003AC_MSG_CHECKING(for supported operating system)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00004
5case "$host_os" in
6linux*)
7 opsys=linux
8 ;;
9sunos4*)
10 opsys=sunos4
11 ;;
12solaris2*)
13 opsys=svr4
14 ;;
15sysv4*)
16 opsys=svr4
17 ;;
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000018sysv5*)
19 opsys=svr4
20 ;;
Michal Ludvig53b320f2002-09-23 13:30:09 +000021irix[[56]]*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000022 opsys=svr4
23 ;;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000024freebsd*)
25 opsys=freebsd
26 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000027*)
28 AC_MSG_ERROR(this operating system is not yet supported by strace)
29 ;;
30esac
31AC_MSG_RESULT($opsys)
32
33# Autoheader trick. Heh, heh.
34opsys_list='
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000035@@@syms="$syms LINUX SUNOS4 SVR4 FREEBSD"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000036'
37
38AC_MSG_CHECKING(for supported architecture)
Wichert Akkerman4f1bbbe2001-07-23 14:43:07 +000039case "$target_cpu" in
Michal Ludvig53b320f2002-09-23 13:30:09 +000040i[[3456]]86|pentium)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000041 arch=i386
42 ;;
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +000043ia64)
44 arch=ia64
45 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000046m68k)
47 arch=m68k
48 ;;
Wichert Akkerman00a82ee2001-03-28 20:29:17 +000049sparc*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000050 arch=sparc
51 ;;
Wichert Akkermanf90da011999-10-31 21:15:38 +000052mips*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000053 arch=mips
54 ;;
55alpha*)
56 arch=alpha
57 ;;
58ppc|powerpc)
59 arch=powerpc
60 ;;
61arm)
62 arch=arm
63 ;;
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +000064s390)
65 arch=s390
66 ;;
Michal Ludvig10a88d02002-10-07 14:31:00 +000067s390x)
68 arch=s390x
69 ;;
Wichert Akkermanc1652e22001-03-27 12:17:16 +000070hppa*|parisc*)
71 arch=hppa
72 ;;
Wichert Akkermanccef6372002-05-01 16:39:22 +000073sh)
74 arch=sh
75 ;;
Michal Ludvig0e035502002-09-23 15:41:01 +000076x86?64*)
77 arch=x86_64
78 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000079*)
80 AC_MSG_ERROR(this architecture is not yet supported by strace)
81 ;;
82esac
83AC_MSG_RESULT($arch)
84
85# Autoheader trick. Heh, heh.
86arch_list='
Michal Ludvig10a88d02002-10-07 14:31:00 +000087@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC S390 S390X HPPA SH X86_64"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000088'
89
90osarch="$opsys"
Michal Ludvig53b320f2002-09-23 13:30:09 +000091if test -d "$srcdir/$opsys/$arch"; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000092 osarch="$opsys/$arch"
93fi
94
Michal Ludvig53b320f2002-09-23 13:30:09 +000095OPSYS=`echo $opsys | tr '[[a-z]]' '[[A-Z]]'`
96ARCH=`echo $arch | tr '[[a-z]]' '[[A-Z]]'`
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000097
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000098CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000099AC_CONFIG_HEADER(config.h)
100AC_SUBST(opsys)
101AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000102case "$host_os" in
103sysv4.2uw*)
104 AC_DEFINE(UNIXWARE, 2)
105 ;;
106sysv5*)
107 AC_DEFINE(UNIXWARE, 7)
108 ;;
109esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000110AC_SUBST(arch)
111AC_DEFINE_UNQUOTED($ARCH)
112AC_SUBST(osarch)
113AC_PROG_CC
114AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000115AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000116AC_POLLABLE_PROCFS
117AC_STRUCT_PR_SYSCALL
118AC_STRUCT_MSG_CONTROL
119AC_INCLUDEDIR
120if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
121then
122 AC_MSG_CHECKING(for valid machine include directory)
123 if test -d "$includedir/sun4"
124 then
125 rm -f machine
126 ln -s $includedir/sun4 machine
127 AC_MSG_RESULT(yes)
128 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
129 else
130 AC_MSG_RESULT(no)
131 fi
132fi
133AC_WARNFLAGS
134if test "x$OPSYS" = "xSUNOS4"
135then
136 if test -n "$GCC"
137 then
138 # SunOS 4.x header files don't declare int functions.
139 WARNFLAGS="$WARNFLAGS -Wno-implicit"
140 fi
141fi
142AC_PROG_CPP
143AC_PROG_GCC_TRADITIONAL
144AC_PROG_INSTALL
145AC_C_CONST
146AC_HEADER_STDC
147AC_HEADER_DIRENT
148AC_TYPE_SIGNAL
149AC_STRUCT_ST_BLKSIZE
150AC_STRUCT_ST_BLOCKS
151AC_STRUCT_ST_RDEV
152AC_HEADER_STAT
153AC_TYPE_UID_T
154AC_TYPE_MODE_T
155AC_TYPE_GETGROUPS
156AC_HEADER_MAJOR
157AC_SIG_ATOMIC_T
John Hughes58265892001-10-18 15:13:53 +0000158AC_SIGINFO_T
Ulrich Drepperdfff33c1999-12-24 08:03:15 +0000159AC_STAT64
Wichert Akkermanf1850652001-02-16 20:29:03 +0000160AC_SIN6_SCOPE_ID
Wichert Akkerman16a03d22000-08-10 02:14:04 +0000161AC_LONG_LONG
John Hughesb8a85a42001-03-28 08:05:27 +0000162AC_LITTLE_ENDIAN_LONG_LONG
John Hughes70623be2001-03-08 13:59:00 +0000163AC_OFF_T_IS_LONG_LONG
164AC_RLIM_T_IS_LONG_LONG
John Hughesc0fc3fd2001-03-08 16:10:40 +0000165AC_ST_FLAGS
166AC_ST_ACLCNT
167AC_ST_LEVEL
168AC_ST_FSTYPE
169AC_ST_GEN
John Hughes38ae88d2002-05-23 11:48:58 +0000170AC_STRUCT_OPTHDR
171AC_STRUCT_T_OPTHDR
Wichert Akkerman43a74822000-06-27 17:33:32 +0000172if test x$OPSYS != xLINUX; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000173AC_CHECK_LIB(nsl, main)
Wichert Akkerman43a74822000-06-27 17:33:32 +0000174fi
Wichert Akkermanf1850652001-02-16 20:29:03 +0000175AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop if_indextoname)
John Hughes4e36a812001-04-18 15:11:51 +0000176AC_CHECK_HEADERS(sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.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 sys/aio.h linux/netlink.h linux/if_packet.h poll.h sys/poll.h sys/vfs.h netinet/tcp.h netinet/udp.h asm/sysmips.h linux/utsname.h sys/nscsys.h)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000177AC_DECL_SYS_ERRLIST
178AC_DECL_SYS_SIGLIST
179AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000180if test ! -d $osarch; then
181 mkdir -p $osarch
182fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000183AC_OUTPUT(Makefile $osarch/Makefile)