]> granicus.if.org Git - strace/blobdiff - configure.ac
print_array: enhance printing of unfetchable object addresses
[strace] / configure.ac
index dc49fdc57024ff31073bfc02b670166be2c5da12..231a861b3e3a95037b39658835af4157e84e6f80 100644 (file)
@@ -5,6 +5,7 @@
 # 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>
+# Copyright (c) 2002-2018 The strace developers.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 AC_PREREQ(2.57)
 AC_INIT([strace],
        m4_esyscmd([./git-version-gen .tarball-version]),
-       [strace-devel@lists.sourceforge.net],
+       [strace-devel@lists.strace.io],
        [strace],
        [https://strace.io])
-AC_COPYRIGHT([Copyright (C) 1999-2017 The strace developers.])
+m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year]))
+m4_define([manpage_date], m4_esyscmd([./file-date-gen strace.1.in]))
+AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
 AC_CONFIG_SRCDIR([strace.c])
 AC_CONFIG_AUX_DIR([.])
 AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests])
-AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
+AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13])
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 
-RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')"
+RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')"
 AC_SUBST(RPM_CHANGELOGTIME)
-DEB_CHANGELOGTIME="$(LC_TIME=C date -R)"
+DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)"
 AC_SUBST(DEB_CHANGELOGTIME)
 
 AC_PROG_CC
+AC_PROG_CC_STDC
 AC_PROG_CPP
 st_WARN_CFLAGS
 AX_PROG_CC_FOR_BUILD
@@ -59,14 +62,47 @@ AC_PROG_RANLIB
 AC_USE_SYSTEM_EXTENSIONS
 AX_CODE_COVERAGE
 
+AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.])
+AC_SUBST([COPYRIGHT_YEAR], [copyright_year])
+
+AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
+AC_SUBST([MANPAGE_DATE], [manpage_date])
+
 AC_MSG_CHECKING([for supported architecture])
 arch_m32=
 arch_mx32=
+cc_flags_m32=-m32
+cc_flags_mx32=-mx32
 case "$host_cpu" in
+aarch64*)
+       arch=aarch64
+       arch_m32=arm
+       AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
+       ;;
+alpha*)
+       arch=alpha
+       AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
+       ;;
+arc*)
+       arch=arc
+       AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
+       ;;
+arm*)
+       arch=arm
+       AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
+       ;;
+avr32*)
+       arch=avr32
+       AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
+       ;;
 bfin)
        arch=bfin
        AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
        ;;
+hppa*|parisc*)
+       arch=hppa
+       AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
+       ;;
 i[[3456]]86|pentium)
        arch=i386
        AC_DEFINE([I386], 1, [Define for the i386 architecture.])
@@ -79,26 +115,25 @@ m68k)
        arch=m68k
        AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
        ;;
-sparc64*)
-       arch=sparc64
-       arch_m32=sparc
-       AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
-       ;;
-sparc*)
-       arch=sparc
-       AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
-       ;;
 metag*)
        arch=metag
        AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
        ;;
+microblaze*)
+       arch=microblaze
+       AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
+       ;;
 mips*)
        arch=mips
        AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
        ;;
-alpha*)
-       arch=alpha
-       AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
+nios2*)
+       arch=nios2
+       AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
+       ;;
+or1k*)
+       arch=or1k
+       AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
        ;;
 powerpc*)
        AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
@@ -111,22 +146,9 @@ powerpc*)
                AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
        fi
        ;;
-arm*)
-       arch=arm
-       AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
-       ;;
-aarch64*)
-       arch=aarch64
-       arch_m32=arm
-       AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
-       ;;
-avr32*)
-       arch=avr32
-       AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
-       ;;
-arc*)
-       arch=arc
-       AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
+riscv*)
+       arch=riscv
+       AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
        ;;
 s390)
        arch=s390
@@ -134,12 +156,10 @@ s390)
        ;;
 s390x)
        arch=s390x
+       arch_m32=s390
+       cc_flags_m32=-m31
        AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
        ;;
-hppa*|parisc*)
-       arch=hppa
-       AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
-       ;;
 sh64*)
        arch=sh64
        AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
@@ -148,6 +168,19 @@ sh*)
        arch=sh
        AC_DEFINE([SH], 1, [Define for the SH architecture.])
        ;;
