blob: 221b42a39ccb0cdc574286b85539a39aa6defb72 [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)
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)
Wichert Akkerman4f1bbbe2001-07-23 14:43:07 +000040case "$target_cpu" in
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000041i[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 Akkermanccef6372002-05-01 16:39:22 +000071sh)
72 arch=sh
73 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000074*)
75 AC_MSG_ERROR(this architecture is not yet supported by strace)
76 ;;
77esac
78AC_MSG_RESULT($arch)
79
80# Autoheader trick. Heh, heh.
81arch_list='
Wichert Akkermanccef6372002-05-01 16:39:22 +000082@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC S390 HPPA SH"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000083'
84
85osarch="$opsys"
86if [ -d "$srcdir/$opsys/$arch" ]; then
87 osarch="$opsys/$arch"
88fi
89
90OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
91ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
92
93changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000094CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000095AC_CONFIG_HEADER(config.h)
96AC_SUBST(opsys)
97AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000098case "$host_os" in
99sysv4.2uw*)
100 AC_DEFINE(UNIXWARE, 2)
101 ;;
102sysv5*)
103 AC_DEFINE(UNIXWARE, 7)
104 ;;
105esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000106AC_SUBST(arch)
107AC_DEFINE_UNQUOTED($ARCH)
108AC_SUBST(osarch)
109AC_PROG_CC
110AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000111AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000112AC_POLLABLE_PROCFS
113AC_STRUCT_PR_SYSCALL
114AC_STRUCT_MSG_CONTROL
115AC_INCLUDEDIR
116if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
117then
118 AC_MSG_CHECKING(for valid machine include directory)
119 if test -d "$includedir/sun4"
120 then
121 rm -f machine
122 ln -s $includedir/sun4 machine
123 AC_MSG_RESULT(yes)
124 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
125 else
126 AC_MSG_RESULT(no)
127 fi
128fi
129AC_WARNFLAGS
130if test "x$OPSYS" = "xSUNOS4"
131then
132 if test -n "$GCC"
133 then
134 # SunOS 4.x header files don't declare int functions.
135 WARNFLAGS="$WARNFLAGS -Wno-implicit"
136 fi
137fi
138AC_PROG_CPP
139AC_PROG_GCC_TRADITIONAL
140AC_PROG_INSTALL
141AC_C_CONST
142AC_HEADER_STDC
143AC_HEADER_DIRENT
144AC_TYPE_SIGNAL
145AC_STRUCT_ST_BLKSIZE
146AC_STRUCT_ST_BLOCKS
147AC_STRUCT_ST_RDEV
148AC_HEADER_STAT
149AC_TYPE_UID_T
150AC_TYPE_MODE_T
151AC_TYPE_GETGROUPS
152AC_HEADER_MAJOR
153AC_SIG_ATOMIC_T
John Hughes58265892001-10-18 15:13:53 +0000154AC_SIGINFO_T
Ulrich Drepperdfff33c1999-12-24 08:03:15 +0000155AC_STAT64
Wichert Akkermanf1850652001-02-16 20:29:03 +0000156AC_SIN6_SCOPE_ID
Wichert Akkerman16a03d22000-08-10 02:14:04 +0000157AC_LONG_LONG
John Hughesb8a85a42001-03-28 08:05:27 +0000158AC_LITTLE_ENDIAN_LONG_LONG
John Hughes70623be2001-03-08 13:59:00 +0000159AC_OFF_T_IS_LONG_LONG
160AC_RLIM_T_IS_LONG_LONG
John Hughesc0fc3fd2001-03-08 16:10:40 +0000161AC_ST_FLAGS
162AC_ST_ACLCNT
163AC_ST_LEVEL
164AC_ST_FSTYPE
165AC_ST_GEN
John Hughes38ae88d2002-05-23 11:48:58 +0000166AC_STRUCT_OPTHDR
167AC_STRUCT_T_OPTHDR
Wichert Akkerman43a74822000-06-27 17:33:32 +0000168if test x$OPSYS != xLINUX; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000169AC_CHECK_LIB(nsl, main)
Wichert Akkerman43a74822000-06-27 17:33:32 +0000170fi
Wichert Akkermanf1850652001-02-16 20:29:03 +0000171AC_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 +0000172AC_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 +0000173AC_DECL_SYS_ERRLIST
174AC_DECL_SYS_SIGLIST
175AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000176if test ! -d $osarch; then
177 mkdir -p $osarch
178fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000179AC_OUTPUT(Makefile $osarch/Makefile)