blob: ec1be26d27e37f93de7bc86861422d2f2bf70ad2 [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 ;;
Wichert Akkermanc1652e22001-03-27 12:17:16 +000067hppa*|parisc*)
68 arch=hppa
69 ;;
Wichert Akkermanccef6372002-05-01 16:39:22 +000070sh)
71 arch=sh
72 ;;
Michal Ludvig0e035502002-09-23 15:41:01 +000073x86?64*)
74 arch=x86_64
75 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000076*)
77 AC_MSG_ERROR(this architecture is not yet supported by strace)
78 ;;
79esac
80AC_MSG_RESULT($arch)
81
82# Autoheader trick. Heh, heh.
83arch_list='
Michal Ludvig0e035502002-09-23 15:41:01 +000084@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC S390 HPPA SH X86_64"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000085'
86
87osarch="$opsys"
Michal Ludvig53b320f2002-09-23 13:30:09 +000088if test -d "$srcdir/$opsys/$arch"; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000089 osarch="$opsys/$arch"
90fi
91
Michal Ludvig53b320f2002-09-23 13:30:09 +000092OPSYS=`echo $opsys | tr '[[a-z]]' '[[A-Z]]'`
93ARCH=`echo $arch | tr '[[a-z]]' '[[A-Z]]'`
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000094
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000095CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000096AC_CONFIG_HEADER(config.h)
97AC_SUBST(opsys)
98AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000099case "$host_os" in
100sysv4.2uw*)
101 AC_DEFINE(UNIXWARE, 2)
102 ;;
103sysv5*)
104 AC_DEFINE(UNIXWARE, 7)
105 ;;
106esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000107AC_SUBST(arch)
108AC_DEFINE_UNQUOTED($ARCH)
109AC_SUBST(osarch)
110AC_PROG_CC
111AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000112AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000113AC_POLLABLE_PROCFS
114AC_STRUCT_PR_SYSCALL
115AC_STRUCT_MSG_CONTROL
116AC_INCLUDEDIR
117if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
118then
119 AC_MSG_CHECKING(for valid machine include directory)
120 if test -d "$includedir/sun4"
121 then
122 rm -f machine
123 ln -s $includedir/sun4 machine
124 AC_MSG_RESULT(yes)
125 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
126 else
127 AC_MSG_RESULT(no)
128 fi
129fi
130AC_WARNFLAGS
131if test "x$OPSYS" = "xSUNOS4"
132then
133 if test -n "$GCC"
134 then
135 # SunOS 4.x header files don't declare int functions.
136 WARNFLAGS="$WARNFLAGS -Wno-implicit"
137 fi
138fi
139AC_PROG_CPP
140AC_PROG_GCC_TRADITIONAL
141AC_PROG_INSTALL
142AC_C_CONST
143AC_HEADER_STDC
144AC_HEADER_DIRENT
145AC_TYPE_SIGNAL
146AC_STRUCT_ST_BLKSIZE
147AC_STRUCT_ST_BLOCKS
148AC_STRUCT_ST_RDEV
149AC_HEADER_STAT
150AC_TYPE_UID_T
151AC_TYPE_MODE_T
152AC_TYPE_GETGROUPS
153AC_HEADER_MAJOR
154AC_SIG_ATOMIC_T
John Hughes58265892001-10-18 15:13:53 +0000155AC_SIGINFO_T
Ulrich Drepperdfff33c1999-12-24 08:03:15 +0000156AC_STAT64
Wichert Akkermanf1850652001-02-16 20:29:03 +0000157AC_SIN6_SCOPE_ID
Wichert Akkerman16a03d22000-08-10 02:14:04 +0000158AC_LONG_LONG
John Hughesb8a85a42001-03-28 08:05:27 +0000159AC_LITTLE_ENDIAN_LONG_LONG
John Hughes70623be2001-03-08 13:59:00 +0000160AC_OFF_T_IS_LONG_LONG
161AC_RLIM_T_IS_LONG_LONG
John Hughesc0fc3fd2001-03-08 16:10:40 +0000162AC_ST_FLAGS
163AC_ST_ACLCNT
164AC_ST_LEVEL
165AC_ST_FSTYPE
166AC_ST_GEN
John Hughes38ae88d2002-05-23 11:48:58 +0000167AC_STRUCT_OPTHDR
168AC_STRUCT_T_OPTHDR
Wichert Akkerman43a74822000-06-27 17:33:32 +0000169if test x$OPSYS != xLINUX; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000170AC_CHECK_LIB(nsl, main)
Wichert Akkerman43a74822000-06-27 17:33:32 +0000171fi
Wichert Akkermanf1850652001-02-16 20:29:03 +0000172AC_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 +0000173AC_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 +0000174AC_DECL_SYS_ERRLIST
175AC_DECL_SYS_SIGLIST
176AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000177if test ! -d $osarch; then
178 mkdir -p $osarch
179fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000180AC_OUTPUT(Makefile $osarch/Makefile)