1 dnl Process this file with autoconf to create configure. Use autoreconf.
4 m4_esyscmd([./git-version-gen .tarball-version]),
5 [strace-devel@lists.sourceforge.net])
6 AC_CONFIG_SRCDIR([strace.c])
8 AC_CONFIG_HEADERS([config.h])
9 AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip silent-rules parallel-tests])
14 AC_USE_SYSTEM_EXTENSIONS
16 AC_MSG_CHECKING([for supported architecture])
20 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
24 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
28 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
32 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
36 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
40 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
44 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
48 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
52 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
56 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
60 #endif], [], ppc_bits=64, ppc_bits=32)
61 if test "$ppc_bits" = "64"; then
62 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
67 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
71 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
75 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
79 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
83 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
87 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
91 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
95 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
99 AC_DEFINE([SH], 1, [Define for the SH architecture.])
105 #endif], [], arch=x32, arch=x86_64)
106 if test "$arch" = "x86_64"; then
107 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
109 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
114 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
118 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
122 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
126 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
130 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
135 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
140 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
147 AM_CONDITIONAL([I386], [test x$arch = xi386])
148 AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
149 AM_CONDITIONAL([X32], [test x$arch = xx32])
153 AC_ARG_ENABLE([arm-oabi],
154 [AS_HELP_STRING([--enable-arm-oabi],
155 [enable OABI support on ARM EABI])],
156 [], [enable_arm_oabi=no])
157 case "$enable_arm_oabi" in
158 yes) enable_arm_oabi=1 ;;
159 no) enable_arm_oabi=0 ;;
160 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
162 AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
163 [Define to 1 if you want OABI support on ARM EABI.])
166 gl_WARN_ADD([-Wwrite-strings])
167 AC_ARG_ENABLE([gcc-Werror],
168 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
170 yes) gl_WARN_ADD([-Werror]) ;;
172 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
175 AC_SUBST([WARN_CFLAGS])
185 AC_CHECK_MEMBERS(m4_normalize([
186 struct stat.st_aclcnt,
187 struct stat.st_blksize,
188 struct stat.st_blocks,
189 struct stat.st_flags,
190 struct stat.st_fstype,
192 struct stat.st_level,
203 AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
204 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
205 [#include <sys/types.h>
206 #include <sys/socket.h>
207 #include <netinet/in.h>])
208 AC_LITTLE_ENDIAN_LONG_LONG
210 AC_CHECK_FUNCS(m4_normalize([
224 AC_CHECK_HEADERS(m4_normalize([
251 AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
252 [], [], [#include <stddef.h>
253 #include <sys/socket.h>
254 #include <asm/types.h>])
255 AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
256 AC_CHECK_TYPES([struct sigcontext],,, [#include <signal.h>])
257 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
259 AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
261 AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
263 AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,,
264 [#include <sys/ptrace.h>])
266 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
268 AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
269 struct sigevent.__pad,
270 siginfo_t.si_syscall],,, [#include <signal.h>])
272 AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
274 AC_CHECK_DECLS([sys_errlist])
275 AC_CHECK_DECLS(m4_normalize([
281 PTRACE_EVENT_VFORK_DONE,
288 PTRACE_O_TRACESYSGOOD,
293 ]),,, [#include <sys/ptrace.h>])
295 AC_CHECK_DECLS(m4_normalize([
298 ]),,, [#include <linux/loop.h>])
300 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
301 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
303 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
304 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
305 if test $ac_cv_have_blkgetsize64 = yes; then
306 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
309 AC_CHECK_SIZEOF([long])
310 AC_CHECK_SIZEOF([long long])
311 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
312 AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
314 AC_CACHE_CHECK([for SA_RESTORER], [st_cv_sa_restorer],
315 [st_cv_sa_restorer="$(echo SA_RESTORER |
316 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
318 test -n "$st_cv_sa_restorer" || st_cv_sa_restorer=no])
319 if test "x$st_cv_sa_restorer" != xno; then
320 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_sa_restorer],
321 [SA_RESTORER defined in <asm/signal.h>])
324 AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
325 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
326 [st_cv_have___builtin_popcount=yes],
327 [st_cv_have___builtin_popcount=no])])
328 if test "x$st_cv_have___builtin_popcount" = xyes; then
329 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
330 [Define to 1 if the system provides __builtin_popcount function])
333 AC_PATH_PROG([PERL], [perl])
335 AC_CONFIG_FILES([Makefile tests/Makefile])