blob: af0835f8928b7c18836a7f0a09f51a4da56d9ca4 [file] [log] [blame]
Roland McGrath6d2b3492002-12-30 00:51:30 +00001dnl Process this file with autoconf to create configure. Use autoreconf.
2AC_PREREQ(2.57)
Dmitry V. Levin50e69cb2011-02-21 22:58:59 +00003AC_INIT([strace],[4.6])
Roland McGrath6d2b3492002-12-30 00:51:30 +00004AC_CONFIG_SRCDIR([strace.c])
Roland McGrathffda2d32009-10-11 16:25:29 -07005AC_CONFIG_AUX_DIR([.])
Roland McGrath6d2b3492002-12-30 00:51:30 +00006AM_CONFIG_HEADER([config.h])
Dmitry V. Levin525a39a2011-02-27 14:05:58 +00007AM_INIT_AUTOMAKE([foreign check-news dist-xz no-dist-gzip silent-rules])
Roland McGrath6d2b3492002-12-30 00:51:30 +00008AM_MAINTAINER_MODE
9AC_CANONICAL_HOST
10
Roland McGrath6d2b3492002-12-30 00:51:30 +000011AC_MSG_CHECKING([for supported architecture])
12case "$host_cpu" in
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +000013bfin)
14 arch=bfin
15 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
16 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000017i[[3456]]86|pentium)
18 arch=i386
19 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
20 ;;
21ia64)
22 arch=ia64
23 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
24 ;;
25m68k)
26 arch=m68k
27 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
28 ;;
Roland McGrath6d1a65c2004-07-12 07:44:08 +000029sparc64*)
30 arch=sparc64
31 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
32 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000033sparc*)
34 arch=sparc
35 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
36 ;;
37mips*)
38 arch=mips
39 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
40 ;;
41alpha*)
42 arch=alpha
43 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
44 ;;
Roland McGratheb285352003-01-14 09:59:00 +000045powerpc*)
Roland McGrath6d2b3492002-12-30 00:51:30 +000046 arch=powerpc
47 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Andreas Schwabd69fa492010-07-12 21:39:57 +020048 if test $host_cpu = powerpc64; then
49 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
50 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000051 ;;
52arm*)
53 arch=arm
54 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
55 ;;
Denys Vlasenko5ae2b7c2009-02-27 20:32:52 +000056avr32*)
57 arch=avr32
58 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
59 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000060s390)
61 arch=s390
62 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
63 ;;
64s390x)
65 arch=s390x
66 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
67 ;;
68hppa*|parisc*)
69 arch=hppa
70 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
71 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000072sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +000073 arch=sh64
74 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +000075 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000076sh*)
77 arch=sh
78 AC_DEFINE([SH], 1, [Define for the SH architecture.])
79 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000080x86?64*)
81 arch=x86_64
82 AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
83 ;;
Denys Vlasenkoea0e6e82009-02-25 17:08:40 +000084cris|crisv10)
85 arch=crisv10
86 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
87 ;;
88crisv32)
89 arch=crisv32
90 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
91 ;;
Chris Metcalfc8c66982009-12-28 10:00:15 -050092tile*)
93 arch=tile
94 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
95 ;;
Edgar E. Iglesias939caba2010-07-06 14:21:07 +020096microblaze*)
97 arch=microblaze
98 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
99 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000100*)
101 AC_MSG_RESULT([NO!])
102 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
103 ;;
104esac
105AC_MSG_RESULT($arch)
106
Roland McGrath6d2b3492002-12-30 00:51:30 +0000107AC_SUBST(arch)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000108
Roland McGrathbc44e402004-07-12 05:45:08 +0000109AM_CONDITIONAL([I386], [test x$arch = xi386])
Roland McGrath2746edd2002-12-30 09:13:08 +0000110AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
Roland McGrath2746edd2002-12-30 09:13:08 +0000111
Roland McGrath6d2b3492002-12-30 00:51:30 +0000112AC_PROG_CC
Roland McGrath795edb12005-02-02 04:44:57 +0000113AC_GNU_SOURCE
Roland McGrath45aeb6e2003-01-10 10:44:59 +0000114
Roland McGrath6d2b3492002-12-30 00:51:30 +0000115AC_INCLUDEDIR
116
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000117gl_WARN_ADD([-Wall])
Dmitry V. Levin1ed5d802010-09-09 17:42:28 +0000118gl_WARN_ADD([-Wwrite-strings])
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000119AC_SUBST([WARN_CFLAGS])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000120
121AC_PROG_CPP
Roland McGrath6d2b3492002-12-30 00:51:30 +0000122AC_PROG_INSTALL
123AC_C_CONST
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400124AC_C_BIGENDIAN
Roland McGrath6d2b3492002-12-30 00:51:30 +0000125AC_HEADER_STDC
Roland McGrath639658b2008-08-01 01:06:31 +0000126AC_HEADER_STDBOOL
Roland McGrath6d2b3492002-12-30 00:51:30 +0000127AC_HEADER_DIRENT
128AC_HEADER_STAT
129AC_CHECK_MEMBERS([struct stat.st_blksize,
Roland McGrathe07cd602003-02-26 20:34:02 +0000130 struct stat.st_blocks,
Roland McGrath6d2b3492002-12-30 00:51:30 +0000131 struct stat.st_aclcnt,
132 struct stat.st_flags,
133 struct stat.st_fstype,
134 struct stat.st_gen,
135 struct stat.st_level,
136 struct stat.st_rdev])
137AC_STAT64
Bernhard Reutner-Fischer9906e6d2009-10-14 16:33:58 +0200138AC_STATFS64
Roland McGrath6d2b3492002-12-30 00:51:30 +0000139
140AC_TYPE_SIGNAL
141AC_TYPE_UID_T
142AC_TYPE_MODE_T
143AC_TYPE_GETGROUPS
144AC_HEADER_MAJOR
Roland McGrathacf06ef2003-01-10 19:57:34 +0000145AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
Roland McGrathe07cd602003-02-26 20:34:02 +0000146AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
147[#include <sys/types.h>
148#include <sys/socket.h>
149#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000150AC_CHECK_TYPES([long long])
151AC_LITTLE_ENDIAN_LONG_LONG
152AC_OFF_T_IS_LONG_LONG
Roland McGrath6d2b3492002-12-30 00:51:30 +0000153AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
154AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
155
Mike Frysinger24ab9602009-10-07 01:05:12 -0400156AC_CHECK_FUNCS([ \
Mike Frysingerc1a5b7e2009-10-07 20:41:29 -0400157 fork \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400158 if_indextoname \
159 inet_ntop \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400160 prctl \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400161 sendmsg \
162 sigaction \
163 strerror \
164 strsignal \
165 sys_siglist \
166 _sys_siglist \
Denys Vlasenko0a295bc2011-09-01 16:31:48 +0200167 stpcpy \
Mike Frysinger612659e2012-02-14 14:38:28 +0100168 process_vm_readv \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400169])
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000170AC_CHECK_HEADERS([ \
171 inttypes.h \
172 ioctls.h \
173 libaio.h \
174 mqueue.h \
175 poll.h \
176 stropts.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000177 sys/acl.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000178 sys/asynch.h \
179 sys/conf.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000180 sys/epoll.h \
181 sys/filio.h \
182 sys/ioctl.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000183 sys/poll.h \
184 sys/ptrace.h \
185 sys/reg.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000186 sys/uio.h \
187 sys/vfs.h \
188 asm/cachectl.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000189 asm/sysmips.h \
190 linux/capability.h \
191 linux/ptrace.h \
192 linux/utsname.h \
Holger Hans Peter Freyther7fea79b2011-01-14 11:08:12 +0100193 netinet/sctp.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000194], [], [])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000195AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000196 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100197#include <sys/socket.h>
198#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000199AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Roland McGrath587c7b52009-02-11 03:03:28 +0000200AC_CHECK_TYPES([struct sigcontext_struct,
201 struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000202AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000203
Roland McGrath6d2b3492002-12-30 00:51:30 +0000204AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000205
Roland McGratha7a0d382003-01-10 19:55:30 +0000206AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
207 struct T_conn_res.ACCEPTOR_id],,,
208[#include <sys/stream.h>
209#include <sys/tihdr.h>])
210
Roland McGrath79db8af2003-06-27 21:20:09 +0000211AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
212
Roland McGrathce9f0742004-03-01 21:29:22 +0000213AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
214 [#include <sys/ptrace.h>])
215
Roland McGrath7decfb22004-03-01 22:10:52 +0000216AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
217
Roland McGrathbe4d9f82005-08-03 12:18:09 +0000218AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
219
Roland McGrathfece3222007-07-05 19:08:42 +0000220AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
Roland McGrathd26486e2007-07-11 07:11:20 +0000221#ifdef HAVE_ASM_SIGCONTEXT_H
222# include <asm/sigcontext.h>
223#endif])
Roland McGrathfece3222007-07-05 19:08:42 +0000224
Roland McGrath6d2b3492002-12-30 00:51:30 +0000225AC_CHECK_DECLS([sys_errlist])
226AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
Denys Vlasenkod166c552011-07-19 14:49:57 +0200227AC_CHECK_DECLS([
228 PTRACE_SETOPTIONS,
229 PTRACE_GETEVENTMSG,
230 PTRACE_GETSIGINFO,
Dmitry V. Levin1b0df402011-07-19 22:13:11 +0000231 PTRACE_O_TRACESYSGOOD,
Denys Vlasenkod166c552011-07-19 14:49:57 +0200232 PTRACE_O_TRACEFORK,
233 PTRACE_O_TRACEVFORK,
234 PTRACE_O_TRACECLONE,
Dmitry V. Levin1b0df402011-07-19 22:13:11 +0000235 PTRACE_O_TRACEEXEC,
236 PTRACE_O_TRACEEXIT,
Denys Vlasenkod166c552011-07-19 14:49:57 +0200237 PTRACE_EVENT_FORK,
238 PTRACE_EVENT_VFORK,
Dmitry V. Levin1b0df402011-07-19 22:13:11 +0000239 PTRACE_EVENT_CLONE,
240 PTRACE_EVENT_EXEC,
241 PTRACE_EVENT_VFORK_DONE,
242 PTRACE_EVENT_EXIT],,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000243
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000244AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
245 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
246#include <stdlib.h>
247#include <linux/fs.h>], [return !BLKGETSIZE64;])],
248 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
249 if test $ac_cv_have_blkgetsize64 = yes; then
250 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
251 fi)
252
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000253AC_CHECK_SIZEOF([long])
Dmitry V. Levinb468f232012-03-16 23:05:21 +0400254AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000255
Roland McGrath6d2b3492002-12-30 00:51:30 +0000256AC_PATH_PROG([PERL], [perl])
257
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000258AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000259AC_OUTPUT