blob: f55b8a204a85511782c433d76eda87d638478268 [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
H.J. Lu35be5812012-04-16 13:00:01 +020011AC_PROG_CC
12AC_GNU_SOURCE
13
14AC_USE_SYSTEM_EXTENSIONS
15
Roland McGrath6d2b3492002-12-30 00:51:30 +000016AC_MSG_CHECKING([for supported architecture])
17case "$host_cpu" in
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +000018bfin)
19 arch=bfin
20 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
21 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000022i[[3456]]86|pentium)
23 arch=i386
24 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
25 ;;
26ia64)
27 arch=ia64
28 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
29 ;;
30m68k)
31 arch=m68k
32 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
33 ;;
Roland McGrath6d1a65c2004-07-12 07:44:08 +000034sparc64*)
35 arch=sparc64
36 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
37 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000038sparc*)
39 arch=sparc
40 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
41 ;;
42mips*)
43 arch=mips
44 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
45 ;;
46alpha*)
47 arch=alpha
48 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
49 ;;
Roland McGratheb285352003-01-14 09:59:00 +000050powerpc*)
Roland McGrath6d2b3492002-12-30 00:51:30 +000051 arch=powerpc
52 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
Andreas Schwabd69fa492010-07-12 21:39:57 +020053 if test $host_cpu = powerpc64; then
54 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
55 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000056 ;;
57arm*)
58 arch=arm
59 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
60 ;;
Denys Vlasenko5ae2b7c2009-02-27 20:32:52 +000061avr32*)
62 arch=avr32
63 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
64 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000065s390)
66 arch=s390
67 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
68 ;;
69s390x)
70 arch=s390x
71 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
72 ;;
73hppa*|parisc*)
74 arch=hppa
75 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
76 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000077sh64*)
Roland McGrathf5a47772003-06-26 22:40:42 +000078 arch=sh64
79 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
Roland McGrathe1e584b2003-06-02 19:18:58 +000080 ;;
Roland McGrath67828ca2007-11-01 21:32:49 +000081sh*)
82 arch=sh
83 AC_DEFINE([SH], 1, [Define for the SH architecture.])
84 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +000085x86?64*)
H.J. Lu35be5812012-04-16 13:00:01 +020086 AC_TRY_COMPILE(
87[#ifndef __ILP32__
88# error not x32
89#endif], [], arch=x32, arch=x86_64)
90 if test "$arch" = "x86_64"; then
91 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
92 else
93 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
94 fi
Roland McGrath6d2b3492002-12-30 00:51:30 +000095 ;;
Denys Vlasenkoea0e6e82009-02-25 17:08:40 +000096cris|crisv10)
97 arch=crisv10
98 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
99 ;;
100crisv32)
101 arch=crisv32
102 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
103 ;;
Chris Metcalfc8c66982009-12-28 10:00:15 -0500104tile*)
105 arch=tile
106 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
107 ;;
Edgar E. Iglesias939caba2010-07-06 14:21:07 +0200108microblaze*)
109 arch=microblaze
110 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
111 ;;
Roland McGrath6d2b3492002-12-30 00:51:30 +0000112*)
113 AC_MSG_RESULT([NO!])
114 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
115 ;;
116esac
117AC_MSG_RESULT($arch)
118
Roland McGrath6d2b3492002-12-30 00:51:30 +0000119AC_SUBST(arch)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000120
Roland McGrathbc44e402004-07-12 05:45:08 +0000121AM_CONDITIONAL([I386], [test x$arch = xi386])
Roland McGrath2746edd2002-12-30 09:13:08 +0000122AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
H.J. Lu35be5812012-04-16 13:00:01 +0200123AM_CONDITIONAL([X32], [test x$arch = xx32])
Roland McGrath45aeb6e2003-01-10 10:44:59 +0000124
Roland McGrath6d2b3492002-12-30 00:51:30 +0000125AC_INCLUDEDIR
126
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000127gl_WARN_ADD([-Wall])
Dmitry V. Levin1ed5d802010-09-09 17:42:28 +0000128gl_WARN_ADD([-Wwrite-strings])
Dmitry V. Levin918e49b2010-09-09 17:41:15 +0000129AC_SUBST([WARN_CFLAGS])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000130
131AC_PROG_CPP
Roland McGrath6d2b3492002-12-30 00:51:30 +0000132AC_PROG_INSTALL
133AC_C_CONST
Mike Frysinger6d12afd2010-09-12 03:39:55 -0400134AC_C_BIGENDIAN
Roland McGrath6d2b3492002-12-30 00:51:30 +0000135AC_HEADER_STDC
Roland McGrath639658b2008-08-01 01:06:31 +0000136AC_HEADER_STDBOOL
Roland McGrath6d2b3492002-12-30 00:51:30 +0000137AC_HEADER_DIRENT
138AC_HEADER_STAT
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000139AC_CHECK_MEMBERS(m4_normalize([
140 struct stat.st_aclcnt,
141 struct stat.st_blksize,
142 struct stat.st_blocks,
143 struct stat.st_flags,
144 struct stat.st_fstype,
145 struct stat.st_gen,
146 struct stat.st_level,
147 struct stat.st_rdev
148]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000149AC_STAT64
Bernhard Reutner-Fischer9906e6d2009-10-14 16:33:58 +0200150AC_STATFS64
Roland McGrath6d2b3492002-12-30 00:51:30 +0000151
152AC_TYPE_SIGNAL
153AC_TYPE_UID_T
154AC_TYPE_MODE_T
155AC_TYPE_GETGROUPS
156AC_HEADER_MAJOR
Roland McGrathacf06ef2003-01-10 19:57:34 +0000157AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
Roland McGrathe07cd602003-02-26 20:34:02 +0000158AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
159[#include <sys/types.h>
160#include <sys/socket.h>
161#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000162AC_CHECK_TYPES([long long])
163AC_LITTLE_ENDIAN_LONG_LONG
164AC_OFF_T_IS_LONG_LONG
Roland McGrath6d2b3492002-12-30 00:51:30 +0000165AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
166AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
167
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000168AC_CHECK_FUNCS(m4_normalize([
169 fork
170 if_indextoname
171 inet_ntop
172 prctl
173 process_vm_readv
174 sendmsg
175 sigaction
176 stpcpy
177 strerror
178 strsignal
179 _sys_siglist
180 sys_siglist
181]))
182AC_CHECK_HEADERS(m4_normalize([
183 asm/cachectl.h
184 asm/sysmips.h
185 inttypes.h
186 ioctls.h
187 libaio.h
188 linux/capability.h
189 linux/ptrace.h
190 linux/utsname.h
191 mqueue.h
192 netinet/sctp.h
193 poll.h
194 stropts.h
195 sys/acl.h
196 sys/asynch.h
197 sys/conf.h
198 sys/epoll.h
199 sys/filio.h
200 sys/ioctl.h
201 sys/poll.h
202 sys/ptrace.h
203 sys/reg.h
204 sys/uio.h
205 sys/vfs.h
206]))
Roland McGrath6d2b3492002-12-30 00:51:30 +0000207AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
Roland McGrathe7fa3052007-07-05 20:50:34 +0000208 [], [], [#include <stddef.h>
Andreas Schwab360986b2010-03-08 16:07:52 +0100209#include <sys/socket.h>
210#include <asm/types.h>])
Roland McGrath41074c02002-12-30 10:23:01 +0000211AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
Roland McGrath587c7b52009-02-11 03:03:28 +0000212AC_CHECK_TYPES([struct sigcontext_struct,
213 struct sigcontext],,, [#include <signal.h>])
Roland McGratha7a0d382003-01-10 19:55:30 +0000214AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000215
Roland McGrath6d2b3492002-12-30 00:51:30 +0000216AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000217
Roland McGratha7a0d382003-01-10 19:55:30 +0000218AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
219 struct T_conn_res.ACCEPTOR_id],,,
220[#include <sys/stream.h>
221#include <sys/tihdr.h>])
222
Roland McGrath79db8af2003-06-27 21:20:09 +0000223AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
224
Roland McGrathce9f0742004-03-01 21:29:22 +0000225AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
226 [#include <sys/ptrace.h>])
227
Roland McGrath7decfb22004-03-01 22:10:52 +0000228AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
229
Roland McGrathbe4d9f82005-08-03 12:18:09 +0000230AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
231
Roland McGrathfece3222007-07-05 19:08:42 +0000232AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
Roland McGrathd26486e2007-07-11 07:11:20 +0000233#ifdef HAVE_ASM_SIGCONTEXT_H
234# include <asm/sigcontext.h>
235#endif])
Roland McGrathfece3222007-07-05 19:08:42 +0000236
Roland McGrath6d2b3492002-12-30 00:51:30 +0000237AC_CHECK_DECLS([sys_errlist])
238AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
Dmitry V. Levind8879f42012-03-25 15:12:16 +0000239AC_CHECK_DECLS(m4_normalize([
240 PTRACE_EVENT_CLONE,
241 PTRACE_EVENT_EXEC,
242 PTRACE_EVENT_EXIT,
243 PTRACE_EVENT_FORK,
244 PTRACE_EVENT_VFORK,
245 PTRACE_EVENT_VFORK_DONE,
246 PTRACE_GETEVENTMSG,
247 PTRACE_GETSIGINFO,
248 PTRACE_O_TRACECLONE,
249 PTRACE_O_TRACEEXEC,
250 PTRACE_O_TRACEEXIT,
251 PTRACE_O_TRACEFORK,
252 PTRACE_O_TRACESYSGOOD,
253 PTRACE_O_TRACEVFORK,
254 PTRACE_SETOPTIONS
255]),,, [#include <sys/ptrace.h>])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000256
Dmitry V. Levin25caa312011-08-16 21:36:16 +0000257AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
258 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
259#include <stdlib.h>
260#include <linux/fs.h>], [return !BLKGETSIZE64;])],
261 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
262 if test $ac_cv_have_blkgetsize64 = yes; then
263 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
264 fi)
265
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000266AC_CHECK_SIZEOF([long])
Dmitry V. Levinb468f232012-03-16 23:05:21 +0400267AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
Dmitry V. Levin63e4f862012-03-15 20:42:46 +0000268
Roland McGrath6d2b3492002-12-30 00:51:30 +0000269AC_PATH_PROG([PERL], [perl])
270
Dmitry V. Levin4e4b5ad2011-02-27 00:28:50 +0000271AC_CONFIG_FILES([Makefile tests/Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000272AC_OUTPUT