+sparc64*)
+       arch=sparc64
+       arch_m32=sparc
+       AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
+       ;;
+sparc*)
+       arch=sparc
+       AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
+       ;;
+tile*)
+       arch=tile
+       AC_DEFINE([TILE], 1, [Define for the Tile architecture])
+       ;;
 x86?64*)
        arch_m32=i386
        AC_TRY_COMPILE(
@@ -161,42 +194,10 @@ x86?64*)
                AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
        fi
        ;;
-cris|crisv10)
-       arch=crisv10
-       AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
-       ;;
-crisv32)
-       arch=crisv32
-       AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
-       ;;
-tile*)
-       arch=tile
-       AC_DEFINE([TILE], 1, [Define for the Tile architecture])
-       ;;
-microblaze*)
-       arch=microblaze
-       AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
-       ;;
-nios2*)
-       arch=nios2
-       AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
-       ;;
-
-or1k*)
-       arch=or1k
-       AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
-       ;;
-
 xtensa*)
        arch=xtensa
        AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
        ;;
-
-riscv*)
-       arch=riscv
-       AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
-       ;;
-
 *)
        AC_MSG_RESULT([NO!])
        AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
@@ -204,6 +205,8 @@ riscv*)
 esac
 AC_MSG_RESULT($arch)
 
+arch_native=$arch
+
 test -n "$arch_m32" ||
        arch_m32=$arch
 test -n "$arch_mx32" ||
@@ -211,12 +214,15 @@ test -n "$arch_mx32" ||
 AC_SUBST(arch)
 AC_SUBST(arch_m32)
 AC_SUBST(arch_mx32)
