1999-02-19 03:21:36 +03:00
AC_INIT(strace.c)
AC_CANONICAL_HOST()
AC_MSG_CHECKING(for supported operating system)
changequote(,)dnl
case "$host_os" in
linux*)
opsys=linux
;;
sunos4*)
opsys=sunos4
;;
solaris2*)
opsys=svr4
;;
sysv4*)
opsys=svr4
;;
1999-11-29 18:34:02 +03:00
sysv5*)
opsys=svr4
;;
1999-06-11 17:18:40 +04:00
irix[56]*)
1999-02-19 03:21:36 +03:00
opsys=svr4
;;
*)
AC_MSG_ERROR(this operating system is not yet supported by strace)
;;
esac
AC_MSG_RESULT($opsys)
# Autoheader trick. Heh, heh.
opsys_list='
@@@syms="$syms LINUX SUNOS4 SVR4"@@@
'
AC_MSG_CHECKING(for supported architecture)
case "$host_cpu" in
i[3456]86|pentium)
arch=i386
;;
2000-02-04 00:58:30 +03:00
ia64)
arch=ia64
;;
1999-02-19 03:21:36 +03:00
m68k)
arch=m68k
;;
sparc)
arch=sparc
;;
1999-11-01 00:15:38 +03:00
mips*)
1999-02-19 03:21:36 +03:00
arch=mips
;;
alpha*)
arch=alpha
;;
ppc|powerpc)
arch=powerpc
;;
arm)
arch=arm
;;
1999-12-23 17:20:14 +03:00
s390)
arch=s390
;;
1999-02-19 03:21:36 +03:00
*)
AC_MSG_ERROR(this architecture is not yet supported by strace)
;;
esac
AC_MSG_RESULT($arch)
# Autoheader trick. Heh, heh.
arch_list='
2000-02-04 00:58:30 +03:00
@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
1999-02-19 03:21:36 +03:00
'
osarch="$opsys"
if [ -d "$srcdir/$opsys/$arch" ]; then
osarch="$opsys/$arch"
fi
OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
changequote([,])dnl
1999-05-29 08:11:48 +04:00
CFLAGS="-D_GNU_SOURCE $CFLAGS"
1999-02-19 03:21:36 +03:00
AC_CONFIG_HEADER(config.h)
AC_SUBST(opsys)
AC_DEFINE_UNQUOTED($OPSYS)
1999-11-29 18:34:02 +03:00
case "$host_os" in
sysv4.2uw*)
AC_DEFINE(UNIXWARE, 2)
;;
sysv5*)
AC_DEFINE(UNIXWARE, 7)
;;
esac
1999-02-19 03:21:36 +03:00
AC_SUBST(arch)
AC_DEFINE_UNQUOTED($ARCH)
AC_SUBST(osarch)
AC_PROG_CC
AC_PROG_HOSTCC($host_alias $host)
1999-11-29 18:34:02 +03:00
AC_MP_PROCFS
1999-02-19 03:21:36 +03:00
AC_POLLABLE_PROCFS
AC_STRUCT_PR_SYSCALL
AC_STRUCT_MSG_CONTROL
AC_INCLUDEDIR
if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
then
AC_MSG_CHECKING(for valid machine include directory)
if test -d "$includedir/sun4"
then
rm -f machine
ln -s $includedir/sun4 machine
AC_MSG_RESULT(yes)
AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
else
AC_MSG_RESULT(no)
fi
fi
AC_WARNFLAGS
if test "x$OPSYS" = "xSUNOS4"
then
if test -n "$GCC"
then
# SunOS 4.x header files don't declare int functions.
WARNFLAGS="$WARNFLAGS -Wno-implicit"
fi
fi
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_C_CONST
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_TYPE_SIGNAL
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_HEADER_STAT
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_GETGROUPS
AC_HEADER_MAJOR
AC_SIG_ATOMIC_T
1999-12-24 11:03:15 +03:00
AC_STAT64
2000-08-10 06:14:04 +04:00
AC_LONG_LONG
2000-06-27 21:33:32 +04:00
if test x$OPSYS != xLINUX; then
1999-02-19 03:21:36 +03:00
AC_CHECK_LIB(nsl, main)
2000-06-27 21:33:32 +04:00
fi
1999-08-30 03:15:07 +04:00
AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
2000-07-05 20:05:39 +04:00
AC_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)
1999-02-19 03:21:36 +03:00
AC_DECL_SYS_ERRLIST
AC_DECL_SYS_SIGLIST
AC_DECL__SYS_SIGLIST
1999-08-30 03:15:07 +04:00
if test ! -d $osarch; then
mkdir -p $osarch
fi
1999-02-19 03:21:36 +03:00
AC_OUTPUT(Makefile $osarch/Makefile)