1 dnl Process this file with autoconf to create configure. Use autoreconf.
3 AC_INIT([strace],[4.7])
4 AC_CONFIG_SRCDIR([strace.c])
6 AM_CONFIG_HEADER([config.h])
7 AM_INIT_AUTOMAKE([foreign check-news dist-xz no-dist-gzip silent-rules])
12 AC_USE_SYSTEM_EXTENSIONS
14 AC_MSG_CHECKING([for supported architecture])
18 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
22 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
26 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
30 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
34 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
38 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
42 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
46 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
50 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
54 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
55 if test $host_cpu = powerpc64; then
56 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
61 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
65 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
69 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
73 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
77 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
81 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
85 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
89 AC_DEFINE([SH], 1, [Define for the SH architecture.])
95 #endif], [], arch=x32, arch=x86_64)
96 if test "$arch" = "x86_64"; then
97 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
99 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
104 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
108 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
112 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
116 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
120 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
125 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
132 AM_CONDITIONAL([I386], [test x$arch = xi386])
133 AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
134 AM_CONDITIONAL([X32], [test x$arch = xx32])
139 gl_WARN_ADD([-Wwrite-strings])
140 AC_ARG_ENABLE([gcc-Werror],
141 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
143 yes) gl_WARN_ADD([-Werror]) ;;
145 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
148 AC_SUBST([WARN_CFLAGS])
158 AC_CHECK_MEMBERS(m4_normalize([
159 struct stat.st_aclcnt,
160 struct stat.st_blksize,
161 struct stat.st_blocks,
162 struct stat.st_flags,
163 struct stat.st_fstype,
165 struct stat.st_level,
176 AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
177 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
178 [#include <sys/types.h>
179 #include <sys/socket.h>
180 #include <netinet/in.h>])
181 AC_CHECK_TYPES([long long])
182 AC_LITTLE_ENDIAN_LONG_LONG
183 AC_OFF_T_IS_LONG_LONG
184 AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
185 AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
187 AC_CHECK_FUNCS(m4_normalize([
201 AC_CHECK_HEADERS(m4_normalize([
227 AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
228 [], [], [#include <stddef.h>
229 #include <sys/socket.h>
230 #include <asm/types.h>])
231 AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
232 AC_CHECK_TYPES([struct sigcontext_struct,
233 struct sigcontext],,, [#include <signal.h>])
234 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
236 AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
238 AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
239 struct T_conn_res.ACCEPTOR_id],,,
240 [#include <sys/stream.h>
241 #include <sys/tihdr.h>])
243 AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
245 AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
246 [#include <sys/ptrace.h>])
248 AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
250 AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
252 AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
253 #ifdef HAVE_ASM_SIGCONTEXT_H
254 # include <asm/sigcontext.h>
257 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
259 AC_CHECK_DECLS([sys_errlist])
260 AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
261 AC_CHECK_DECLS(m4_normalize([
267 PTRACE_EVENT_VFORK_DONE,
274 PTRACE_O_TRACESYSGOOD,
277 ]),,, [#include <sys/ptrace.h>])
279 AC_CHECK_DECLS(m4_normalize([
282 ]),,, [#include <linux/loop.h>])
284 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
285 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
287 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
288 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
289 if test $ac_cv_have_blkgetsize64 = yes; then
290 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
293 AC_CHECK_SIZEOF([long])
294 AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
296 AC_CHECK_HEADERS([libaio.h], [
297 AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
298 AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
301 AC_PATH_PROG([PERL], [perl])
303 AC_CONFIG_FILES([Makefile tests/Makefile])