blob: 8f60482faa80417c37d3c2defd6d30c11c1b5867 [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 ;;
50sparc)
51 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 Akkerman76baf7c1999-02-19 00:21:36 +000068*)
69 AC_MSG_ERROR(this architecture is not yet supported by strace)
70 ;;
71esac
72AC_MSG_RESULT($arch)
73
74# Autoheader trick. Heh, heh.
75arch_list='
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +000076@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000077'
78
79osarch="$opsys"
80if [ -d "$srcdir/$opsys/$arch" ]; then
81 osarch="$opsys/$arch"
82fi
83
84OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
85ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
86
87changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000088CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000089AC_CONFIG_HEADER(config.h)
90AC_SUBST(opsys)
91AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000092case "$host_os" in
93sysv4.2uw*)
94 AC_DEFINE(UNIXWARE, 2)
95 ;;
96sysv5*)
97 AC_DEFINE(UNIXWARE, 7)
98 ;;
99esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000100AC_SUBST(arch)
101AC_DEFINE_UNQUOTED($ARCH)
102AC_SUBST(osarch)
103AC_PROG_CC
104AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +0000105AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000106AC_POLLABLE_PROCFS
107AC_STRUCT_PR_SYSCALL
108AC_STRUCT_MSG_CONTROL
109AC_INCLUDEDIR
110if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
111then
112 AC_MSG_CHECKING(for valid machine include directory)
113 if test -d "$includedir/sun4"
114 then
115 rm -f machine
116 ln -s $includedir/sun4 machine
117 AC_MSG_RESULT(yes)
118 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
119 else
120 AC_MSG_RESULT(no)
121 fi
122fi
123AC_WARNFLAGS
124if test "x$OPSYS" = "xSUNOS4"
125then
126 if test -n "$GCC"
127 then
128 # SunOS 4.x header files don't declare int functions.
129 WARNFLAGS="$WARNFLAGS -Wno-implicit"
130 fi
131fi
132AC_PROG_CPP
133AC_PROG_GCC_TRADITIONAL
134AC_PROG_INSTALL
135AC_C_CONST
136AC_HEADER_STDC
137AC_HEADER_DIRENT
138AC_TYPE_SIGNAL
139AC_STRUCT_ST_BLKSIZE
140AC_STRUCT_ST_BLOCKS
141AC_STRUCT_ST_RDEV
142AC_HEADER_STAT
143AC_TYPE_UID_T
144AC_TYPE_MODE_T
145AC_TYPE_GETGROUPS
146AC_HEADER_MAJOR
147AC_SIG_ATOMIC_T
Ulrich Drepperdfff33c1999-12-24 08:03:15 +0000148AC_STAT64
Wichert Akkermanf1850652001-02-16 20:29:03 +0000149AC_SIN6_SCOPE_ID
Wichert Akkerman16a03d22000-08-10 02:14:04 +0000150AC_LONG_LONG
Wichert Akkerman43a74822000-06-27 17:33:32 +0000151if test x$OPSYS != xLINUX; then
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000152AC_CHECK_LIB(nsl, main)
Wichert Akkerman43a74822000-06-27 17:33:32 +0000153fi
Wichert Akkermanf1850652001-02-16 20:29:03 +0000154AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop if_indextoname)
Wichert Akkerman8c7122c2001-02-16 19:59:55 +0000155AC_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 sys/vfs.h netinet/tcp.h netinet/udp.h)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000156AC_DECL_SYS_ERRLIST
157AC_DECL_SYS_SIGLIST
158AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000159if test ! -d $osarch; then
160 mkdir -p $osarch
161fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000162AC_OUTPUT(Makefile $osarch/Makefile)