+AC_SUBST(cc_flags_m32)
+AC_SUBST(cc_flags_mx32)
+AC_SUBST(arch_native)
 
 MIPS_ABI=
 if test "$arch" = mips; then
        AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
                       [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
-                                      [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
+                                      [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
 
        # requires GCC >= 3.4
        AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
@@ -260,6 +266,7 @@ AC_TYPE_UID_T
 
 AC_CHECK_FUNCS(m4_normalize([
        accept4
+       be64toh
        fallocate
        fanotify_mark
        fopen64
@@ -268,6 +275,7 @@ AC_CHECK_FUNCS(m4_normalize([
        fstatat
        ftruncate
        futimens
+       iconv_open
        if_indextoname
        open64
        prctl
@@ -278,6 +286,7 @@ AC_CHECK_FUNCS(m4_normalize([
        signalfd
        stpcpy
        strerror
+       strndup
        strsignal
        sync_file_range
        utimensat
@@ -294,7 +303,10 @@ AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
 [#include <sys/types.h>
 #include <asm/stat.h>])
 
-AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
+AC_CHECK_TYPES([struct user_desc],
+              [AC_CHECK_MEMBERS([struct user_desc.lm],,,
+                                [#include <asm/ldt.h>])],,
+              [#include <asm/ldt.h>])
 
 AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
 [#include <sys/types.h>
@@ -310,11 +322,29 @@ AC_CHECK_TYPES(m4_normalize([
        struct flock,
        struct flock64,
        struct __kernel_flock,
-       struct __kernel_flock64
+       struct __kernel_flock64,
+       struct f_owner_ex,
+       struct __kernel_f_owner_ex
 ]),,,
 [#include <sys/types.h>
 #include <linux/fcntl.h>])
 
+AC_CHECK_TYPES(m4_normalize([
+       struct crypto_report_aead,
+       struct crypto_report_blkcipher,
+       struct crypto_report_cipher,
+       struct crypto_report_hash,
+       struct crypto_report_rng
+]),,, [#include <linux/cryptouser.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct kcmp_epoll_slot
+]),,, [#include <linux/kcmp.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct keyctl_kdf_params
+]),,, [#include <linux/keyctl.h>])
+
 AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
 
 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
@@ -338,6 +368,7 @@ AC_CHECK_MEMBERS(m4_normalize([
        struct perf_event_attr.use_clockid,
        struct perf_event_attr.context_switch,
        struct perf_event_attr.write_backward,
+       struct perf_event_attr.namespaces,
        struct perf_event_attr.bp_type,
        struct perf_event_attr.config1,
        struct perf_event_attr.config2,
@@ -351,21 +382,40 @@ AC_CHECK_MEMBERS(m4_normalize([
 
 AC_CHECK_HEADERS(m4_normalize([
        asm/cachectl.h
+       asm/guarded_storage.h
        asm/sysmips.h
-       bluetooth/bluetooth.h
        elf.h
+       iconv.h
        inttypes.h
        linux/bsg.h
+       linux/cryptouser.h
        linux/dm-ioctl.h
        linux/dqblk_xfs.h
        linux/falloc.h
+       linux/fib_rules.h
        linux/fiemap.h
-       linux/filter.h
+       linux/genetlink.h
        linux/hiddev.h
+       linux/if_addr.h
+       linux/if_link.h
        linux/ip_vs.h
        linux/ipc.h
+       linux/kcmp.h
+       linux/kvm.h
+       linux/memfd.h
        linux/mmtimer.h
        linux/msg.h
+       linux/neighbour.h
+       linux/netfilter/ipset/ip_set.h
+       linux/netfilter/nf_tables.h
+       linux/netfilter/nf_tables_compat.h
+       linux/netfilter/nfnetlink.h
+       linux/netfilter/nfnetlink_acct.h
+       linux/netfilter/nfnetlink_conntrack.h
+       linux/netfilter/nfnetlink_cthelper.h
+       linux/netfilter/nfnetlink_cttimeout.h
+       linux/netfilter/nfnetlink_log.h
+       linux/netfilter/nfnetlink_queue.h
        linux/nsfs.h
        linux/perf_event.h
        linux/quota.h
@@ -378,6 +428,7 @@ AC_CHECK_HEADERS(m4_normalize([
        mqueue.h
        netinet/sctp.h
        netipx/ipx.h
+       paths.h
        scsi/sg.h
        stropts.h
        sys/conf.h
@@ -386,7 +437,6 @@ AC_CHECK_HEADERS(m4_normalize([
        sys/ipc.h
        sys/msg.h
        sys/quota.h
-       sys/reg.h
        sys/sem.h
        sys/shm.h
        sys/signalfd.h
@@ -400,6 +450,9 @@ 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/netfilter/xt_osf.h],,, [#include <linux/ip.h>
+#include <linux/tcp.h>])
+
 AC_CHECK_HEADERS(m4_normalize([
        linux/netfilter_arp/arp_tables.h
        linux/netfilter_bridge/ebtables.h
@@ -413,77 +466,110 @@ AC_CHECK_HEADERS([linux/input.h], [
 ])
 
 AC_CHECK_HEADERS([linux/bpf.h], [
-       AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works],
-                      [st_cv_have_union_bpf_attr_log_buf],
-               [AC_COMPILE_IFELSE(
-                       [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
-                                        [[union bpf_attr a = { .log_buf = 0 };]])],
-                       [st_cv_have_union_bpf_attr_log_buf=yes],
-                       [st_cv_have_union_bpf_attr_log_buf=no])])
-       if test $st_cv_have_union_bpf_attr_log_buf = yes; then
-               AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1],
-                         [Define to 1 if union bpf_attr.log_buf initialization works])
-       fi
-       AC_CACHE_CHECK([whether union bpf_attr.bpf_fd initialization works],
-                      [st_cv_have_union_bpf_attr_bpf_fd],
-               [AC_COMPILE_IFELSE(
-                       [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
-                                        [[union bpf_attr a = { .bpf_fd = 0 };]])],
-                       [st_cv_have_union_bpf_attr_bpf_fd=yes],
-                       [st_cv_have_union_bpf_attr_bpf_fd=no])])
-       if test $st_cv_have_union_bpf_attr_bpf_fd = yes; then
-               AC_DEFINE(HAVE_UNION_BPF_ATTR_BPF_FD, [1],
-                         [Define to 1 if union bpf_attr.bpf_fd initialization works])
-       fi
-       AC_CACHE_CHECK([whether union bpf_attr.attach_flags initialization works],
-                      [st_cv_have_union_bpf_attr_attach_flags],
-               [AC_COMPILE_IFELSE(
-                       [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
-                                        [[union bpf_attr a = { .attach_flags = 0 };]])],
-                       [st_cv_have_union_bpf_attr_attach_flags=yes],
-                       [st_cv_have_union_bpf_attr_attach_flags=no])])
-       if test $st_cv_have_union_bpf_attr_attach_flags = yes; then
-               AC_DEFINE(HAVE_UNION_BPF_ATTR_ATTACH_FLAGS, [1],
-                         [Define to 1 if union bpf_attr.attach_flags initialization works])
-       fi
+       AC_CHECK_TYPES([struct bpf_insn],,, [#include <linux/bpf.h>])
+       st_BPF_ATTR
 ])
 
+AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
+       AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
+                        [#include <bluetooth/bluetooth.h>
+                        #include <bluetooth/l2cap.h>])
+])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct br_mdb_entry,
+       struct br_port_msg
+]),,, [#include <linux/if_bridge.h>])
+AC_CHECK_MEMBERS(m4_normalize([
+       struct br_mdb_entry.flags,
+       struct br_mdb_entry.vid
+]),,, [#include <linux/if_bridge.h>])
+
+AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
+AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
+AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct rta_mfc_stats,
+       struct rtvia
+]),,, [#include <linux/rtnetlink.h>])
+
+AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
+AC_CHECK_TYPES(m4_normalize([
+       struct ndt_config,
+       struct ndt_stats
+]),,, [#include <linux/neighbour.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct ifla_bridge_id,
+       struct ifla_port_vsi,
+       struct rtnl_link_stats64
+]),,, [#include <linux/if_link.h>])
+AC_CHECK_MEMBERS(m4_normalize([
+       struct rtnl_link_stats.rx_nohandler,
+       struct rtnl_link_stats64.rx_nohandler
+]),,, [#include <linux/if_link.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct gnet_stats_basic,
+       struct gnet_stats_queue,
+       struct gnet_stats_rate_est,
+       struct gnet_stats_rate_est64
+]),,, [#include <linux/gen_stats.h>])
+
+AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/pkt_sched.h>])
+
+AC_CHECK_TYPES([struct fib_rule_uid_range],,, [#include <linux/fib_rules.h>])
+
 AC_CHECK_TYPES([struct statfs], [
-       AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include <linux/types.h>
-#include <asm/statfs.h>])
-       AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include <linux/types.h>
-#include <asm/statfs.h>])
-       AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include <linux/types.h>
-#include <asm/statfs.h>])
-       AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include <linux/types.h>
+       AC_CHECK_MEMBERS(m4_normalize([
+               struct statfs.f_frsize,
+               struct statfs.f_flags,
+               struct statfs.f_fsid.val,
+               struct statfs.f_fsid.__val
+       ]),,, [#include <linux/types.h>
 #include <asm/statfs.h>])
 ],, [#include <linux/types.h>
 #include <asm/statfs.h>])
 
 AC_CHECK_TYPES([struct statfs64], [
-       AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include <linux/types.h>
-#include <asm/statfs.h>])
-       AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include <linux/types.h>
-#include <asm/statfs.h>])
-       AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include <linux/types.h>
-#include <asm/statfs.h>])
-       AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include <linux/types.h>
+       AC_CHECK_MEMBERS(m4_normalize([
+               struct statfs64.f_frsize,
+               struct statfs64.f_flags,
+               struct statfs64.f_fsid.val,
+               struct statfs64.f_fsid.__val
+       ]),,, [#include <linux/types.h>
 #include <asm/statfs.h>])
 ],, [#include <linux/types.h>
 #include <asm/statfs.h>])
 
 AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
 
+AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
+
+AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct ptp_sys_offset
+]),,, [#include <linux/ptp_clock.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+       struct kvm_regs,
+       struct kvm_sregs,
+       struct kvm_userspace_memory_region
+]),,, [#include <linux/kvm.h>])
+
 AC_CHECK_HEADERS([linux/btrfs.h], [
        AC_CHECK_MEMBERS(m4_normalize([
                struct btrfs_ioctl_feature_flags.compat_flags,
                struct btrfs_ioctl_fs_info_args.nodesize,
                struct btrfs_ioctl_defrag_range_args.start,
-               struct btrfs_ioctl_search_args_v2.buf_size
+               struct btrfs_ioctl_search_args_v2.buf_size,
+               struct btrfs_ioctl_logical_ino_args.flags
                ]),,, [ #include <stdio.h>
 #include <linux/btrfs.h>])
-        AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
-                               BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
+       AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
+                               BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
 #include <linux/btrfs.h>])])
 
 AC_CHECK_DECLS([sys_errlist])
@@ -609,6 +695,8 @@ AC_CHECK_DECLS(m4_normalize([
        V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
        V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
        V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
+       V4L2_BUF_TYPE_SDR_CAPTURE,
+       V4L2_BUF_TYPE_SDR_OUTPUT,
        V4L2_TUNER_RADIO,
        V4L2_TUNER_ANALOG_TV,
        V4L2_TUNER_DIGITAL_TV,
@@ -648,6 +736,14 @@ AC_CHECK_DECLS(m4_normalize([
 #include <linux/types.h>
 #include <linux/videodev2.h>])
 
+AC_CHECK_MEMBERS(m4_normalize([
+       struct v4l2_window.global_alpha,
+       struct v4l2_sdr_format.buffersize
+]),,, [#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>])
+
 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 #include <stdlib.h>
@@ -658,16 +754,21 @@ AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
        fi)
 
 AC_CHECK_SIZEOF([long])
+SIZEOF_LONG="$ac_cv_sizeof_long"
+AC_SUBST(SIZEOF_LONG)
 AC_CHECK_SIZEOF([long long])
 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
 AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
+SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
+AC_SUBST(SIZEOF_KERNEL_LONG_T)
 AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
 
+
 AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
               [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
                        $CPP $CPPFLAGS -P -imacros asm/signal.h - |
                        grep '^[0-9]')"
-                test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
+                test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
 if test "x$st_cv_SIGRTMIN" != xno; then
        AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
                           [SIGRTMIN defined in <asm/signal.h>])
@@ -676,7 +777,7 @@ AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
               [st_cv_SA_RESTORER="$(echo SA_RESTORER |
                        $CPP $CPPFLAGS -P -imacros asm/signal.h - |
                        grep ^0x)"
-               test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
+               test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
 if test "x$st_cv_SA_RESTORER" != xno; then
        AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
                           [SA_RESTORER defined in <asm/signal.h>])
@@ -691,113 +792,109 @@ if test "x$st_cv_have___builtin_popcount" = xyes; then
                  [Define to 1 if the system provides __builtin_popcount function])
 fi
 
+AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
+              [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
+                                               [[return !*program_invocation_name]])],
+                              [st_cv_have_program_invocation_name=yes],
+                              [st_cv_have_program_invocation_name=no])])
+if test "x$st_cv_have_program_invocation_name" = xyes; then
+       AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
+                 [Define to 1 if the system provides program_invocation_name variable])
+fi
+
+AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert],
+              [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]],
+                                               [[static_assert(1,"")]]
+                                              )
+                              ],
+                              [st_cv_have_static_assert=yes],
+                              [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+                                                               [[_Static_assert(1,"")]]
+                                                              )
+                                              ],
+                                              [st_cv_have_static_assert=_Static_assert],
+                                              [st_cv_have_static_assert=no]
+                                             )
+                              ]
+                             )
+              ]
+             )
+case "x$st_cv_have_static_assert" in
+       xyes)
+               AC_DEFINE([HAVE_STATIC_ASSERT], [1],
+                         [Define to 1 if the system provides static_assert])
+               ;;
+       x_Static_assert)
+               AC_DEFINE([HAVE__STATIC_ASSERT], [1],
+                         [Define to 1 if the system provides _Static_assert])
+               ;;
+esac
+
 AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
 if test "x$ac_cv_lib_dl_dladdr" = xyes; then
        AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
 fi
 AC_SUBST(dl_LIBS)
 
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([timer_create], [rt])
+LIBS="$saved_LIBS"
+case "$ac_cv_search_timer_create" in
+       no) AC_MSG_FAILURE([failed to find timer_create]) ;;
+       -l*) timer_LIBS="$ac_cv_search_timer_create" ;;
+       *) timer_LIBS= ;;
+esac
+AC_SUBST(timer_LIBS)
+
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([clock_gettime], [rt])
+LIBS="$saved_LIBS"
+case "$ac_cv_search_clock_gettime" in
+       no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
+       -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
+       *) clock_LIBS= ;;
+esac
+AC_SUBST(clock_LIBS)
+
+saved_LIBS="$LIBS"
+AC_SEARCH_LIBS([mq_open], [rt])
+LIBS="$saved_LIBS"
+case "$ac_cv_search_mq_open" in
+       -l*) mq_LIBS="$ac_cv_search_mq_open" ;;
+       *) mq_LIBS= ;;
+esac
+AC_SUBST(mq_LIBS)
+
 AC_PATH_PROG([PERL], [perl])
 
-dnl stack trace with libunwind
-libunwind_CPPFLAGS=
-libunwind_LDFLAGS=
-libunwind_LIBS=
-AC_ARG_WITH([libunwind],
-            [AS_HELP_STRING([--with-libunwind],
-                            [use libunwind to implement stack tracing support])],
-            [case "${withval}" in
-             yes|no|check) ;;
-             *) with_libunwind=yes
-                libunwind_CPPFLAGS="-I${withval}/include"
-                libunwind_LDFLAGS="-L${withval}/lib" ;;
-             esac],
-            [with_libunwind=check]
-)
-
-use_libunwind=no
-AS_IF([test "x$with_libunwind" != xno],
-      [saved_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
-
-       AC_CHECK_HEADERS([libunwind-ptrace.h],
-         [saved_LDFLAGS="$LDFLAGS"
-          LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
-
-          AC_CHECK_LIB([unwind], [backtrace],
-            [libunwind_LIBS="-lunwind $libunwind_LIBS"
-
-             AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
-             saved_LIBS="$LIBS"
-             LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
-
-             AC_LINK_IFELSE(
-               [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
-                                [[return !unw_create_addr_space(0, 0)]])
-               ],
-               [AC_MSG_RESULT([yes])
-                libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
-
-                AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
-                  [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
-                   use_libunwind=yes
-                  ],
-                  [if test "x$with_libunwind" != xcheck; then
-                     AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
-                   fi
-                  ],
-                  [$libunwind_LIBS]
-                )
-               ],
-               [AC_MSG_RESULT([no])
-                if test "x$with_libunwind" != xcheck; then
-                  AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
-                fi
-               ]
-             )
-
-             LIBS="$saved_LIBS"
-            ],
-            [if test "x$with_libunwind" != xcheck; then
-               AC_MSG_FAILURE([failed to find libunwind])
-             fi
-            ],
-            [$libunwind_LIBS]
-          )
-
-          LDFLAGS="$saved_LDFLAGS"
-         ],
-         [if test "x$with_libunwind" != xcheck; then
-            AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
-          fi
-         ]
-       )
-
-       CPPFLAGS="$saved_CPPFLAGS"
-      ]
-)
-
-dnl enable libunwind
-AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
-if test "x$use_libunwind" = xyes; then
-       AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
-       AC_SUBST(libunwind_LIBS)
-       AC_SUBST(libunwind_LDFLAGS)
-       AC_SUBST(libunwind_CPPFLAGS)
-fi
-AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
-AC_MSG_RESULT([$use_libunwind])
+AC_CHECK_TOOL([READELF], [readelf])
+
+st_STACKTRACE
 
 if test "$arch" = mips && test "$no_create" != yes; then
        mkdir -p linux/mips
        if $srcdir/linux/mips/genstub.sh linux/mips; then
                AC_MSG_RESULT([Generated MIPS syscallent stubs])
        else
-               AC_MSG_FAILURE([Failed to generate syscallent stubs])
+               AC_MSG_ERROR([Failed to generate syscallent stubs])
        fi
 fi
 
-st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
+AC_ARG_ENABLE([mpers],
+       [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
+               [whether to enable multiple personalities support required
+                for proper decoding of structures used by tracees with
+                personalities that differ from the personality of strace,
+                default is yes.])],
+       [case "$enableval" in
+               yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
+               *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
+                                Valid options are: yes, no, check, m32, mx32.])
+               ;;
+        esac],
+       [enable_mpers=yes])
+
+st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
 st_MPERS([mx32], [x86_64])
 
 AX_VALGRIND_DFLT([sgcheck], [off])
@@ -807,6 +904,8 @@ AC_CONFIG_FILES([Makefile
                 tests/Makefile
                 tests-m32/Makefile
                 tests-mx32/Makefile
+                strace.1
+                strace-log-merge.1
                 strace.spec
                 debian/changelog])
 AC_OUTPUT