-dnl Process this file with autoconf to create configure. Use autoreconf.
+# Configure template for strace.
+#
+# Copyright (c) 1999-2001 Wichert Akkerman <wichert@deephackmode.org>
+# Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
+# Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
+# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
AC_PREREQ(2.57)
AC_INIT([strace],
m4_esyscmd([./git-version-gen .tarball-version]),
AC_CANONICAL_HOST
AC_PROG_CC
+AC_PROG_CPP
AX_PROG_CC_FOR_BUILD
-AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_INSTALL
AC_PROG_RANLIB
+AC_USE_SYSTEM_EXTENSIONS
+AX_CODE_COVERAGE
+
AC_MSG_CHECKING([for supported architecture])
+arch_m32=
+arch_mx32=
case "$host_cpu" in
bfin)
arch=bfin
;;
sparc64*)
arch=sparc64
+ arch_m32=sparc
AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
;;
sparc*)
# error 32 bit
#endif], [], arch=powerpc64, arch=powerpc)
if test "$arch" = "powerpc64"; then
+ arch_m32=powerpc
AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
fi
;;
;;
aarch64*)
arch=aarch64
+ arch_m32=arm
AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
;;
avr32*)
AC_DEFINE([SH], 1, [Define for the SH architecture.])
;;
x86?64*)
+ arch_m32=i386
AC_TRY_COMPILE(
[#ifndef __ILP32__
# error not x32
#endif], [], arch=x32, arch=x86_64)
if test "$arch" = "x86_64"; then
+ arch_mx32=x32
AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
else
AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
esac
AC_MSG_RESULT($arch)
+test -n "$arch_m32" ||
+ arch_m32=$arch
+test -n "$arch_mx32" ||
+ arch_mx32=$arch
AC_SUBST(arch)
+AC_SUBST(arch_m32)
+AC_SUBST(arch_mx32)
if test "$arch" = mips; then
AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
)
AC_SUBST([WARN_CFLAGS])
-AC_PROG_CPP
-AC_PROG_INSTALL
-AC_C_CONST
AC_C_BIGENDIAN
-AC_HEADER_STDC
-AC_HEADER_STDBOOL
-AC_HEADER_DIRENT
-AC_HEADER_STAT
-AC_CHECK_MEMBERS(m4_normalize([
- struct stat.st_atim.tv_nsec,
- struct stat.st_blksize,
- struct stat.st_blocks,
- struct stat.st_ctim.tv_nsec,
- struct stat.st_flags,
- struct stat.st_fstype,
- struct stat.st_gen,
- struct stat.st_mtim.tv_nsec,
- struct stat.st_rdev
-]))
+AC_C_CONST
+AC_C_TYPEOF
+AC_TYPE_GETGROUPS
+AC_TYPE_MODE_T
AC_TYPE_SIGNAL
AC_TYPE_UID_T
-AC_TYPE_MODE_T
-AC_TYPE_GETGROUPS
+
+AC_HEADER_DIRENT
AC_HEADER_MAJOR
-AC_CHECK_TYPES([sig_atomic_t],,, [#include <signal.h>])
-AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
-[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>])
-AC_LITTLE_ENDIAN_LONG_LONG
+AC_HEADER_STAT
+AC_HEADER_STDBOOL
+AC_HEADER_STDC
AC_CHECK_FUNCS(m4_normalize([
fanotify_mark
fopen64
fork
fputs_unlocked
+ fstatat
+ ftruncate
+ futimens
if_indextoname
inet_ntop
inet_pton
preadv
process_vm_readv
pwritev
- sendmsg
+ recvmmsg
sendmmsg
sigaction
signalfd
stpcpy
strerror
strsignal
+ utimensat
]))
+
+AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
+
+AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
+
+AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
+[#include <asm/posix_types.h>])
+
+AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
+[#include <sys/types.h>
+#include <asm/stat.h>])
+
+AC_CHECK_TYPES([struct statfs64],,, [#include <sys/vfs.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+ struct pt_all_user_regs,
+ struct ia64_fpreg,
+ struct ptrace_peeksiginfo_args
+]),,, [#include <sys/ptrace.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+ struct flock,
+ struct flock64,
+ struct __kernel_flock,
+ struct __kernel_flock64
+]),,,
+[#include <sys/types.h>
+#include <linux/fcntl.h>])
+
+AC_CHECK_MEMBERS(m4_normalize([
+ struct stat.st_atim.tv_nsec,
+ struct stat.st_blksize,
+ struct stat.st_blocks,
+ struct stat.st_ctim.tv_nsec,
+ struct stat.st_flags,
+ struct stat.st_fstype,
+ struct stat.st_gen,
+ struct stat.st_mtim.tv_nsec,
+ struct stat.st_rdev
+]))
+
+AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
+
+AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
+
+AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
+
+AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
+[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>])
+
+AC_CHECK_MEMBERS(m4_normalize([
+ struct stat.st_atime_nsec,
+ struct stat.st_ctime_nsec,
+ struct stat.st_mtime_nsec
+]),,, [#include <sys/types.h>
+#include <asm/stat.h>])
+
+AC_CHECK_MEMBERS(m4_normalize([
+ siginfo_t.si_syscall,
+ siginfo_t.si_timerid,
+ siginfo_t.si_overrun
+]),,, [#include <signal.h>])
+
AC_CHECK_HEADERS(m4_normalize([
asm/cachectl.h
asm/sysmips.h
linux/filter.h
linux/hiddev.h
linux/ip_vs.h
+ linux/ipc.h
linux/mmtimer.h
+ linux/msg.h
linux/perf_event.h
linux/seccomp.h
linux/securebits.h
+ linux/sem.h
+ linux/shm.h
linux/utsname.h
mqueue.h
netinet/sctp.h
sys/eventfd.h
sys/fanotify.h
sys/ioctl.h
+ sys/ipc.h
+ sys/msg.h
sys/reg.h
+ sys/sem.h
+ sys/shm.h
sys/signalfd.h
sys/vfs.h
sys/xattr.h
]))
-AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
- [], [], [#include <stddef.h>
+
+AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
+
+AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
+
+AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
+
+AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],,,
+[#include <stddef.h>
#include <sys/socket.h>
#include <asm/types.h>])
-AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
-AC_CHECK_TYPES([struct sigcontext],,, [#include <signal.h>])
-AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
+
AC_CHECK_HEADERS(m4_normalize([
linux/netfilter_arp/arp_tables.h
linux/netfilter_bridge/ebtables.h
linux/netfilter_ipv4/ip_tables.h
linux/netfilter_ipv6/ip6_tables.h
-]), [], [], [#include <netinet/in.h>
+]),,, [#include <netinet/in.h>
#include <net/if.h>])
-AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
-AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
-
-AC_CHECK_MEMBERS(m4_normalize([
- struct stat.st_atime_nsec,
- struct stat.st_ctime_nsec,
- struct stat.st_mtime_nsec
-]),,, [#include <sys/types.h>
-#include <asm/stat.h>])
-
-AC_CHECK_TYPES([struct stat64],,, [#include <sys/types.h>
-#include <asm/stat.h>])
-AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
-AC_CHECK_TYPES([struct statfs64],,, [#include <sys/vfs.h>])
-
-AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,,
- [#include <sys/ptrace.h>])
-
-AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
-
-AC_CHECK_MEMBERS([struct sigevent._sigev_un._pad,
- struct sigevent.__pad,
- siginfo_t.si_syscall,
- siginfo_t.si_timerid,
- siginfo_t.si_overrun],,, [#include <signal.h>])
-
-AC_CHECK_TYPES([struct flock64],,, [#include <fcntl.h>])
-
AC_CHECK_HEADERS([linux/input.h], [
AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
])