2002-12-30 03:51:30 +03:00
dnl Process this file with autoconf to create configure. Use autoreconf.
AC_PREREQ(2.57)
2007-08-03 14:28:55 +04:00
AC_INIT([strace],[4.5.16])
2002-12-30 03:51:30 +03:00
AC_CONFIG_SRCDIR([strace.c])
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([foreign check-news dist-bzip2])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_MSG_CHECKING([for supported operating system])
case "$host_os" in
linux*)
opsys=linux
AC_DEFINE([LINUX], 1, [Define for the Linux operating system.])
;;
sunos4*)
opsys=sunos4
AC_DEFINE([SUNOS4], 1, [Define for the SunOS 4.x operating system.])
;;
solaris2* | sysv[[45]]* | irix[[56]]*)
opsys=svr4
AC_DEFINE([SVR4], 1, [Define for the System V release 4 operating
system or a derivative like Solaris 2.x or Irix 5.x.])
case "$host_os" in
sysv4.2uw*)
AC_DEFINE(UNIXWARE, 2, [Define for UnixWare systems.])
;;
sysv5*)
AC_DEFINE(UNIXWARE, 7, [Define for UnixWare systems.])
;;
esac
;;
freebsd*)
opsys=freebsd
AC_DEFINE([FREEBSD], 1, [Define for the FreeBSD operating system.])
;;
*)
AC_MSG_RESULT([NO!])
AC_MSG_ERROR([operating system $host_os is not supported by strace])
;;
esac
AC_MSG_RESULT($opsys)
AC_MSG_CHECKING([for supported architecture])
case "$host_cpu" in
i[[3456]]86|pentium)
arch=i386
AC_DEFINE([I386], 1, [Define for the i386 architecture.])
;;
ia64)
arch=ia64
AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
;;
m68k)
arch=m68k
AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
;;
2004-07-07 David S. Miller <davem@nuts.davemloft.net>
* linux/sparc/syscallent.h: Sync with reality.
* linux/sparc/syscall.h (sys_sendfile64, sys_futex, sys_gettid,
sys_sched_setaffinity, sys_sched_getaffinity, sys_setxattr,
sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr,
sys_fgetxattr, sys_listxattr, sys_llistxattr, sys_flistxattr,
sys_removexattr, sys_lremovexattr, sys_fremovexattr,
sys_remap_file_pages, sys_readahead, sys_tgkill, sys_statfs64,
sys_fstatfs64, sys_clock_settime, sys_clock_gettime,
sys_clock_getres, sys_clock_nanosleep, sys_timer_create,
sys_timer_settime, sys_timer_gettime): New declarations.
* linux/sparc64/dummy2.h, linux/sparc64/syscallent2.h,
linux/sparc64/syscall.h, linux/sparc64/errnoent.h,
linux/sparc64/errnoent1.h, linux/sparc64/errnoent2.h,
linux/sparc64/ioctlent.h, linux/sparc64/ioctlent1.h,
linux/sparc64/ioctlent2.h, linux/sparc64/signalent.h,
linux/sparc64/signalent.h, linux/sparc64/signalent.h,
linux/sparc64/signalent1.h, linux/sparc64/signalent2.h,
linux/sparc64/syscall1.h, linux/sparc64/syscallent.h,
linux/sparc64/syscallent1.h: New files.
* defs.h (LINUXSPARC): Define also when SPARC64.
(LINUX && SPARC64): Set SUPPORTED_PERSONALITIES to 3.
Ignore SIGTRAP after execve by defining TCB_WAITEXECVE.
Define possibly missing __NR_exit_group. Declare getrval2.
* configure.ac (sparc64): New architecture case.
* config.h.in (SPARC64): New define.
* file.c (stat_sparc64): New structure.
(printstat_sparc64): New output routine for that.
(printstat): Call it, if personality is 2.
(printstat64): Likewise.
* util.c: Conditionalize ptrace defines on LINUXSPARC
not LINUX && SPARC.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(_hack_syscall5): Correct trap number when SPARC64.
(PTRACE_WRITE{TEXT,DATA}): Add SPARC64 to ifdef guard.
(getpc): Handle SPARC64 && LINUX.
(printcall): Likewise.
(arg fetching/setting): Use same code for SPARC64 LINUX
as for SPARC.
(setbpt): Handle SPARC64 && LINUX.
(clearbpt): Likewise.
* signal.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(m_siginfo): Use same definition on SPARC64 as SPARC.
(sys_sigreturn): Handle LINUX && SPARC64.
* syscall.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(getscno): Use same static state on SPARC64 as SPARC,
and add SPARC64 handling.
(get_error): Handle LINUX && SPARC64.
(force_result): Likewise.
(syscall_enter): Likewise.
(trace_syscall): Handle sys_socketcall and sys_ipc on SPARC64
just like SPARC.
(getrval2): Handle LINUX && SPARC64.
* process.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(change_syscall): Handle LINUX && SPARC64.
(struct_user_offsets): Ifdef out those which do not exist
on SPARC64.
* net.c (sys_pipe): Handle LINUX && SPARC64.
* ioctl.c: Fix initializer typo for nioctlents2, was
nioctlents1 by accident.
2004-07-12 11:44:08 +04:00
sparc64*)
arch=sparc64
AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
;;
2002-12-30 03:51:30 +03:00
sparc*)
arch=sparc
AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
;;
mips*)
arch=mips
AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
;;
alpha*)
arch=alpha
AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
;;
2003-01-14 12:59:00 +03:00
powerpc*)
2002-12-30 03:51:30 +03:00
arch=powerpc
AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
;;
arm*)
arch=arm
AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
;;
s390)
arch=s390
AC_DEFINE([S390], 1, [Define for the S390 architecture.])
;;
s390x)
arch=s390x
AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
;;
hppa*|parisc*)
arch=hppa
AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
;;
sh)
arch=sh
AC_DEFINE([SH], 1, [Define for the SH architecture.])
;;
2003-06-27 02:40:42 +04:00
sh64)
arch=sh64
AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
2003-06-02 23:18:58 +04:00
;;
2002-12-30 03:51:30 +03:00
x86?64*)
arch=x86_64
AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
;;
*)
AC_MSG_RESULT([NO!])
AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
;;
esac
AC_MSG_RESULT($arch)
AC_SUBST(opsys)
AC_SUBST(arch)
2002-12-30 12:13:08 +03:00
AM_CONDITIONAL([LINUX], [test x$opsys = xlinux])
2004-07-12 09:45:08 +04:00
AM_CONDITIONAL([I386], [test x$arch = xi386])
2002-12-30 12:13:08 +03:00
AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
AM_CONDITIONAL([SUNOS4], [test x$opsys = xsunos4])
AM_CONDITIONAL([SVR4], [test x$opsys = xsvr4])
AM_CONDITIONAL([FREEBSD], [test x$opsys = xfreebsd])
2002-12-30 03:51:30 +03:00
AC_PROG_CC
2005-02-02 07:44:57 +03:00
AC_GNU_SOURCE
2003-01-10 13:44:59 +03:00
2002-12-30 03:51:30 +03:00
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, 1, [
Define if you are have a SPARC with SUNOS4 and your want a version
of strace that will work on sun4, sun4c and sun4m kernel architectures.
Only useful if you have a symbolic link from machine to /usr/include/sun4
in the compilation directory.])
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_HEADER_STAT
AC_CHECK_MEMBERS([struct stat.st_blksize,
2003-02-26 23:34:02 +03:00
struct stat.st_blocks,
2002-12-30 03:51:30 +03:00
struct stat.st_aclcnt,
struct stat.st_flags,
struct stat.st_fstype,
struct stat.st_gen,
struct stat.st_level,
struct stat.st_rdev])
AC_STAT64
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_GETGROUPS
AC_HEADER_MAJOR
2003-01-10 22:57:34 +03:00
AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
2003-02-26 23:34:02 +03:00
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>])
2002-12-30 03:51:30 +03:00
AC_CHECK_TYPES([long long])
AC_LITTLE_ENDIAN_LONG_LONG
AC_OFF_T_IS_LONG_LONG
AC_RLIM_T_IS_LONG_LONG
AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
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 prctl sendmsg inet_ntop if_indextoname)
2006-10-15 00:20:46 +04:00
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 ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h sys/uio.h sys/aio.h poll.h sys/poll.h sys/vfs.h asm/sysmips.h linux/utsname.h sys/nscsys.h mqueue.h sys/epoll.h libaio.h inttypes.h], [], [])
2002-12-30 03:51:30 +03:00
AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
2007-07-06 00:50:34 +04:00
[], [], [#include <stddef.h>
#include <linux/socket.h>])
2002-12-30 13:23:01 +03:00
AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
2003-01-10 22:55:30 +03:00
AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
2002-12-30 03:51:30 +03:00
AC_MP_PROCFS
AC_POLLABLE_PROCFS
AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
AC_STRUCT_PR_SYSCALL
2003-01-10 22:55:30 +03:00
AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
struct T_conn_res.ACCEPTOR_id],,,
[#include <sys/stream.h>
#include <sys/tihdr.h>])
2003-06-28 01:20:09 +04:00
AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
2004-03-02 00:29:22 +03:00
AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
[#include <sys/ptrace.h>])
2004-03-02 01:10:52 +03:00
AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
2005-08-03 16:18:09 +04:00
AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
2007-07-05 23:08:42 +04:00
AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
2007-07-11 11:11:20 +04:00
#ifdef HAVE_ASM_SIGCONTEXT_H
# include <asm/sigcontext.h>
#endif])
2007-07-05 23:08:42 +04:00
2002-12-30 03:51:30 +03:00
AC_CHECK_DECLS([sys_errlist])
AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
AC_PATH_PROG([PERL], [perl])
2002-12-30 04:11:08 +03:00
AC_CONFIG_FILES([Makefile])
2002-12-30 03:51:30 +03:00
AC_OUTPUT