blob: f4425a85c2668491bfda7736e8973bac8888fcbf [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 ;;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000025freebsd*)
26 opsys=freebsd
27 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000028*)
29 AC_MSG_ERROR(this operating system is not yet supported by strace)
30 ;;
31esac
32AC_MSG_RESULT($opsys)
33
34# Autoheader trick. Heh, heh.
35opsys_list='
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000036@@@syms="$syms LINUX SUNOS4 SVR4 FREEBSD"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000037'
38
39AC_MSG_CHECKING(for supported architecture)
40case "$host_cpu" in
41i[3456]86|pentium)
42 arch=i386
43 ;;
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +000044ia64)
45 arch=ia64
46 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000047m68k)
48 arch=m68k
49 ;;
Wichert Akkerman00a82ee2001-03-28 20:29:17 +000050sparc*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000051 arch=sparc
52 ;;
Wichert Akkermanf90da011999-10-31 21:15:38 +000053mips*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000054 arch=mips
55 ;;
56alpha*)
57 arch=alpha
58 ;;
59ppc|powerpc)
60 arch=powerpc
61 ;;
62arm)
63 arch=arm
64 ;;
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +000065s390)
66 arch=s390
67 ;;
Wichert Akkermanc1652e22001-03-27 12:17:16 +000068hppa*|parisc*)
69 arch=hppa
70 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000071*)
72 AC_MSG_ERROR(this architecture is not yet supported by strace)
73 ;;
74esac
75AC_MSG_RESULT($arch)
76
77# Autoheader trick. Heh, heh.
78arch_list='
Wichert Akkermanc1652e22001-03-27 12:17:16 +000079@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC HPPA"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000080'
81
82osarch="$opsys"
83if [ -d "$srcdir/$opsys/$arch" ]; then
84 osarch="$opsys/$arch"
85fi
86
87OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
88ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
89
90changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000091CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000092AC_CONFIG_HEADER(config.h)
93AC_SUBST(opsys)
94AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000095case "$host_os" in
96sysv4.2uw*)
97 AC_DEFINE(UNIXWARE, 2)
98 ;;
99sysv5*)
100 AC_DEFINE(UNIXWARE, 7)
101 ;;
102esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000103AC_SUBST(arch)
104AC_DEFINE_UNQUOTED($ARCH)
105AC_SUBST(osarch)
106AC_PROG_CC
107AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000108AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000109AC_POLLABLE_PROCFS
110AC_STRUCT_PR_SYSCALL
111AC_STRUCT_MSG_CONTROL
112AC_INCLUDEDIR
113if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
114then
115 AC_MSG_CHECKING(for valid machine include directory)
116 if test -d "$includedir/sun4"
117 then
118 rm -f machine
119 ln -s $includedir/sun4 machine
120 AC_MSG_RESULT(yes)
121 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
122 else
123 AC_MSG_RESULT(no)
124 fi
125fi
126AC_WARNFLAGS
127if test "x$OPSYS" = "xSUNOS4"
128then
129 if test -n "$GCC"
130 then
131 # SunOS 4.x header files don't declare int functions.
132 WARNFLAGS="$WARNFLAGS -Wno-implicit"
133 fi
134fi
135AC_PROG_CPP
136AC_PROG_GCC_TRADITIONAL
137AC_PROG_INSTALL
138AC_C_CONST
139AC_HEADER_STDC
140AC_HEADER_DIRENT
141AC_TYPE_SIGNAL
142AC_STRUCT_ST_BLKSIZE
143AC_STRUCT_ST_BLOCKS
144AC_STRUCT_ST_RDEV
145AC_HEADER_STAT
146AC_TYPE_UID_T
147AC_TYPE_MODE_T
148AC_TYPE_GETGROUPS
149AC_HEADER_MAJOR
150AC_SIG_ATOMIC_T
Ulrich Drepperdfff33c1999-12-24 08:03:15 +0000151AC_STAT64
Wichert Akkermanf1850652001-02-16 20:29:03 +0000152AC_SIN6_SCOPE_ID
Wichert Akkerman16a03d22000-08-10 02:14:04 +0000153AC_LONG_LONG
John Hughesb8a85a42001-03-28 08:05:27 +0000154AC_LITTLE_ENDIAN_LONG_LONG
John Hughes70623be2001-03-08 13:59:00 +0000155AC_OFF_T_IS_LONG_LONG
156AC_RLIM_T_IS_LONG_LONG
John Hughesc0fc3fd2001-03-08 16:10:40 +0000157AC_ST_FLAGS
158AC_ST_ACLCNT
159AC_ST_LEVEL
160AC_ST_FSTYPE
161AC_ST_GEN
Wichert Akkerman43a74822000-06-27 17:33:32 +0000162if test x$OPSYS != xLINUX; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000163AC_CHECK_LIB(nsl, main)
Wichert Akkerman43a74822000-06-27 17:33:32 +0000164fi
Wichert Akkermanf1850652001-02-16 20:29:03 +0000165AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop if_indextoname)
Wichert Akkermand6b92492001-04-07 21:37:12 +0000166AC_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 sys/aio.h linux/netlink.h linux/if_packet.h sys/poll.h sys/vfs.h netinet/tcp.h netinet/udp.h asm/sysmips.h linux/utsname.h)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000167AC_DECL_SYS_ERRLIST
168AC_DECL_SYS_SIGLIST
169AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000170if test ! -d $osarch; then
171 mkdir -p $osarch
172fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000173AC_OUTPUT(Makefile $osarch/Makefile)