blob: 86d1de260fed9494bf791fea747d49dcc2aac30b [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
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000129AC_CHECK_MEMBERS(m4_normalize([
130 struct stat.st_aclcnt,
131 struct stat.st_blksize,
132 struct stat.st_blocks,
133 struct stat.st_flags,
134 struct stat.st_fstype,
135 struct stat.st_gen,
136 struct stat.st_level,
137 struct stat.st_rdev
138]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000139AC_STAT64
Bernhard Reutner-Fischer9906e6d2009-10-14 16:33:58 +0200140AC_STATFS64
Roland McGrath6d2b3492002-12-30 00:51:30 +0000141
142AC_TYPE_SIGNAL
143AC_TYPE_UID_T
144AC_TYPE_MODE_T
145AC_TYPE_GETGROUPS
146AC_HEADER_MAJOR
Roland McGrathacf06ef2003-01-10 19:57:34 +0000147AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
Roland McGrathe07cd602003-02-26 20:34:02 +0000148AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
149[#include <sys/types.h>
150#include <sys/socket.h>
151#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000152AC_CHECK_TYPES([long long])
153AC_LITTLE_ENDIAN_LONG_LONG
154AC_OFF_T_IS_LONG_LONG
Roland McGrath6d2b3492002-12-30 00:51:30 +0000155AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
156AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
157
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000158AC_CHECK_FUNCS(m4_normalize([
159 fork
160 if_indextoname
161 inet_ntop
162 prctl
163 process_vm_readv
164 sendmsg
165 sigaction
166 stpcpy
167 strerror
168 strsignal
169 _sys_siglist
170 sys_siglist
171]))
172AC_CHECK_HEADERS(m4_normalize([
173 asm/cachectl.h
174 asm/sysmips.h
175 inttypes.h
176 ioctls.h
177 libaio.h
178 linux/capability.h
179 linux/ptrace.h
180 linux/utsname.h
181 mqueue.h
182 netinet/sctp.h
183 poll.h
184 stropts.h
185 sys/acl.h
186 sys/asynch.h
187 sys/conf.h
188 sys/epoll.h
189 sys/filio.h
190 sys/ioctl.h
191 sys/poll.h
192 sys/ptrace.h
193 sys/reg.h
194 sys/uio.h
195 sys/vfs.h
196]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000197AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000198 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100199#include <sys/socket.h>
200#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000201AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Roland McGrath587c7b52009-02-11 03:03:28 +0000202AC_CHECK_TYPES([struct sigcontext_struct,
203 struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000204AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000205
Roland McGrath6d2b3492002-12-30 00:51:30 +0000206AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000207
Roland McGratha7a0d382003-01-10 19:55:30 +0000208AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
209 struct T_conn_res.ACCEPTOR_id],,,
210[#include <sys/stream.h>
211#include <sys/tihdr.h>])
212
Roland McGrath79db8af2003-06-27 21:20:09 +0000213AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
214
Roland McGrathce9f0742004-03-01 21:29:22 +0000215AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
216 [#include <sys/ptrace.h>])
217
Roland McGrath7decfb22004-03-01 22:10:52 +0000218AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
219
Roland McGrathbe4d9f82005-08-03 12:18:09 +0000220AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
221
Roland McGrathfece3222007-07-05 19:08:42 +0000222AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
Roland McGrathd26486e2007-07-11 07:11:20 +0000223#ifdef HAVE_ASM_SIGCONTEXT_H
224# include <asm/sigcontext.h>
225#endif])
Roland McGrathfece3222007-07-05 19:08:42 +0000226
Roland McGrath6d2b3492002-12-30 00:51:30 +0000227AC_CHECK_DECLS([sys_errlist])
228AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000229AC_CHECK_DECLS(m4_normalize([
230 PTRACE_EVENT_CLONE,
231 PTRACE_EVENT_EXEC,
232 PTRACE_EVENT_EXIT,
233 PTRACE_EVENT_FORK,
234 PTRACE_EVENT_VFORK,
235 PTRACE_EVENT_VFORK_DONE,
236 PTRACE_GETEVENTMSG,
237 PTRACE_GETSIGINFO,
238 PTRACE_O_TRACECLONE,
239 PTRACE_O_TRACEEXEC,
240 PTRACE_O_TRACEEXIT,
241 PTRACE_O_TRACEFORK,
242 PTRACE_O_TRACESYSGOOD,
243 PTRACE_O_TRACEVFORK,
244 PTRACE_SETOPTIONS
245]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000246
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000247AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
248 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
249#include <stdlib.h>
250#include <linux/fs.h>], [return !BLKGETSIZE64;])],
251 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
252 if test $ac_cv_have_blkgetsize64 = yes; then
253 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
254 fi)
255
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000256AC_CHECK_SIZEOF([long])
Dmitry V. Levinb468f232012-03-16 23:05:21 +0400257AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000258
Roland McGrath6d2b3492002-12-30 00:51:30 +0000259AC_PATH_PROG([PERL], [perl])
260
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000261AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000262AC_OUTPUT