1 # Configure template for strace.
3 # Copyright (c) 1999-2001 Wichert Akkerman <wichert@deephackmode.org>
4 # Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
5 # Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
6 # Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
7 # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
8 # Copyright (c) 2002-2018 The strace developers.
11 # Redistribution and use in source and binary forms, with or without
12 # modification, are permitted provided that the following conditions
14 # 1. Redistributions of source code must retain the above copyright
15 # notice, this list of conditions and the following disclaimer.
16 # 2. Redistributions in binary form must reproduce the above copyright
17 # notice, this list of conditions and the following disclaimer in the
18 # documentation and/or other materials provided with the distribution.
19 # 3. The name of the author may not be used to endorse or promote products
20 # derived from this software without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 m4_esyscmd([./git-version-gen .tarball-version]),
36 [strace-devel@lists.strace.io],
39 m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year]))
40 m4_define([manpage_date], m4_esyscmd([./file-date-gen strace.1.in]))
41 AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
42 AC_CONFIG_SRCDIR([strace.c])
43 AC_CONFIG_AUX_DIR([.])
44 AC_CONFIG_HEADERS([config.h])
45 AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13])
49 RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')"
50 AC_SUBST(RPM_CHANGELOGTIME)
51 DEB_CHANGELOGTIME="$(LC_TIME=C date -R)"
52 AC_SUBST(DEB_CHANGELOGTIME)
62 AC_USE_SYSTEM_EXTENSIONS
65 AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.])
66 AC_SUBST([COPYRIGHT_YEAR], [copyright_year])
68 AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
69 AC_SUBST([MANPAGE_DATE], [manpage_date])
71 AC_MSG_CHECKING([for supported architecture])
80 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
84 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
88 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
92 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
96 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
100 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
104 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
108 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
112 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
116 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
120 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
124 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
128 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
132 AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
136 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
139 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
143 #endif], [], arch=powerpc64, arch=powerpc)
144 if test "$arch" = "powerpc64"; then
146 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
151 AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
155 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
161 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
165 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
169 AC_DEFINE([SH], 1, [Define for the SH architecture.])
174 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
178 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
182 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
189 #endif], [], arch=x32, arch=x86_64)
190 if test "$arch" = "x86_64"; then
192 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
194 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
199 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
203 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
210 test -n "$arch_m32" ||
212 test -n "$arch_mx32" ||
217 AC_SUBST(cc_flags_m32)
218 AC_SUBST(cc_flags_mx32)
219 AC_SUBST(arch_native)
222 if test "$arch" = mips; then
223 AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
224 [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
225 [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
227 # requires GCC >= 3.4
228 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
230 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])],
231 [st_cv_mips_abi=o32],
233 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])],
234 [st_cv_mips_abi=n32],
236 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])],
237 [st_cv_mips_abi=n64],
238 [st_cv_mips_abi=unknown])])])])
240 case "$st_cv_mips_abi" in
241 o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);;
242 n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);;
243 n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);;
244 *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
246 MIPS_ABI="$st_cv_mips_abi"
250 AC_ARG_ENABLE([arm-oabi],
251 [AS_HELP_STRING([--enable-arm-oabi],
252 [enable OABI support on ARM EABI])],
253 [], [enable_arm_oabi=no])
254 case "$enable_arm_oabi" in
255 yes) enable_arm_oabi=1 ;;
256 no) enable_arm_oabi=0 ;;
257 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
259 AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
260 [Define to 1 if you want OABI support on ARM EABI.])
267 AC_CHECK_FUNCS(m4_normalize([
295 AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
297 AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
299 AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
300 [#include <asm/posix_types.h>])
302 AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
303 [#include <sys/types.h>
304 #include <asm/stat.h>])
306 AC_CHECK_TYPES([struct user_desc],
307 [AC_CHECK_MEMBERS([struct user_desc.lm],,,
308 [#include <asm/ldt.h>])],,
309 [#include <asm/ldt.h>])
311 AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
312 [#include <sys/types.h>
313 #include <asm/stat.h>])
315 AC_CHECK_TYPES(m4_normalize([
316 struct pt_all_user_regs,
318 struct ptrace_peeksiginfo_args
319 ]),,, [#include <sys/ptrace.h>])
321 AC_CHECK_TYPES(m4_normalize([
324 struct __kernel_flock,
325 struct __kernel_flock64
327 [#include <sys/types.h>
328 #include <linux/fcntl.h>])
330 AC_CHECK_TYPES(m4_normalize([
331 struct crypto_report_aead,
332 struct crypto_report_blkcipher,
333 struct crypto_report_cipher,
334 struct crypto_report_hash,
335 struct crypto_report_rng
336 ]),,, [#include <linux/cryptouser.h>])
338 AC_CHECK_TYPES(m4_normalize([
339 struct kcmp_epoll_slot
340 ]),,, [#include <linux/kcmp.h>])
342 AC_CHECK_TYPES(m4_normalize([
343 struct keyctl_kdf_params
344 ]),,, [#include <linux/keyctl.h>])
346 AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
348 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
350 AC_CHECK_MEMBERS(m4_normalize([
351 siginfo_t.si_syscall,
352 siginfo_t.si_timerid,
354 ]),,, [#include <signal.h>])
356 AC_CHECK_MEMBERS(m4_normalize([
357 struct perf_event_attr.precise_ip,
358 struct perf_event_attr.mmap_data,
359 struct perf_event_attr.sample_id_all,
360 struct perf_event_attr.exclude_host,
361 struct perf_event_attr.exclude_guest,
362 struct perf_event_attr.exclude_callchain_kernel,
363 struct perf_event_attr.exclude_callchain_user,
364 struct perf_event_attr.mmap2,
365 struct perf_event_attr.comm_exec,
366 struct perf_event_attr.use_clockid,
367 struct perf_event_attr.context_switch,
368 struct perf_event_attr.write_backward,
369 struct perf_event_attr.namespaces,
370 struct perf_event_attr.bp_type,
371 struct perf_event_attr.config1,
372 struct perf_event_attr.config2,
373 struct perf_event_attr.branch_sample_type,
374 struct perf_event_attr.sample_regs_user,
375 struct perf_event_attr.sample_stack_user,
376 struct perf_event_attr.sample_regs_intr,
377 struct perf_event_attr.aux_watermark,
378 struct perf_event_attr.sample_max_stack
379 ]),,, [#include <linux/perf_event.h>])
381 AC_CHECK_HEADERS(m4_normalize([
383 asm/guarded_storage.h
385 bluetooth/bluetooth.h
408 linux/netfilter/ipset/ip_set.h
409 linux/netfilter/nf_tables.h
410 linux/netfilter/nf_tables_compat.h
411 linux/netfilter/nfnetlink.h
412 linux/netfilter/nfnetlink_acct.h
413 linux/netfilter/nfnetlink_conntrack.h
414 linux/netfilter/nfnetlink_cthelper.h
415 linux/netfilter/nfnetlink_cttimeout.h
416 linux/netfilter/nfnetlink_log.h
417 linux/netfilter/nfnetlink_queue.h
446 AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
448 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
450 AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
452 AC_CHECK_HEADERS([linux/netfilter/xt_osf.h],,, [#include <linux/ip.h>
453 #include <linux/tcp.h>])
455 AC_CHECK_HEADERS(m4_normalize([
456 linux/netfilter_arp/arp_tables.h
457 linux/netfilter_bridge/ebtables.h
458 linux/netfilter_ipv4/ip_tables.h
459 linux/netfilter_ipv6/ip6_tables.h
460 ]),,, [#include <netinet/in.h>
461 #include <net/if.h>])
463 AC_CHECK_HEADERS([linux/input.h], [
464 AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
467 AC_CHECK_HEADERS([linux/bpf.h], [
468 AC_CHECK_MEMBERS(m4_normalize([
469 union bpf_attr.attach_flags,
470 union bpf_attr.bpf_fd,
471 union bpf_attr.flags,
472 union bpf_attr.info.info,
473 union bpf_attr.next_id,
474 union bpf_attr.numa_node,
475 union bpf_attr.prog_flags,
476 union bpf_attr.test.duration
477 ]),,, [#include <linux/bpf.h>])
480 AC_CHECK_TYPES(m4_normalize([
483 ]),,, [#include <linux/if_bridge.h>])
484 AC_CHECK_MEMBERS(m4_normalize([
485 struct br_mdb_entry.flags,
486 struct br_mdb_entry.vid
487 ]),,, [#include <linux/if_bridge.h>])
489 AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
490 AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
491 AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
493 AC_CHECK_TYPES(m4_normalize([
494 struct rta_mfc_stats,
496 ]),,, [#include <linux/rtnetlink.h>])
498 AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
499 AC_CHECK_TYPES(m4_normalize([
502 ]),,, [#include <linux/neighbour.h>])
504 AC_CHECK_TYPES(m4_normalize([
505 struct ifla_bridge_id,
506 struct ifla_port_vsi,
507 struct rtnl_link_stats64
508 ]),,, [#include <linux/if_link.h>])
509 AC_CHECK_MEMBERS(m4_normalize([
510 struct rtnl_link_stats.rx_nohandler,
511 struct rtnl_link_stats64.rx_nohandler
512 ]),,, [#include <linux/if_link.h>])
514 AC_CHECK_TYPES(m4_normalize([
515 struct gnet_stats_basic,
516 struct gnet_stats_queue,
517 struct gnet_stats_rate_est,
518 struct gnet_stats_rate_est64
519 ]),,, [#include <linux/gen_stats.h>])
521 AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/pkt_sched.h>])
523 AC_CHECK_TYPES([struct fib_rule_uid_range],,, [#include <linux/fib_rules.h>])
525 AC_CHECK_TYPES([struct statfs], [
526 AC_CHECK_MEMBERS(m4_normalize([
527 struct statfs.f_frsize,
528 struct statfs.f_flags,
529 struct statfs.f_fsid.val,
530 struct statfs.f_fsid.__val
531 ]),,, [#include <linux/types.h>
532 #include <asm/statfs.h>])
533 ],, [#include <linux/types.h>
534 #include <asm/statfs.h>])
536 AC_CHECK_TYPES([struct statfs64], [
537 AC_CHECK_MEMBERS(m4_normalize([
538 struct statfs64.f_frsize,
539 struct statfs64.f_flags,
540 struct statfs64.f_fsid.val,
541 struct statfs64.f_fsid.__val
542 ]),,, [#include <linux/types.h>
543 #include <asm/statfs.h>])
544 ],, [#include <linux/types.h>
545 #include <asm/statfs.h>])
547 AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
549 AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
551 AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
553 AC_CHECK_TYPES(m4_normalize([
554 struct ptp_sys_offset
555 ]),,, [#include <linux/ptp_clock.h>])
557 AC_CHECK_TYPES(m4_normalize([
560 struct kvm_userspace_memory_region
561 ]),,, [#include <linux/kvm.h>])
563 AC_CHECK_HEADERS([linux/btrfs.h], [
564 AC_CHECK_MEMBERS(m4_normalize([
565 struct btrfs_ioctl_feature_flags.compat_flags,
566 struct btrfs_ioctl_fs_info_args.nodesize,
567 struct btrfs_ioctl_defrag_range_args.start,
568 struct btrfs_ioctl_search_args_v2.buf_size,
569 struct btrfs_ioctl_logical_ino_args.flags
570 ]),,, [ #include <stdio.h>
571 #include <linux/btrfs.h>])
572 AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
573 BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
574 #include <linux/btrfs.h>])])
576 AC_CHECK_DECLS([sys_errlist])
577 AC_CHECK_DECLS(m4_normalize([
580 ]),,, [#include <sys/ptrace.h>])
582 AC_CHECK_DECLS(m4_normalize([
592 ]),,, [#include <sys/wait.h>])
594 AC_CHECK_DECLS(m4_normalize([
600 ]),,, [#include <linux/loop.h>])
602 AC_CHECK_DECLS(m4_normalize([
609 KERN_PRINTK_RATELIMIT,
610 KERN_PRINTK_RATELIMIT_BURST,
613 KERN_SPARC_SCONS_PWROFF,
615 KERN_UNKNOWN_NMI_PANIC,
616 KERN_BOOTLOADER_TYPE,
618 KERN_SETUID_DUMPABLE,
620 KERN_ACPI_VIDEO_FLAGS,
630 NET_CORE_DESTROY_DELAY,
632 NET_CORE_AEVENT_ETIME,
633 NET_CORE_AEVENT_RSEQTH,
635 NET_IPV4_IGMP_MAX_MSF,
636 NET_TCP_NO_METRICS_SAVE,
637 NET_TCP_DEFAULT_WIN_SCALE,
638 NET_TCP_MODERATE_RCVBUF,
639 NET_TCP_TSO_WIN_DIVISOR,
641 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
642 NET_TCP_CONG_CONTROL,
644 NET_IPV4_IPFRAG_MAX_DIST,
647 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
648 NET_TCP_DMA_COPYBREAK,
649 NET_TCP_SLOW_START_AFTER_IDLE,
650 NET_CIPSOV4_CACHE_ENABLE,
651 NET_CIPSOV4_CACHE_BUCKET_SIZE,
652 NET_CIPSOV4_RBM_OPTFMT,
653 NET_CIPSOV4_RBM_STRICTVALID,
654 NET_TCP_AVAIL_CONG_CONTROL,
655 NET_TCP_ALLOWED_CONG_CONTROL,
656 NET_TCP_MAX_SSTHRESH,
657 NET_TCP_FRTO_RESPONSE,
658 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
659 NET_IPV4_CONF_FORCE_IGMP_VERSION,
660 NET_IPV4_CONF_ARP_ANNOUNCE,
661 NET_IPV4_CONF_ARP_IGNORE,
662 NET_IPV4_CONF_PROMOTE_SECONDARIES,
663 NET_IPV4_CONF_ARP_ACCEPT,
664 NET_IPV4_CONF_ARP_NOTIFY,
665 NET_IPV6_MLD_MAX_MSF,
666 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
671 VM_VFS_CACHE_PRESSURE,
673 VM_SWAP_TOKEN_TIMEOUT
675 [#include <sys/types.h>
676 #include <linux/sysctl.h>])
678 AC_CHECK_DECLS(m4_normalize([
683 V4L2_FIELD_INTERLACED,
686 V4L2_FIELD_ALTERNATE,
687 V4L2_FIELD_INTERLACED_TB,
688 V4L2_FIELD_INTERLACED_BT,
689 V4L2_BUF_TYPE_VIDEO_CAPTURE,
690 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
691 V4L2_BUF_TYPE_VIDEO_OUTPUT,
692 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
693 V4L2_BUF_TYPE_VIDEO_OVERLAY,
694 V4L2_BUF_TYPE_VBI_CAPTURE,
695 V4L2_BUF_TYPE_VBI_OUTPUT,
696 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
697 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
698 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
699 V4L2_BUF_TYPE_SDR_CAPTURE,
700 V4L2_BUF_TYPE_SDR_OUTPUT,
702 V4L2_TUNER_ANALOG_TV,
703 V4L2_TUNER_DIGITAL_TV,
708 V4L2_COLORSPACE_SMPTE170M,
709 V4L2_COLORSPACE_SMPTE240M,
710 V4L2_COLORSPACE_REC709,
711 V4L2_COLORSPACE_BT878,
712 V4L2_COLORSPACE_470_SYSTEM_M,
713 V4L2_COLORSPACE_470_SYSTEM_BG,
714 V4L2_COLORSPACE_JPEG,
715 V4L2_COLORSPACE_SRGB,
717 V4L2_PRIORITY_BACKGROUND,
718 V4L2_PRIORITY_INTERACTIVE,
719 V4L2_PRIORITY_RECORD,
720 V4L2_FRMSIZE_TYPE_DISCRETE,
721 V4L2_FRMSIZE_TYPE_CONTINUOUS,
722 V4L2_FRMSIZE_TYPE_STEPWISE,
723 V4L2_FRMIVAL_TYPE_DISCRETE,
724 V4L2_FRMIVAL_TYPE_CONTINUOUS,
725 V4L2_FRMIVAL_TYPE_STEPWISE,
726 V4L2_CTRL_TYPE_INTEGER,
727 V4L2_CTRL_TYPE_BOOLEAN,
729 V4L2_CTRL_TYPE_BUTTON,
730 V4L2_CTRL_TYPE_INTEGER64,
731 V4L2_CTRL_TYPE_CTRL_CLASS,
732 V4L2_CTRL_TYPE_STRING,
733 V4L2_CTRL_TYPE_BITMASK,
734 V4L2_CTRL_TYPE_INTEGER_MENU
735 ]),,, [#include <sys/time.h>
736 #include <linux/ioctl.h>
737 #include <linux/types.h>
738 #include <linux/videodev2.h>])
740 AC_CHECK_MEMBERS(m4_normalize([
741 struct v4l2_window.global_alpha,
742 struct v4l2_sdr_format.buffersize
743 ]),,, [#include <sys/time.h>
744 #include <linux/ioctl.h>
745 #include <linux/types.h>
746 #include <linux/videodev2.h>])
748 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
749 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
751 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
752 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
753 if test $ac_cv_have_blkgetsize64 = yes; then
754 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
757 AC_CHECK_SIZEOF([long])
758 SIZEOF_LONG="$ac_cv_sizeof_long"
759 AC_SUBST(SIZEOF_LONG)
760 AC_CHECK_SIZEOF([long long])
761 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
762 AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
763 SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
764 AC_SUBST(SIZEOF_KERNEL_LONG_T)
765 AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
768 AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
769 [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
770 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
772 test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
773 if test "x$st_cv_SIGRTMIN" != xno; then
774 AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
775 [SIGRTMIN defined in <asm/signal.h>])
777 AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
778 [st_cv_SA_RESTORER="$(echo SA_RESTORER |
779 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
781 test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
782 if test "x$st_cv_SA_RESTORER" != xno; then
783 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
784 [SA_RESTORER defined in <asm/signal.h>])
787 AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
788 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
789 [st_cv_have___builtin_popcount=yes],
790 [st_cv_have___builtin_popcount=no])])
791 if test "x$st_cv_have___builtin_popcount" = xyes; then
792 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
793 [Define to 1 if the system provides __builtin_popcount function])
796 AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
797 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
798 [[return !*program_invocation_name]])],
799 [st_cv_have_program_invocation_name=yes],
800 [st_cv_have_program_invocation_name=no])])
801 if test "x$st_cv_have_program_invocation_name" = xyes; then
802 AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
803 [Define to 1 if the system provides program_invocation_name variable])
806 AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
807 if test "x$ac_cv_lib_dl_dladdr" = xyes; then
808 AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
813 AC_SEARCH_LIBS([timer_create], [rt])
815 case "$ac_cv_search_timer_create" in
816 no) AC_MSG_FAILURE([failed to find timer_create]) ;;
817 -l*) timer_LIBS="$ac_cv_search_timer_create" ;;
823 AC_SEARCH_LIBS([clock_gettime], [rt])
825 case "$ac_cv_search_clock_gettime" in
826 no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
827 -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
833 AC_SEARCH_LIBS([mq_open], [rt])
835 case "$ac_cv_search_mq_open" in
836 -l*) mq_LIBS="$ac_cv_search_mq_open" ;;
841 AC_PATH_PROG([PERL], [perl])
843 AC_CHECK_TOOL([READELF], [readelf])
845 dnl stack trace with libunwind
849 AC_ARG_WITH([libunwind],
850 [AS_HELP_STRING([--with-libunwind],
851 [use libunwind to implement stack tracing support])],
852 [case "${withval}" in
854 *) with_libunwind=yes
855 libunwind_CPPFLAGS="-I${withval}/include"
856 libunwind_LDFLAGS="-L${withval}/lib" ;;
858 [with_libunwind=check]
862 AS_IF([test "x$with_libunwind" != xno],
863 [saved_CPPFLAGS="$CPPFLAGS"
864 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
866 AC_CHECK_HEADERS([libunwind-ptrace.h],
867 [saved_LDFLAGS="$LDFLAGS"
868 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
870 AC_CHECK_LIB([unwind], [backtrace],
871 [libunwind_LIBS="-lunwind $libunwind_LIBS"
873 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
875 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
878 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
879 [[return !unw_create_addr_space(0, 0)]])
881 [AC_MSG_RESULT([yes])
882 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
884 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
885 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
888 [if test "x$with_libunwind" != xcheck; then
889 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
896 if test "x$with_libunwind" != xcheck; then
897 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
904 [if test "x$with_libunwind" != xcheck; then
905 AC_MSG_FAILURE([failed to find libunwind])
911 LDFLAGS="$saved_LDFLAGS"
913 [if test "x$with_libunwind" != xcheck; then
914 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
919 CPPFLAGS="$saved_CPPFLAGS"
924 AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
925 if test "x$use_libunwind" = xyes; then
926 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
927 AC_SUBST(libunwind_LIBS)
928 AC_SUBST(libunwind_LDFLAGS)
929 AC_SUBST(libunwind_CPPFLAGS)
931 AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
932 AC_MSG_RESULT([$use_libunwind])
934 dnl demangling symbols in the stack trace
938 AC_ARG_WITH([libiberty],
939 [AS_HELP_STRING([--with-libiberty],
940 [use libiberty to demangle symbols in stack trace])],
941 [case "${withval}" in
943 *) with_libiberty=yes
944 libiberty_CPPFLAGS="-I${withval}/include"
945 libiberty_LDFLAGS="-L${withval}/lib" ;;
947 [with_libiberty=check]
951 AS_IF([test "x$use_libunwind" = xyes && test "x$with_libiberty" != xno],
952 [saved_CPPFLAGS="$CPPFLAGS"
953 CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS"
954 AC_CHECK_HEADERS([demangle.h libiberty/demangle.h],
955 [saved_LDFLAGS="$LDFLAGS"
956 LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
957 AC_CHECK_LIB([iberty],[cplus_demangle],
958 [libiberty_LIBS="-liberty"
961 [if test "x$with_libiberty" != xcheck; then
962 AC_MSG_FAILURE([failed to find cplus_demangle in libiberty])
966 LDFLAGS="$saved_LDFLAGS"
968 [if test "x$with_libiberty" != xcheck; then
969 AC_MSG_FAILURE([failed to find demangle.h])
973 CPPFLAGS="$saved_CPPFLAGS"
978 AC_MSG_CHECKING([whether to enable demangling symbols in stack trace])
979 if test "x$use_libiberty" = xyes; then
980 AC_DEFINE([USE_DEMANGLE], 1, [Do demangling symbols in stack trace])
981 AC_SUBST(libiberty_LIBS)
982 AC_SUBST(libiberty_LDFLAGS)
983 AC_SUBST(libiberty_CPPFLAGS)
985 AM_CONDITIONAL([USE_DEMANGLE], [test "x$use_libiberty" = xyes])
986 AC_MSG_RESULT([$use_libiberty])
988 if test "$arch" = mips && test "$no_create" != yes; then
990 if $srcdir/linux/mips/genstub.sh linux/mips; then
991 AC_MSG_RESULT([Generated MIPS syscallent stubs])
993 AC_MSG_ERROR([Failed to generate syscallent stubs])
997 AC_ARG_ENABLE([mpers],
998 [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
999 [whether to enable multiple personalities support required
1000 for proper decoding of structures used by tracees with
1001 personalities that differ from the personality of strace,
1003 [case "$enableval" in
1004 yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
1005 *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
1006 Valid options are: yes, no, check, m32, mx32.])
1011 st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
1012 st_MPERS([mx32], [x86_64])
1014 AX_VALGRIND_DFLT([sgcheck], [off])
1017 AC_CONFIG_FILES([Makefile