blob: ee9b8e824432d838b47577f0019fc77d6bf779f3 [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
153AC_RLIM_T_IS_LONG_LONG
154AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
155AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
156
Mike Frysinger24ab9602009-10-07 01:05:12 -0400157AC_CHECK_FUNCS([ \
Mike Frysingerc1a5b7e2009-10-07 20:41:29 -0400158 fork \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400159 if_indextoname \
160 inet_ntop \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400161 prctl \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400162 sendmsg \
163 sigaction \
164 strerror \
165 strsignal \
166 sys_siglist \
167 _sys_siglist \
Denys Vlasenko0a295bc2011-09-01 16:31:48 +0200168 stpcpy \
Mike Frysinger612659e2012-02-14 14:38:28 +0100169 process_vm_readv \
Mike Frysinger24ab9602009-10-07 01:05:12 -0400170])
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000171AC_CHECK_HEADERS([ \
172 inttypes.h \
173 ioctls.h \
174 libaio.h \
175 mqueue.h \
176 poll.h \
177 stropts.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000178 sys/acl.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000179 sys/asynch.h \
180 sys/conf.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000181 sys/epoll.h \
182 sys/filio.h \
183 sys/ioctl.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000184 sys/poll.h \
185 sys/ptrace.h \
186 sys/reg.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000187 sys/uio.h \
188 sys/vfs.h \
189 asm/cachectl.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000190 asm/sysmips.h \
191 linux/capability.h \
192 linux/ptrace.h \
193 linux/utsname.h \
Holger Hans Peter Freyther7fea79b2011-01-14 11:08:12 +0100194 netinet/sctp.h \
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +0000195], [], [])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000196AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000197 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100198#include <sys/socket.h>
199#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000200AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Roland McGrath587c7b52009-02-11 03:03:28 +0000201AC_CHECK_TYPES([struct sigcontext_struct,
202 struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000203AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000204
Roland McGrath6d2b3492002-12-30 00:51:30 +0000205AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000206
Roland McGratha7a0d382003-01-10 19:55:30 +0000207AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
208 struct T_conn_res.ACCEPTOR_id],,,
209[#include <sys/stream.h>
210#include <sys/tihdr.h>])
211
Roland McGrath79db8af2003-06-27 21:20:09 +0000212AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
213
Roland McGrathce9f0742004-03-01 21:29:22 +0000214AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
215 [#include <sys/ptrace.h>])
216
Roland McGrath7decfb22004-03-01 22:10:52 +0000217AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
218
Roland McGrathbe4d9f82005-08-03 12:18:09 +0000219AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
220
Roland McGrathfece3222007-07-05 19:08:42 +0000221AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
Roland McGrathd26486e2007-07-11 07:11:20 +0000222#ifdef HAVE_ASM_SIGCONTEXT_H
223# include <asm/sigcontext.h>
224#endif])
Roland McGrathfece3222007-07-05 19:08:42 +0000225
Roland McGrath6d2b3492002-12-30 00:51:30 +0000226AC_CHECK_DECLS([sys_errlist])
227AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
Denys Vlasenkod166c552011-07-19 14:49:57 +0200228AC_CHECK_DECLS([
229 PTRACE_SETOPTIONS,
230 PTRACE_GETEVENTMSG,
231 PTRACE_GETSIGINFO,
Dmitry V. Levin1b0df402011-07-19 22:13:11 +0000232 PTRACE_O_TRACESYSGOOD,
Denys Vlasenkod166c552011-07-19 14:49:57 +0200233 PTRACE_O_TRACEFORK,
234 PTRACE_O_TRACEVFORK,
235 PTRACE_O_TRACECLONE,
Dmitry V. Levin1b0df402011-07-19 22:13:11 +0000236 PTRACE_O_TRACEEXEC,
237 PTRACE_O_TRACEEXIT,
Denys Vlasenkod166c552011-07-19 14:49:57 +0200238 PTRACE_EVENT_FORK,
239 PTRACE_EVENT_VFORK,
Dmitry V. Levin1b0df402011-07-19 22:13:11 +0000240 PTRACE_EVENT_CLONE,
241 PTRACE_EVENT_EXEC,
242 PTRACE_EVENT_VFORK_DONE,
243 PTRACE_EVENT_EXIT],,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000244
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000245AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
246 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
247#include <stdlib.h>
248#include <linux/fs.h>], [return !BLKGETSIZE64;])],
249 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
250 if test $ac_cv_have_blkgetsize64 = yes; then
251 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
252 fi)
253
Roland McGrath6d2b3492002-12-30 00:51:30 +0000254AC_PATH_PROG([PERL], [perl])
255
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000256AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000257AC_OUTPUT