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-2017 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.sourceforge.net],
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)
61 AC_USE_SYSTEM_EXTENSIONS
64 AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.])
65 AC_SUBST([COPYRIGHT_YEAR], [copyright_year])
67 AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
68 AC_SUBST([MANPAGE_DATE], [manpage_date])
70 AC_MSG_CHECKING([for supported architecture])
76 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
80 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
84 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
88 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
93 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
97 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
101 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
105 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
109 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
112 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
116 #endif], [], arch=powerpc64, arch=powerpc)
117 if test "$arch" = "powerpc64"; then
119 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
124 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
129 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
133 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
137 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
141 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
145 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
149 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
153 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
157 AC_DEFINE([SH], 1, [Define for the SH architecture.])
164 #endif], [], arch=x32, arch=x86_64)
165 if test "$arch" = "x86_64"; then
167 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
169 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
174 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
178 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
182 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
186 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
190 AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
195 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
200 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
205 AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
210 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
215 test -n "$arch_m32" ||
217 test -n "$arch_mx32" ||
224 if test "$arch" = mips; then
225 AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
226 [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
227 [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
229 # requires GCC >= 3.4
230 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
232 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])],
233 [st_cv_mips_abi=o32],
235 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])],
236 [st_cv_mips_abi=n32],
238 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])],
239 [st_cv_mips_abi=n64],
240 [st_cv_mips_abi=unknown])])])])
242 case "$st_cv_mips_abi" in
243 o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);;
244 n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);;
245 n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);;
246 *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
248 MIPS_ABI="$st_cv_mips_abi"
252 AC_ARG_ENABLE([arm-oabi],
253 [AS_HELP_STRING([--enable-arm-oabi],
254 [enable OABI support on ARM EABI])],
255 [], [enable_arm_oabi=no])
256 case "$enable_arm_oabi" in
257 yes) enable_arm_oabi=1 ;;
258 no) enable_arm_oabi=0 ;;
259 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
261 AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
262 [Define to 1 if you want OABI support on ARM EABI.])
269 AC_CHECK_FUNCS(m4_normalize([
296 AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
298 AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
300 AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
301 [#include <asm/posix_types.h>])
303 AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
304 [#include <sys/types.h>
305 #include <asm/stat.h>])
307 AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
309 AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
310 [#include <sys/types.h>
311 #include <asm/stat.h>])
313 AC_CHECK_TYPES(m4_normalize([
314 struct pt_all_user_regs,
316 struct ptrace_peeksiginfo_args
317 ]),,, [#include <sys/ptrace.h>])
319 AC_CHECK_TYPES(m4_normalize([
322 struct __kernel_flock,
323 struct __kernel_flock64
325 [#include <sys/types.h>
326 #include <linux/fcntl.h>])
328 AC_CHECK_TYPES(m4_normalize([
329 struct crypto_report_aead,
330 struct crypto_report_blkcipher,
331 struct crypto_report_cipher,
332 struct crypto_report_hash,
333 struct crypto_report_rng
334 ]),,, [#include <linux/cryptouser.h>])
336 AC_CHECK_TYPES(m4_normalize([
337 struct kcmp_epoll_slot
338 ]),,, [#include <linux/kcmp.h>])
340 AC_CHECK_TYPES(m4_normalize([
341 struct keyctl_kdf_params
342 ]),,, [#include <linux/keyctl.h>])
344 AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
346 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
348 AC_CHECK_MEMBERS(m4_normalize([
349 siginfo_t.si_syscall,
350 siginfo_t.si_timerid,
352 ]),,, [#include <signal.h>])
354 AC_CHECK_MEMBERS(m4_normalize([
355 struct perf_event_attr.precise_ip,
356 struct perf_event_attr.mmap_data,
357 struct perf_event_attr.sample_id_all,
358 struct perf_event_attr.exclude_host,
359 struct perf_event_attr.exclude_guest,
360 struct perf_event_attr.exclude_callchain_kernel,
361 struct perf_event_attr.exclude_callchain_user,
362 struct perf_event_attr.mmap2,
363 struct perf_event_attr.comm_exec,
364 struct perf_event_attr.use_clockid,
365 struct perf_event_attr.context_switch,
366 struct perf_event_attr.write_backward,
367 struct perf_event_attr.bp_type,
368 struct perf_event_attr.config1,
369 struct perf_event_attr.config2,
370 struct perf_event_attr.branch_sample_type,
371 struct perf_event_attr.sample_regs_user,
372 struct perf_event_attr.sample_stack_user,
373 struct perf_event_attr.sample_regs_intr,
374 struct perf_event_attr.aux_watermark,
375 struct perf_event_attr.sample_max_stack
376 ]),,, [#include <linux/perf_event.h>])
378 AC_CHECK_HEADERS(m4_normalize([
381 bluetooth/bluetooth.h
402 linux/netfilter/ipset/ip_set.h
403 linux/netfilter/nf_tables.h
404 linux/netfilter/nf_tables_compat.h
405 linux/netfilter/nfnetlink.h
406 linux/netfilter/nfnetlink_acct.h
407 linux/netfilter/nfnetlink_conntrack.h
408 linux/netfilter/nfnetlink_cthelper.h
409 linux/netfilter/nfnetlink_cttimeout.h
410 linux/netfilter/nfnetlink_log.h
411 linux/netfilter/nfnetlink_queue.h
440 AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
442 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
444 AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
446 AC_CHECK_HEADERS([linux/netfilter/xt_osf.h],,, [#include <linux/ip.h>
447 #include <linux/tcp.h>])
449 AC_CHECK_HEADERS(m4_normalize([
450 linux/netfilter_arp/arp_tables.h
451 linux/netfilter_bridge/ebtables.h
452 linux/netfilter_ipv4/ip_tables.h
453 linux/netfilter_ipv6/ip6_tables.h
454 ]),,, [#include <netinet/in.h>
455 #include <net/if.h>])
457 AC_CHECK_HEADERS([linux/input.h], [
458 AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
461 AC_CHECK_HEADERS([linux/bpf.h], [
462 st_CHECK_UNION_BPF_ATTR([attach_flags])
463 st_CHECK_UNION_BPF_ATTR([bpf_fd])
464 st_CHECK_UNION_BPF_ATTR([flags])
465 st_CHECK_UNION_BPF_ATTR([inner_map_fd])
466 st_CHECK_UNION_BPF_ATTR([prog_flags])
469 AC_CHECK_TYPES(m4_normalize([
472 ]),,, [#include <linux/if_bridge.h>])
473 AC_CHECK_MEMBERS(m4_normalize([
474 struct br_mdb_entry.flags,
475 struct br_mdb_entry.vid
476 ]),,, [#include <linux/if_bridge.h>])
478 AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
479 AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
480 AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
482 AC_CHECK_TYPES(m4_normalize([
483 struct rta_mfc_stats,
485 ]),,, [#include <linux/rtnetlink.h>])
487 AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
488 AC_CHECK_TYPES(m4_normalize([
491 ]),,, [#include <linux/neighbour.h>])
493 AC_CHECK_TYPES(m4_normalize([
494 struct ifla_bridge_id,
495 struct ifla_port_vsi,
496 struct rtnl_link_stats64
497 ]),,, [#include <linux/if_link.h>])
498 AC_CHECK_MEMBERS(m4_normalize([
499 struct rtnl_link_stats.rx_nohandler,
500 struct rtnl_link_stats64.rx_nohandler
501 ]),,, [#include <linux/if_link.h>])
503 AC_CHECK_TYPES(m4_normalize([
504 struct gnet_stats_basic,
505 struct gnet_stats_queue,
506 struct gnet_stats_rate_est,
507 struct gnet_stats_rate_est64
508 ]),,, [#include <linux/gen_stats.h>])
510 AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/pkt_sched.h>])
512 AC_CHECK_TYPES([struct fib_rule_uid_range],,, [#include <linux/fib_rules.h>])
514 AC_CHECK_TYPES([struct statfs], [
515 AC_CHECK_MEMBERS(m4_normalize([
516 struct statfs.f_frsize,
517 struct statfs.f_flags,
518 struct statfs.f_fsid.val,
519 struct statfs.f_fsid.__val
520 ]),,, [#include <linux/types.h>
521 #include <asm/statfs.h>])
522 ],, [#include <linux/types.h>
523 #include <asm/statfs.h>])
525 AC_CHECK_TYPES([struct statfs64], [
526 AC_CHECK_MEMBERS(m4_normalize([
527 struct statfs64.f_frsize,
528 struct statfs64.f_flags,
529 struct statfs64.f_fsid.val,
530 struct statfs64.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 blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
538 AC_CHECK_HEADERS([linux/btrfs.h], [
539 AC_CHECK_MEMBERS(m4_normalize([
540 struct btrfs_ioctl_feature_flags.compat_flags,
541 struct btrfs_ioctl_fs_info_args.nodesize,
542 struct btrfs_ioctl_defrag_range_args.start,
543 struct btrfs_ioctl_search_args_v2.buf_size
544 ]),,, [ #include <stdio.h>
545 #include <linux/btrfs.h>])
546 AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
547 BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
548 #include <linux/btrfs.h>])])
550 AC_CHECK_DECLS([sys_errlist])
551 AC_CHECK_DECLS(m4_normalize([
554 ]),,, [#include <sys/ptrace.h>])
556 AC_CHECK_DECLS(m4_normalize([
566 ]),,, [#include <sys/wait.h>])
568 AC_CHECK_DECLS(m4_normalize([
574 ]),,, [#include <linux/loop.h>])
576 AC_CHECK_DECLS(m4_normalize([
583 KERN_PRINTK_RATELIMIT,
584 KERN_PRINTK_RATELIMIT_BURST,
587 KERN_SPARC_SCONS_PWROFF,
589 KERN_UNKNOWN_NMI_PANIC,
590 KERN_BOOTLOADER_TYPE,
592 KERN_SETUID_DUMPABLE,
594 KERN_ACPI_VIDEO_FLAGS,
604 NET_CORE_DESTROY_DELAY,
606 NET_CORE_AEVENT_ETIME,
607 NET_CORE_AEVENT_RSEQTH,
609 NET_IPV4_IGMP_MAX_MSF,
610 NET_TCP_NO_METRICS_SAVE,
611 NET_TCP_DEFAULT_WIN_SCALE,
612 NET_TCP_MODERATE_RCVBUF,
613 NET_TCP_TSO_WIN_DIVISOR,
615 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
616 NET_TCP_CONG_CONTROL,
618 NET_IPV4_IPFRAG_MAX_DIST,
621 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
622 NET_TCP_DMA_COPYBREAK,
623 NET_TCP_SLOW_START_AFTER_IDLE,
624 NET_CIPSOV4_CACHE_ENABLE,
625 NET_CIPSOV4_CACHE_BUCKET_SIZE,
626 NET_CIPSOV4_RBM_OPTFMT,
627 NET_CIPSOV4_RBM_STRICTVALID,
628 NET_TCP_AVAIL_CONG_CONTROL,
629 NET_TCP_ALLOWED_CONG_CONTROL,
630 NET_TCP_MAX_SSTHRESH,
631 NET_TCP_FRTO_RESPONSE,
632 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
633 NET_IPV4_CONF_FORCE_IGMP_VERSION,
634 NET_IPV4_CONF_ARP_ANNOUNCE,
635 NET_IPV4_CONF_ARP_IGNORE,
636 NET_IPV4_CONF_PROMOTE_SECONDARIES,
637 NET_IPV4_CONF_ARP_ACCEPT,
638 NET_IPV4_CONF_ARP_NOTIFY,
639 NET_IPV6_MLD_MAX_MSF,
640 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
645 VM_VFS_CACHE_PRESSURE,
647 VM_SWAP_TOKEN_TIMEOUT
649 [#include <sys/types.h>
650 #include <linux/sysctl.h>])
652 AC_CHECK_DECLS(m4_normalize([
657 V4L2_FIELD_INTERLACED,
660 V4L2_FIELD_ALTERNATE,
661 V4L2_FIELD_INTERLACED_TB,
662 V4L2_FIELD_INTERLACED_BT,
663 V4L2_BUF_TYPE_VIDEO_CAPTURE,
664 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
665 V4L2_BUF_TYPE_VIDEO_OUTPUT,
666 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
667 V4L2_BUF_TYPE_VIDEO_OVERLAY,
668 V4L2_BUF_TYPE_VBI_CAPTURE,
669 V4L2_BUF_TYPE_VBI_OUTPUT,
670 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
671 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
672 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
673 V4L2_BUF_TYPE_SDR_CAPTURE,
674 V4L2_BUF_TYPE_SDR_OUTPUT,
676 V4L2_TUNER_ANALOG_TV,
677 V4L2_TUNER_DIGITAL_TV,
682 V4L2_COLORSPACE_SMPTE170M,
683 V4L2_COLORSPACE_SMPTE240M,
684 V4L2_COLORSPACE_REC709,
685 V4L2_COLORSPACE_BT878,
686 V4L2_COLORSPACE_470_SYSTEM_M,
687 V4L2_COLORSPACE_470_SYSTEM_BG,
688 V4L2_COLORSPACE_JPEG,
689 V4L2_COLORSPACE_SRGB,
691 V4L2_PRIORITY_BACKGROUND,
692 V4L2_PRIORITY_INTERACTIVE,
693 V4L2_PRIORITY_RECORD,
694 V4L2_FRMSIZE_TYPE_DISCRETE,
695 V4L2_FRMSIZE_TYPE_CONTINUOUS,
696 V4L2_FRMSIZE_TYPE_STEPWISE,
697 V4L2_FRMIVAL_TYPE_DISCRETE,
698 V4L2_FRMIVAL_TYPE_CONTINUOUS,
699 V4L2_FRMIVAL_TYPE_STEPWISE,
700 V4L2_CTRL_TYPE_INTEGER,
701 V4L2_CTRL_TYPE_BOOLEAN,
703 V4L2_CTRL_TYPE_BUTTON,
704 V4L2_CTRL_TYPE_INTEGER64,
705 V4L2_CTRL_TYPE_CTRL_CLASS,
706 V4L2_CTRL_TYPE_STRING,
707 V4L2_CTRL_TYPE_BITMASK,
708 V4L2_CTRL_TYPE_INTEGER_MENU
709 ]),,, [#include <sys/time.h>
710 #include <linux/ioctl.h>
711 #include <linux/types.h>
712 #include <linux/videodev2.h>])
714 AC_CHECK_MEMBERS(m4_normalize([
715 struct v4l2_window.global_alpha,
716 struct v4l2_sdr_format.buffersize
717 ]),,, [#include <sys/time.h>
718 #include <linux/ioctl.h>
719 #include <linux/types.h>
720 #include <linux/videodev2.h>])
722 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
723 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
725 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
726 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
727 if test $ac_cv_have_blkgetsize64 = yes; then
728 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
731 AC_CHECK_SIZEOF([long])
732 AC_CHECK_SIZEOF([long long])
733 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
734 AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
735 AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
737 AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
738 [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
739 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
741 test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
742 if test "x$st_cv_SIGRTMIN" != xno; then
743 AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
744 [SIGRTMIN defined in <asm/signal.h>])
746 AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
747 [st_cv_SA_RESTORER="$(echo SA_RESTORER |
748 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
750 test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
751 if test "x$st_cv_SA_RESTORER" != xno; then
752 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
753 [SA_RESTORER defined in <asm/signal.h>])
756 AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
757 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
758 [st_cv_have___builtin_popcount=yes],
759 [st_cv_have___builtin_popcount=no])])
760 if test "x$st_cv_have___builtin_popcount" = xyes; then
761 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
762 [Define to 1 if the system provides __builtin_popcount function])
765 AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name],
766 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
767 [[return !*program_invocation_name]])],
768 [st_cv_have_program_invocation_name=yes],
769 [st_cv_have_program_invocation_name=no])])
770 if test "x$st_cv_have_program_invocation_name" = xyes; then
771 AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
772 [Define to 1 if the system provides program_invocation_name variable])
775 AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
776 if test "x$ac_cv_lib_dl_dladdr" = xyes; then
777 AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
781 AC_PATH_PROG([PERL], [perl])
783 dnl stack trace with libunwind
787 AC_ARG_WITH([libunwind],
788 [AS_HELP_STRING([--with-libunwind],
789 [use libunwind to implement stack tracing support])],
790 [case "${withval}" in
792 *) with_libunwind=yes
793 libunwind_CPPFLAGS="-I${withval}/include"
794 libunwind_LDFLAGS="-L${withval}/lib" ;;
796 [with_libunwind=check]
800 AS_IF([test "x$with_libunwind" != xno],
801 [saved_CPPFLAGS="$CPPFLAGS"
802 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
804 AC_CHECK_HEADERS([libunwind-ptrace.h],
805 [saved_LDFLAGS="$LDFLAGS"
806 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
808 AC_CHECK_LIB([unwind], [backtrace],
809 [libunwind_LIBS="-lunwind $libunwind_LIBS"
811 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
813 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
816 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
817 [[return !unw_create_addr_space(0, 0)]])
819 [AC_MSG_RESULT([yes])
820 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
822 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
823 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
826 [if test "x$with_libunwind" != xcheck; then
827 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
834 if test "x$with_libunwind" != xcheck; then
835 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
842 [if test "x$with_libunwind" != xcheck; then
843 AC_MSG_FAILURE([failed to find libunwind])
849 LDFLAGS="$saved_LDFLAGS"
851 [if test "x$with_libunwind" != xcheck; then
852 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
857 CPPFLAGS="$saved_CPPFLAGS"
862 AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
863 if test "x$use_libunwind" = xyes; then
864 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
865 AC_SUBST(libunwind_LIBS)
866 AC_SUBST(libunwind_LDFLAGS)
867 AC_SUBST(libunwind_CPPFLAGS)
869 AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
870 AC_MSG_RESULT([$use_libunwind])
872 if test "$arch" = mips && test "$no_create" != yes; then
874 if $srcdir/linux/mips/genstub.sh linux/mips; then
875 AC_MSG_RESULT([Generated MIPS syscallent stubs])
877 AC_MSG_FAILURE([Failed to generate syscallent stubs])
881 st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
882 st_MPERS([mx32], [x86_64])
884 AX_VALGRIND_DFLT([sgcheck], [off])
887 AC_CONFIG_FILES([Makefile