blob: a389676a00f16f95e2d9a036ce199ea459dd40c6 [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 ;;
25*)
26 AC_MSG_ERROR(this operating system is not yet supported by strace)
27 ;;
28esac
29AC_MSG_RESULT($opsys)
30
31# Autoheader trick. Heh, heh.
32opsys_list='
33@@@syms="$syms LINUX SUNOS4 SVR4"@@@
34'
35
36AC_MSG_CHECKING(for supported architecture)
37case "$host_cpu" in
38i[3456]86|pentium)
39 arch=i386
40 ;;
41m68k)
42 arch=m68k
43 ;;
44sparc)
45 arch=sparc
46 ;;
Wichert Akkermanf90da011999-10-31 21:15:38 +000047mips*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000048 arch=mips
49 ;;
50alpha*)
51 arch=alpha
52 ;;
53ppc|powerpc)
54 arch=powerpc
55 ;;
56arm)
57 arch=arm
58 ;;
59*)
60 AC_MSG_ERROR(this architecture is not yet supported by strace)
61 ;;
62esac
63AC_MSG_RESULT($arch)
64
65# Autoheader trick. Heh, heh.
66arch_list='
Wichert Akkerman2e2553a1999-05-09 00:29:58 +000067@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000068'
69
70osarch="$opsys"
71if [ -d "$srcdir/$opsys/$arch" ]; then
72 osarch="$opsys/$arch"
73fi
74
75OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
76ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
77
78changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000079CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000080AC_CONFIG_HEADER(config.h)
81AC_SUBST(opsys)
82AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000083case "$host_os" in
84sysv4.2uw*)
85 AC_DEFINE(UNIXWARE, 2)
86 ;;
87sysv5*)
88 AC_DEFINE(UNIXWARE, 7)
89 ;;
90esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000091AC_SUBST(arch)
92AC_DEFINE_UNQUOTED($ARCH)
93AC_SUBST(osarch)
94AC_PROG_CC
95AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000096AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000097AC_POLLABLE_PROCFS
98AC_STRUCT_PR_SYSCALL
99AC_STRUCT_MSG_CONTROL
100AC_INCLUDEDIR
101if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
102then
103 AC_MSG_CHECKING(for valid machine include directory)
104 if test -d "$includedir/sun4"
105 then
106 rm -f machine
107 ln -s $includedir/sun4 machine
108 AC_MSG_RESULT(yes)
109 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
110 else
111 AC_MSG_RESULT(no)
112 fi
113fi
114AC_WARNFLAGS
115if test "x$OPSYS" = "xSUNOS4"
116then
117 if test -n "$GCC"
118 then
119 # SunOS 4.x header files don't declare int functions.
120 WARNFLAGS="$WARNFLAGS -Wno-implicit"
121 fi
122fi
123AC_PROG_CPP
124AC_PROG_GCC_TRADITIONAL
125AC_PROG_INSTALL
126AC_C_CONST
127AC_HEADER_STDC
128AC_HEADER_DIRENT
129AC_TYPE_SIGNAL
130AC_STRUCT_ST_BLKSIZE
131AC_STRUCT_ST_BLOCKS
132AC_STRUCT_ST_RDEV
133AC_HEADER_STAT
134AC_TYPE_UID_T
135AC_TYPE_MODE_T
136AC_TYPE_GETGROUPS
137AC_HEADER_MAJOR
138AC_SIG_ATOMIC_T
139AC_CHECK_LIB(nsl, main)
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000140AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000141AC_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/in6.h sys/uio.h linux/netlink.h linux/if_packet.h)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000142AC_DECL_SYS_ERRLIST
143AC_DECL_SYS_SIGLIST
144AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000145if test ! -d $osarch; then
146 mkdir -p $osarch
147fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000148AC_OUTPUT(Makefile $osarch/Makefile)