blob: 05f270e6987cc117e3615420f286540f5ca39216 [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 ;;
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +000059s390)
60 arch=s390
61 ;;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000062*)
63 AC_MSG_ERROR(this architecture is not yet supported by strace)
64 ;;
65esac
66AC_MSG_RESULT($arch)
67
68# Autoheader trick. Heh, heh.
69arch_list='
Wichert Akkerman2e2553a1999-05-09 00:29:58 +000070@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000071'
72
73osarch="$opsys"
74if [ -d "$srcdir/$opsys/$arch" ]; then
75 osarch="$opsys/$arch"
76fi
77
78OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
79ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
80
81changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000082CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000083AC_CONFIG_HEADER(config.h)
84AC_SUBST(opsys)
85AC_DEFINE_UNQUOTED($OPSYS)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000086case "$host_os" in
87sysv4.2uw*)
88 AC_DEFINE(UNIXWARE, 2)
89 ;;
90sysv5*)
91 AC_DEFINE(UNIXWARE, 7)
92 ;;
93esac
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000094AC_SUBST(arch)
95AC_DEFINE_UNQUOTED($ARCH)
96AC_SUBST(osarch)
97AC_PROG_CC
98AC_PROG_HOSTCC($host_alias $host)
Wichert Akkermanea78f0f1999-11-29 15:34:02 +000099AC_MP_PROCFS
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000100AC_POLLABLE_PROCFS
101AC_STRUCT_PR_SYSCALL
102AC_STRUCT_MSG_CONTROL
103AC_INCLUDEDIR
104if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
105then
106 AC_MSG_CHECKING(for valid machine include directory)
107 if test -d "$includedir/sun4"
108 then
109 rm -f machine
110 ln -s $includedir/sun4 machine
111 AC_MSG_RESULT(yes)
112 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
113 else
114 AC_MSG_RESULT(no)
115 fi
116fi
117AC_WARNFLAGS
118if test "x$OPSYS" = "xSUNOS4"
119then
120 if test -n "$GCC"
121 then
122 # SunOS 4.x header files don't declare int functions.
123 WARNFLAGS="$WARNFLAGS -Wno-implicit"
124 fi
125fi
126AC_PROG_CPP
127AC_PROG_GCC_TRADITIONAL
128AC_PROG_INSTALL
129AC_C_CONST
130AC_HEADER_STDC
131AC_HEADER_DIRENT
132AC_TYPE_SIGNAL
133AC_STRUCT_ST_BLKSIZE
134AC_STRUCT_ST_BLOCKS
135AC_STRUCT_ST_RDEV
136AC_HEADER_STAT
137AC_TYPE_UID_T
138AC_TYPE_MODE_T
139AC_TYPE_GETGROUPS
140AC_HEADER_MAJOR
141AC_SIG_ATOMIC_T
142AC_CHECK_LIB(nsl, main)
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000143AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000144AC_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 +0000145AC_DECL_SYS_ERRLIST
146AC_DECL_SYS_SIGLIST
147AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000148if test ! -d $osarch; then
149 mkdir -p $osarch
150fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000151AC_OUTPUT(Makefile $osarch/Makefile)