blob: 8703f7cc56175d5f2032da9e3b75a9ccfbd7e099 [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. Levin417eb882012-05-02 12:34:56 +00003AC_INIT([strace],[4.7])
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
H.J. Lu35be5812012-04-16 13:00:01 +020011AC_PROG_CC
H.J. Lu35be5812012-04-16 13:00:01 +020012AC_USE_SYSTEM_EXTENSIONS
13
Roland McGrath6d2b3492002-12-30 00:51:30 +000014AC_MSG_CHECKING([for supported architecture])
15case "$host_cpu" in
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +000016bfin)
17 arch=bfin
18 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
19 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000020i[[3456]]86|pentium)
21 arch=i386
22 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
23 ;;
24ia64)
25 arch=ia64
26 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
27 ;;
28m68k)
29 arch=m68k
30 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
31 ;;
Roland McGrath6d1a65c2004-07-12 07:44:08 +000032sparc64*)
33 arch=sparc64
34 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
35 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000036sparc*)
37 arch=sparc
38 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
39 ;;
40mips*)
41 arch=mips
42 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
43 ;;
44alpha*)
45 arch=alpha
46 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
47 ;;
Roland McGratheb285352003-01-14 09:59:00 +000048powerpc*)
Roland McGrath6d2b3492002-12-30 00:51:30 +000049 arch=powerpc
50 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Andreas Schwabd69fa492010-07-12 21:39:57 +020051 if test $host_cpu = powerpc64; then
52 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
53 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000054 ;;
55arm*)
56 arch=arm
57 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
58 ;;
Steve McIntyred8d3bd32012-10-24 17:58:16 +010059aarch64*)
60 arch=aarch64
61 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
62 ;;
Denys Vlasenko5ae2b7c2009-02-27 20:32:52 +000063avr32*)
64 arch=avr32
65 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
66 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000067s390)
68 arch=s390
69 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
70 ;;
71s390x)
72 arch=s390x
73 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
74 ;;
75hppa*|parisc*)
76 arch=hppa
77 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
78 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000079sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +000080 arch=sh64
81 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +000082 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000083sh*)
84 arch=sh
85 AC_DEFINE([SH], 1, [Define for the SH architecture.])
86 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000087x86?64*)
H.J. Lu35be5812012-04-16 13:00:01 +020088 AC_TRY_COMPILE(
89[#ifndef __ILP32__
90# error not x32
91#endif], [], arch=x32, arch=x86_64)
92 if test "$arch" = "x86_64"; then
93 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
94 else
95 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
96 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000097 ;;
Denys Vlasenkoea0e6e82009-02-25 17:08:40 +000098cris|crisv10)
99 arch=crisv10
100 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
101 ;;
102crisv32)
103 arch=crisv32
104 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
105 ;;
Chris Metcalfc8c66982009-12-28 10:00:15 -0500106tile*)
107 arch=tile
108 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
109 ;;
Edgar E. Iglesias939caba2010-07-06 14:21:07 +0200110microblaze*)
111 arch=microblaze
112 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
113 ;;
Christian Svensson492f81f2013-02-14 13:26:27 +0100114or1k*)
115 arch=or1k
116 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
117 ;;
118
Roland McGrath6d2b3492002-12-30 00:51:30 +0000119*)
120 AC_MSG_RESULT([NO!])
121 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
122 ;;
123esac
124AC_MSG_RESULT($arch)
125
Roland McGrath6d2b3492002-12-30 00:51:30 +0000126AC_SUBST(arch)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000127
Roland McGrathbc44e402004-07-12 05:45:08 +0000128AM_CONDITIONAL([I386], [test x$arch = xi386])
Roland McGrath2746edd2002-12-30 09:13:08 +0000129AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
H.J. Lu35be5812012-04-16 13:00:01 +0200130AM_CONDITIONAL([X32], [test x$arch = xx32])
Roland McGrath45aeb6e2003-01-10 10:44:59 +0000131
Roland McGrath6d2b3492002-12-30 00:51:30 +0000132AC_INCLUDEDIR
133
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000134gl_WARN_ADD([-Wall])
Dmitry V. Levin1ed5d802010-09-09 17:42:28 +0000135gl_WARN_ADD([-Wwrite-strings])
Dmitry V. Levind376c922012-05-15 00:50:26 +0000136AC_ARG_ENABLE([gcc-Werror],
137 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
138 [case $enableval in
139 yes) gl_WARN_ADD([-Werror]) ;;
140 no) ;;
141 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
142 esac]
143)
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000144AC_SUBST([WARN_CFLAGS])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000145
146AC_PROG_CPP
Roland McGrath6d2b3492002-12-30 00:51:30 +0000147AC_PROG_INSTALL
148AC_C_CONST
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400149AC_C_BIGENDIAN
Roland McGrath6d2b3492002-12-30 00:51:30 +0000150AC_HEADER_STDC
Roland McGrath639658b2008-08-01 01:06:31 +0000151AC_HEADER_STDBOOL
Roland McGrath6d2b3492002-12-30 00:51:30 +0000152AC_HEADER_DIRENT
153AC_HEADER_STAT
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000154AC_CHECK_MEMBERS(m4_normalize([
155 struct stat.st_aclcnt,
156 struct stat.st_blksize,
157 struct stat.st_blocks,
158 struct stat.st_flags,
159 struct stat.st_fstype,
160 struct stat.st_gen,
161 struct stat.st_level,
162 struct stat.st_rdev
163]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000164AC_STAT64
Bernhard Reutner-Fischer9906e6d2009-10-14 16:33:58 +0200165AC_STATFS64
Roland McGrath6d2b3492002-12-30 00:51:30 +0000166
167AC_TYPE_SIGNAL
168AC_TYPE_UID_T
169AC_TYPE_MODE_T
170AC_TYPE_GETGROUPS
171AC_HEADER_MAJOR
Roland McGrathacf06ef2003-01-10 19:57:34 +0000172AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
Roland McGrathe07cd602003-02-26 20:34:02 +0000173AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
174[#include <sys/types.h>
175#include <sys/socket.h>
176#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000177AC_CHECK_TYPES([long long])
178AC_LITTLE_ENDIAN_LONG_LONG
179AC_OFF_T_IS_LONG_LONG
Roland McGrath6d2b3492002-12-30 00:51:30 +0000180AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
181AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
182
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000183AC_CHECK_FUNCS(m4_normalize([
184 fork
185 if_indextoname
186 inet_ntop
187 prctl
188 process_vm_readv
189 sendmsg
190 sigaction
191 stpcpy
192 strerror
193 strsignal
194 _sys_siglist
195 sys_siglist
196]))
197AC_CHECK_HEADERS(m4_normalize([
198 asm/cachectl.h
199 asm/sysmips.h
200 inttypes.h
201 ioctls.h
202 libaio.h
203 linux/capability.h
Ben Noordhuis88eafd82013-02-04 00:04:57 +0100204 linux/perf_event.h
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000205 linux/ptrace.h
206 linux/utsname.h
207 mqueue.h
208 netinet/sctp.h
209 poll.h
210 stropts.h
211 sys/acl.h
212 sys/asynch.h
213 sys/conf.h
214 sys/epoll.h
215 sys/filio.h
216 sys/ioctl.h
217 sys/poll.h
218 sys/ptrace.h
219 sys/reg.h
220 sys/uio.h
221 sys/vfs.h
222]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000223AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000224 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100225#include <sys/socket.h>
226#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000227AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Roland McGrath587c7b52009-02-11 03:03:28 +0000228AC_CHECK_TYPES([struct sigcontext_struct,
229 struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000230AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000231
Roland McGrath6d2b3492002-12-30 00:51:30 +0000232AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000233
Roland McGratha7a0d382003-01-10 19:55:30 +0000234AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
235 struct T_conn_res.ACCEPTOR_id],,,
236[#include <sys/stream.h>
237#include <sys/tihdr.h>])
238
Roland McGrath79db8af2003-06-27 21:20:09 +0000239AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
240
Roland McGrathce9f0742004-03-01 21:29:22 +0000241AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
242 [#include <sys/ptrace.h>])
243
Roland McGrath7decfb22004-03-01 22:10:52 +0000244AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
245
Roland McGrathbe4d9f82005-08-03 12:18:09 +0000246AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
247
Roland McGrathfece3222007-07-05 19:08:42 +0000248AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
Roland McGrathd26486e2007-07-11 07:11:20 +0000249#ifdef HAVE_ASM_SIGCONTEXT_H
250# include <asm/sigcontext.h>
251#endif])
Roland McGrathfece3222007-07-05 19:08:42 +0000252
Dmitry V. Levinea22e972012-05-01 20:56:32 +0000253AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
254
Roland McGrath6d2b3492002-12-30 00:51:30 +0000255AC_CHECK_DECLS([sys_errlist])
256AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000257AC_CHECK_DECLS(m4_normalize([
258 PTRACE_EVENT_CLONE,
259 PTRACE_EVENT_EXEC,
260 PTRACE_EVENT_EXIT,
261 PTRACE_EVENT_FORK,
262 PTRACE_EVENT_VFORK,
263 PTRACE_EVENT_VFORK_DONE,
264 PTRACE_GETEVENTMSG,
265 PTRACE_GETSIGINFO,
266 PTRACE_O_TRACECLONE,
267 PTRACE_O_TRACEEXEC,
268 PTRACE_O_TRACEEXIT,
269 PTRACE_O_TRACEFORK,
270 PTRACE_O_TRACESYSGOOD,
271 PTRACE_O_TRACEVFORK,
272 PTRACE_SETOPTIONS
273]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000274
Dmitry V. Levincf050db2012-05-02 10:21:49 +0000275AC_CHECK_DECLS(m4_normalize([
276 LO_FLAGS_AUTOCLEAR,
277 LO_FLAGS_PARTSCAN
278]),,, [#include <linux/loop.h>])
279
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000280AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
281 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
282#include <stdlib.h>
283#include <linux/fs.h>], [return !BLKGETSIZE64;])],
284 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
285 if test $ac_cv_have_blkgetsize64 = yes; then
286 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
287 fi)
288
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000289AC_CHECK_SIZEOF([long])
Dmitry V. Levinb468f232012-03-16 23:05:21 +0400290AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000291
Roland McGrath6d2b3492002-12-30 00:51:30 +0000292AC_PATH_PROG([PERL], [perl])
293
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000294AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000295AC_OUTPUT