blob: 948666874eac6da9815fd633aafcf8be9004bdcc [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 Akkerman8829a551999-06-11 13:18:40 +000019irix[56]*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000020 opsys=svr4
21 ;;
22*)
23 AC_MSG_ERROR(this operating system is not yet supported by strace)
24 ;;
25esac
26AC_MSG_RESULT($opsys)
27
28# Autoheader trick. Heh, heh.
29opsys_list='
30@@@syms="$syms LINUX SUNOS4 SVR4"@@@
31'
32
33AC_MSG_CHECKING(for supported architecture)
34case "$host_cpu" in
35i[3456]86|pentium)
36 arch=i386
37 ;;
38m68k)
39 arch=m68k
40 ;;
41sparc)
42 arch=sparc
43 ;;
Wichert Akkermanf90da011999-10-31 21:15:38 +000044mips*)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000045 arch=mips
46 ;;
47alpha*)
48 arch=alpha
49 ;;
50ppc|powerpc)
51 arch=powerpc
52 ;;
53arm)
54 arch=arm
55 ;;
56*)
57 AC_MSG_ERROR(this architecture is not yet supported by strace)
58 ;;
59esac
60AC_MSG_RESULT($arch)
61
62# Autoheader trick. Heh, heh.
63arch_list='
Wichert Akkerman2e2553a1999-05-09 00:29:58 +000064@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000065'
66
67osarch="$opsys"
68if [ -d "$srcdir/$opsys/$arch" ]; then
69 osarch="$opsys/$arch"
70fi
71
72OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
73ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
74
75changequote([,])dnl
Ulrich Drepper0d2d3231999-05-29 04:11:48 +000076CFLAGS="-D_GNU_SOURCE $CFLAGS"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000077AC_CONFIG_HEADER(config.h)
78AC_SUBST(opsys)
79AC_DEFINE_UNQUOTED($OPSYS)
80AC_SUBST(arch)
81AC_DEFINE_UNQUOTED($ARCH)
82AC_SUBST(osarch)
83AC_PROG_CC
84AC_PROG_HOSTCC($host_alias $host)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000085AC_POLLABLE_PROCFS
86AC_STRUCT_PR_SYSCALL
87AC_STRUCT_MSG_CONTROL
88AC_INCLUDEDIR
89if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
90then
91 AC_MSG_CHECKING(for valid machine include directory)
92 if test -d "$includedir/sun4"
93 then
94 rm -f machine
95 ln -s $includedir/sun4 machine
96 AC_MSG_RESULT(yes)
97 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
98 else
99 AC_MSG_RESULT(no)
100 fi
101fi
102AC_WARNFLAGS
103if test "x$OPSYS" = "xSUNOS4"
104then
105 if test -n "$GCC"
106 then
107 # SunOS 4.x header files don't declare int functions.
108 WARNFLAGS="$WARNFLAGS -Wno-implicit"
109 fi
110fi
111AC_PROG_CPP
112AC_PROG_GCC_TRADITIONAL
113AC_PROG_INSTALL
114AC_C_CONST
115AC_HEADER_STDC
116AC_HEADER_DIRENT
117AC_TYPE_SIGNAL
118AC_STRUCT_ST_BLKSIZE
119AC_STRUCT_ST_BLOCKS
120AC_STRUCT_ST_RDEV
121AC_HEADER_STAT
122AC_TYPE_UID_T
123AC_TYPE_MODE_T
124AC_TYPE_GETGROUPS
125AC_HEADER_MAJOR
126AC_SIG_ATOMIC_T
127AC_CHECK_LIB(nsl, main)
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000128AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
Wichert Akkerman15dea971999-10-06 13:06:34 +0000129AC_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)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000130AC_DECL_SYS_ERRLIST
131AC_DECL_SYS_SIGLIST
132AC_DECL__SYS_SIGLIST
Wichert Akkerman9ce1a631999-08-29 23:15:07 +0000133if test ! -d $osarch; then
134 mkdir -p $osarch
135fi
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000136AC_OUTPUT(Makefile $osarch/Makefile)