Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to create configure. Use autoreconf. |
| 2 | AC_PREREQ(2.57) |
Dmitry V. Levin | 50e69cb | 2011-02-21 22:58:59 +0000 | [diff] [blame] | 3 | AC_INIT([strace],[4.6]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 4 | AC_CONFIG_SRCDIR([strace.c]) |
Roland McGrath | ffda2d3 | 2009-10-11 16:25:29 -0700 | [diff] [blame] | 5 | AC_CONFIG_AUX_DIR([.]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 6 | AM_CONFIG_HEADER([config.h]) |
Dmitry V. Levin | 525a39a | 2011-02-27 14:05:58 +0000 | [diff] [blame] | 7 | AM_INIT_AUTOMAKE([foreign check-news dist-xz no-dist-gzip silent-rules]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 8 | AM_MAINTAINER_MODE |
| 9 | AC_CANONICAL_HOST |
| 10 | |
H.J. Lu | 35be581 | 2012-04-16 13:00:01 +0200 | [diff] [blame^] | 11 | AC_PROG_CC |
| 12 | AC_GNU_SOURCE |
| 13 | |
| 14 | AC_USE_SYSTEM_EXTENSIONS |
| 15 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 16 | AC_MSG_CHECKING([for supported architecture]) |
| 17 | case "$host_cpu" in |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 18 | bfin) |
| 19 | arch=bfin |
| 20 | AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.]) |
| 21 | ;; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 22 | i[[3456]]86|pentium) |
| 23 | arch=i386 |
| 24 | AC_DEFINE([I386], 1, [Define for the i386 architecture.]) |
| 25 | ;; |
| 26 | ia64) |
| 27 | arch=ia64 |
| 28 | AC_DEFINE([IA64], 1, [Define for the IA64 architecture.]) |
| 29 | ;; |
| 30 | m68k) |
| 31 | arch=m68k |
| 32 | AC_DEFINE([M68K], 1, [Define for the m68k architecture.]) |
| 33 | ;; |
Roland McGrath | 6d1a65c | 2004-07-12 07:44:08 +0000 | [diff] [blame] | 34 | sparc64*) |
| 35 | arch=sparc64 |
| 36 | AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.]) |
| 37 | ;; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 38 | sparc*) |
| 39 | arch=sparc |
| 40 | AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.]) |
| 41 | ;; |
| 42 | mips*) |
| 43 | arch=mips |
| 44 | AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.]) |
| 45 | ;; |
| 46 | alpha*) |
| 47 | arch=alpha |
| 48 | AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.]) |
| 49 | ;; |
Roland McGrath | eb28535 | 2003-01-14 09:59:00 +0000 | [diff] [blame] | 50 | powerpc*) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 51 | arch=powerpc |
| 52 | AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.]) |
Andreas Schwab | d69fa49 | 2010-07-12 21:39:57 +0200 | [diff] [blame] | 53 | if test $host_cpu = powerpc64; then |
| 54 | AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.]) |
| 55 | fi |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 56 | ;; |
| 57 | arm*) |
| 58 | arch=arm |
| 59 | AC_DEFINE([ARM], 1, [Define for the ARM architecture.]) |
| 60 | ;; |
Denys Vlasenko | 5ae2b7c | 2009-02-27 20:32:52 +0000 | [diff] [blame] | 61 | avr32*) |
| 62 | arch=avr32 |
| 63 | AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.]) |
| 64 | ;; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 65 | s390) |
| 66 | arch=s390 |
| 67 | AC_DEFINE([S390], 1, [Define for the S390 architecture.]) |
| 68 | ;; |
| 69 | s390x) |
| 70 | arch=s390x |
| 71 | AC_DEFINE([S390X], 1, [Define for the S390x architecture.]) |
| 72 | ;; |
| 73 | hppa*|parisc*) |
| 74 | arch=hppa |
| 75 | AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) |
| 76 | ;; |
Roland McGrath | 67828ca | 2007-11-01 21:32:49 +0000 | [diff] [blame] | 77 | sh64*) |
Roland McGrath | f5a4777 | 2003-06-26 22:40:42 +0000 | [diff] [blame] | 78 | arch=sh64 |
| 79 | AC_DEFINE([SH64], 1, [Define for the SH64 architecture.]) |
Roland McGrath | e1e584b | 2003-06-02 19:18:58 +0000 | [diff] [blame] | 80 | ;; |
Roland McGrath | 67828ca | 2007-11-01 21:32:49 +0000 | [diff] [blame] | 81 | sh*) |
| 82 | arch=sh |
| 83 | AC_DEFINE([SH], 1, [Define for the SH architecture.]) |
| 84 | ;; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 85 | x86?64*) |
H.J. Lu | 35be581 | 2012-04-16 13:00:01 +0200 | [diff] [blame^] | 86 | 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 McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 95 | ;; |
Denys Vlasenko | ea0e6e8 | 2009-02-25 17:08:40 +0000 | [diff] [blame] | 96 | cris|crisv10) |
| 97 | arch=crisv10 |
| 98 | AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.]) |
| 99 | ;; |
| 100 | crisv32) |
| 101 | arch=crisv32 |
| 102 | AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.]) |
| 103 | ;; |
Chris Metcalf | c8c6698 | 2009-12-28 10:00:15 -0500 | [diff] [blame] | 104 | tile*) |
| 105 | arch=tile |
| 106 | AC_DEFINE([TILE], 1, [Define for the Tile architecture]) |
| 107 | ;; |
Edgar E. Iglesias | 939caba | 2010-07-06 14:21:07 +0200 | [diff] [blame] | 108 | microblaze*) |
| 109 | arch=microblaze |
| 110 | AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.]) |
| 111 | ;; |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 112 | *) |
| 113 | AC_MSG_RESULT([NO!]) |
| 114 | AC_MSG_ERROR([architecture $host_cpu is not supported by strace]) |
| 115 | ;; |
| 116 | esac |
| 117 | AC_MSG_RESULT($arch) |
| 118 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 119 | AC_SUBST(arch) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 120 | |
Roland McGrath | bc44e40 | 2004-07-12 05:45:08 +0000 | [diff] [blame] | 121 | AM_CONDITIONAL([I386], [test x$arch = xi386]) |
Roland McGrath | 2746edd | 2002-12-30 09:13:08 +0000 | [diff] [blame] | 122 | AM_CONDITIONAL([X86_64], [test x$arch = xx86_64]) |
H.J. Lu | 35be581 | 2012-04-16 13:00:01 +0200 | [diff] [blame^] | 123 | AM_CONDITIONAL([X32], [test x$arch = xx32]) |
Roland McGrath | 45aeb6e | 2003-01-10 10:44:59 +0000 | [diff] [blame] | 124 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 125 | AC_INCLUDEDIR |
| 126 | |
Dmitry V. Levin | 918e49b | 2010-09-09 17:41:15 +0000 | [diff] [blame] | 127 | gl_WARN_ADD([-Wall]) |
Dmitry V. Levin | 1ed5d80 | 2010-09-09 17:42:28 +0000 | [diff] [blame] | 128 | gl_WARN_ADD([-Wwrite-strings]) |
Dmitry V. Levin | 918e49b | 2010-09-09 17:41:15 +0000 | [diff] [blame] | 129 | AC_SUBST([WARN_CFLAGS]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 130 | |
| 131 | AC_PROG_CPP |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 132 | AC_PROG_INSTALL |
| 133 | AC_C_CONST |
Mike Frysinger | 6d12afd | 2010-09-12 03:39:55 -0400 | [diff] [blame] | 134 | AC_C_BIGENDIAN |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 135 | AC_HEADER_STDC |
Roland McGrath | 639658b | 2008-08-01 01:06:31 +0000 | [diff] [blame] | 136 | AC_HEADER_STDBOOL |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 137 | AC_HEADER_DIRENT |
| 138 | AC_HEADER_STAT |
Dmitry V. Levin | d8879f4 | 2012-03-25 15:12:16 +0000 | [diff] [blame] | 139 | AC_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 McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 149 | AC_STAT64 |
Bernhard Reutner-Fischer | 9906e6d | 2009-10-14 16:33:58 +0200 | [diff] [blame] | 150 | AC_STATFS64 |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 151 | |
| 152 | AC_TYPE_SIGNAL |
| 153 | AC_TYPE_UID_T |
| 154 | AC_TYPE_MODE_T |
| 155 | AC_TYPE_GETGROUPS |
| 156 | AC_HEADER_MAJOR |
Roland McGrath | acf06ef | 2003-01-10 19:57:34 +0000 | [diff] [blame] | 157 | AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>]) |
Roland McGrath | e07cd60 | 2003-02-26 20:34:02 +0000 | [diff] [blame] | 158 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, |
| 159 | [#include <sys/types.h> |
| 160 | #include <sys/socket.h> |
| 161 | #include <netinet/in.h>]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 162 | AC_CHECK_TYPES([long long]) |
| 163 | AC_LITTLE_ENDIAN_LONG_LONG |
| 164 | AC_OFF_T_IS_LONG_LONG |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 165 | AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>]) |
| 166 | AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>]) |
| 167 | |
Dmitry V. Levin | d8879f4 | 2012-03-25 15:12:16 +0000 | [diff] [blame] | 168 | AC_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 | ])) |
| 182 | AC_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 McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 207 | AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h], |
Roland McGrath | e7fa305 | 2007-07-05 20:50:34 +0000 | [diff] [blame] | 208 | [], [], [#include <stddef.h> |
Andreas Schwab | 360986b | 2010-03-08 16:07:52 +0100 | [diff] [blame] | 209 | #include <sys/socket.h> |
| 210 | #include <asm/types.h>]) |
Roland McGrath | 41074c0 | 2002-12-30 10:23:01 +0000 | [diff] [blame] | 211 | AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>]) |
Roland McGrath | 587c7b5 | 2009-02-11 03:03:28 +0000 | [diff] [blame] | 212 | AC_CHECK_TYPES([struct sigcontext_struct, |
| 213 | struct sigcontext],,, [#include <signal.h>]) |
Roland McGrath | a7a0d38 | 2003-01-10 19:55:30 +0000 | [diff] [blame] | 214 | AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 215 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 216 | AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 217 | |
Roland McGrath | a7a0d38 | 2003-01-10 19:55:30 +0000 | [diff] [blame] | 218 | AC_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 McGrath | 79db8af | 2003-06-27 21:20:09 +0000 | [diff] [blame] | 223 | AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>]) |
| 224 | |
Roland McGrath | ce9f074 | 2004-03-01 21:29:22 +0000 | [diff] [blame] | 225 | AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,, |
| 226 | [#include <sys/ptrace.h>]) |
| 227 | |
Roland McGrath | 7decfb2 | 2004-03-01 22:10:52 +0000 | [diff] [blame] | 228 | AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>]) |
| 229 | |
Roland McGrath | be4d9f8 | 2005-08-03 12:18:09 +0000 | [diff] [blame] | 230 | AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>]) |
| 231 | |
Roland McGrath | fece322 | 2007-07-05 19:08:42 +0000 | [diff] [blame] | 232 | AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h> |
Roland McGrath | d26486e | 2007-07-11 07:11:20 +0000 | [diff] [blame] | 233 | #ifdef HAVE_ASM_SIGCONTEXT_H |
| 234 | # include <asm/sigcontext.h> |
| 235 | #endif]) |
Roland McGrath | fece322 | 2007-07-05 19:08:42 +0000 | [diff] [blame] | 236 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 237 | AC_CHECK_DECLS([sys_errlist]) |
| 238 | AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>]) |
Dmitry V. Levin | d8879f4 | 2012-03-25 15:12:16 +0000 | [diff] [blame] | 239 | AC_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 McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 256 | |
Dmitry V. Levin | 25caa31 | 2011-08-16 21:36:16 +0000 | [diff] [blame] | 257 | AC_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. Levin | 63e4f86 | 2012-03-15 20:42:46 +0000 | [diff] [blame] | 266 | AC_CHECK_SIZEOF([long]) |
Dmitry V. Levin | b468f23 | 2012-03-16 23:05:21 +0400 | [diff] [blame] | 267 | AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>]) |
Dmitry V. Levin | 63e4f86 | 2012-03-15 20:42:46 +0000 | [diff] [blame] | 268 | |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 269 | AC_PATH_PROG([PERL], [perl]) |
| 270 | |
Dmitry V. Levin | 4e4b5ad | 2011-02-27 00:28:50 +0000 | [diff] [blame] | 271 | AC_CONFIG_FILES([Makefile tests/Makefile]) |
Roland McGrath | 6d2b349 | 2002-12-30 00:51:30 +0000 | [diff] [blame] | 272 | AC_OUTPUT |