174 lines
3.2 KiB
Plaintext
174 lines
3.2 KiB
Plaintext
AC_INIT(strace.c)
|
|
AC_CANONICAL_SYSTEM()
|
|
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
|
|
;;
|
|
sysv5*)
|
|
opsys=svr4
|
|
;;
|
|
irix[56]*)
|
|
opsys=svr4
|
|
;;
|
|
freebsd*)
|
|
opsys=freebsd
|
|
;;
|
|
*)
|
|
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 FREEBSD"@@@
|
|
'
|
|
|
|
AC_MSG_CHECKING(for supported architecture)
|
|
case "$target_cpu" in
|
|
i[3456]86|pentium)
|
|
arch=i386
|
|
;;
|
|
ia64)
|
|
arch=ia64
|
|
;;
|
|
m68k)
|
|
arch=m68k
|
|
;;
|
|
sparc*)
|
|
arch=sparc
|
|
;;
|
|
mips*)
|
|
arch=mips
|
|
;;
|
|
alpha*)
|
|
arch=alpha
|
|
;;
|
|
ppc|powerpc)
|
|
arch=powerpc
|
|
;;
|
|
arm)
|
|
arch=arm
|
|
;;
|
|
s390)
|
|
arch=s390
|
|
;;
|
|
hppa*|parisc*)
|
|
arch=hppa
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR(this architecture is not yet supported by strace)
|
|
;;
|
|
esac
|
|
AC_MSG_RESULT($arch)
|
|
|
|
# Autoheader trick. Heh, heh.
|
|
arch_list='
|
|
@@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC S390 HPPA"@@@
|
|
'
|
|
|
|
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
|
|
CFLAGS="-D_GNU_SOURCE $CFLAGS"
|
|
AC_CONFIG_HEADER(config.h)
|
|
AC_SUBST(opsys)
|
|
AC_DEFINE_UNQUOTED($OPSYS)
|
|
case "$host_os" in
|
|
sysv4.2uw*)
|
|
AC_DEFINE(UNIXWARE, 2)
|
|
;;
|
|
sysv5*)
|
|
AC_DEFINE(UNIXWARE, 7)
|
|
;;
|
|
esac
|
|
AC_SUBST(arch)
|
|
AC_DEFINE_UNQUOTED($ARCH)
|
|
AC_SUBST(osarch)
|
|
AC_PROG_CC
|
|
AC_PROG_HOSTCC($host_alias $host)
|
|
AC_MP_PROCFS
|
|
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
|
|
AC_STAT64
|
|
AC_SIN6_SCOPE_ID
|
|
AC_LONG_LONG
|
|
AC_LITTLE_ENDIAN_LONG_LONG
|
|
AC_OFF_T_IS_LONG_LONG
|
|
AC_RLIM_T_IS_LONG_LONG
|
|
AC_ST_FLAGS
|
|
AC_ST_ACLCNT
|
|
AC_ST_LEVEL
|
|
AC_ST_FSTYPE
|
|
AC_ST_GEN
|
|
if test x$OPSYS != xLINUX; then
|
|
AC_CHECK_LIB(nsl, main)
|
|
fi
|
|
AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop if_indextoname)
|
|
AC_CHECK_HEADERS(sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.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 sys/aio.h linux/netlink.h linux/if_packet.h poll.h sys/poll.h sys/vfs.h netinet/tcp.h netinet/udp.h asm/sysmips.h linux/utsname.h sys/nscsys.h)
|
|
AC_DECL_SYS_ERRLIST
|
|
AC_DECL_SYS_SIGLIST
|
|
AC_DECL__SYS_SIGLIST
|
|
if test ! -d $osarch; then
|
|
mkdir -p $osarch
|
|
fi
|
|
AC_OUTPUT(Makefile $osarch/Makefile)
|