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 AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
41 AC_CONFIG_SRCDIR([strace.c])
42 AC_CONFIG_AUX_DIR([.])
43 AC_CONFIG_HEADERS([config.h])
44 AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests])
45 AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
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_MSG_CHECKING([for supported architecture])
73 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
77 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
81 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
85 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
90 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
94 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
98 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
102 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
106 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
109 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
113 #endif], [], arch=powerpc64, arch=powerpc)
114 if test "$arch" = "powerpc64"; then
116 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
121 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
126 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
130 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
134 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
138 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
142 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
146 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
150 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
154 AC_DEFINE([SH], 1, [Define for the SH architecture.])
161 #endif], [], arch=x32, arch=x86_64)
162 if test "$arch" = "x86_64"; then
164 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
166 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
171 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
175 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
179 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
183 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
187 AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
192 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
197 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
202 AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
207 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
212 test -n "$arch_m32" ||
214 test -n "$arch_mx32" ||
221 if test "$arch" = mips; then
222 AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
223 [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
224 [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
226 # requires GCC >= 3.4
227 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
229 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIO32 ? 1 : - 1];]])],
230 [st_cv_mips_abi=o32],
232 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABIN32 ? 1 : - 1];]])],
233 [st_cv_mips_abi=n32],
235 [AC_LANG_PROGRAM(, [[int i[_MIPS_SIM == _ABI64 ? 1 : - 1];]])],
236 [st_cv_mips_abi=n64],
237 [st_cv_mips_abi=unknown])])])])
239 case "$st_cv_mips_abi" in
240 o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _ABIO32.]);;
241 n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _ABIN32.]);;
242 n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _ABI64.]);;
243 *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
245 MIPS_ABI="$st_cv_mips_abi"
249 AC_ARG_ENABLE([arm-oabi],
250 [AS_HELP_STRING([--enable-arm-oabi],
251 [enable OABI support on ARM EABI])],
252 [], [enable_arm_oabi=no])
253 case "$enable_arm_oabi" in
254 yes) enable_arm_oabi=1 ;;
255 no) enable_arm_oabi=0 ;;
256 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
258 AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
259 [Define to 1 if you want OABI support on ARM EABI.])
266 AC_CHECK_FUNCS(m4_normalize([
292 AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
294 AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
296 AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
297 [#include <asm/posix_types.h>])
299 AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
300 [#include <sys/types.h>
301 #include <asm/stat.h>])
303 AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
305 AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
306 [#include <sys/types.h>
307 #include <asm/stat.h>])
309 AC_CHECK_TYPES(m4_normalize([
310 struct pt_all_user_regs,
312 struct ptrace_peeksiginfo_args
313 ]),,, [#include <sys/ptrace.h>])
315 AC_CHECK_TYPES(m4_normalize([
318 struct __kernel_flock,
319 struct __kernel_flock64
321 [#include <sys/types.h>
322 #include <linux/fcntl.h>])
324 AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
326 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
328 AC_CHECK_MEMBERS(m4_normalize([
329 siginfo_t.si_syscall,
330 siginfo_t.si_timerid,
332 ]),,, [#include <signal.h>])
334 AC_CHECK_MEMBERS(m4_normalize([
335 struct perf_event_attr.precise_ip,
336 struct perf_event_attr.mmap_data,
337 struct perf_event_attr.sample_id_all,
338 struct perf_event_attr.exclude_host,
339 struct perf_event_attr.exclude_guest,
340 struct perf_event_attr.exclude_callchain_kernel,
341 struct perf_event_attr.exclude_callchain_user,
342 struct perf_event_attr.mmap2,
343 struct perf_event_attr.comm_exec,
344 struct perf_event_attr.use_clockid,
345 struct perf_event_attr.context_switch,
346 struct perf_event_attr.write_backward,
347 struct perf_event_attr.bp_type,
348 struct perf_event_attr.config1,
349 struct perf_event_attr.config2,
350 struct perf_event_attr.branch_sample_type,
351 struct perf_event_attr.sample_regs_user,
352 struct perf_event_attr.sample_stack_user,
353 struct perf_event_attr.sample_regs_intr,
354 struct perf_event_attr.aux_watermark,
355 struct perf_event_attr.sample_max_stack
356 ]),,, [#include <linux/perf_event.h>])
358 AC_CHECK_HEADERS(m4_normalize([
361 bluetooth/bluetooth.h
375 linux/netfilter/nfnetlink.h
404 AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
406 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
408 AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
410 AC_CHECK_HEADERS(m4_normalize([
411 linux/netfilter_arp/arp_tables.h
412 linux/netfilter_bridge/ebtables.h
413 linux/netfilter_ipv4/ip_tables.h
414 linux/netfilter_ipv6/ip6_tables.h
415 ]),,, [#include <netinet/in.h>
416 #include <net/if.h>])
418 AC_CHECK_HEADERS([linux/input.h], [
419 AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
422 AC_CHECK_HEADERS([linux/bpf.h], [
423 AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works],
424 [st_cv_have_union_bpf_attr_log_buf],
426 [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
427 [[union bpf_attr a = { .log_buf = 0 };]])],
428 [st_cv_have_union_bpf_attr_log_buf=yes],
429 [st_cv_have_union_bpf_attr_log_buf=no])])
430 if test $st_cv_have_union_bpf_attr_log_buf = yes; then
431 AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1],
432 [Define to 1 if union bpf_attr.log_buf initialization works])
434 AC_CACHE_CHECK([whether union bpf_attr.bpf_fd initialization works],
435 [st_cv_have_union_bpf_attr_bpf_fd],
437 [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
438 [[union bpf_attr a = { .bpf_fd = 0 };]])],
439 [st_cv_have_union_bpf_attr_bpf_fd=yes],
440 [st_cv_have_union_bpf_attr_bpf_fd=no])])
441 if test $st_cv_have_union_bpf_attr_bpf_fd = yes; then
442 AC_DEFINE(HAVE_UNION_BPF_ATTR_BPF_FD, [1],
443 [Define to 1 if union bpf_attr.bpf_fd initialization works])
445 AC_CACHE_CHECK([whether union bpf_attr.attach_flags initialization works],
446 [st_cv_have_union_bpf_attr_attach_flags],
448 [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
449 [[union bpf_attr a = { .attach_flags = 0 };]])],
450 [st_cv_have_union_bpf_attr_attach_flags=yes],
451 [st_cv_have_union_bpf_attr_attach_flags=no])])
452 if test $st_cv_have_union_bpf_attr_attach_flags = yes; then
453 AC_DEFINE(HAVE_UNION_BPF_ATTR_ATTACH_FLAGS, [1],
454 [Define to 1 if union bpf_attr.attach_flags initialization works])
458 AC_CHECK_TYPES([struct statfs], [
459 AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include <linux/types.h>
460 #include <asm/statfs.h>])
461 AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include <linux/types.h>
462 #include <asm/statfs.h>])
463 AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include <linux/types.h>
464 #include <asm/statfs.h>])
465 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include <linux/types.h>
466 #include <asm/statfs.h>])
467 ],, [#include <linux/types.h>
468 #include <asm/statfs.h>])
470 AC_CHECK_TYPES([struct statfs64], [
471 AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include <linux/types.h>
472 #include <asm/statfs.h>])
473 AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include <linux/types.h>
474 #include <asm/statfs.h>])
475 AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include <linux/types.h>
476 #include <asm/statfs.h>])
477 AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include <linux/types.h>
478 #include <asm/statfs.h>])
479 ],, [#include <linux/types.h>
480 #include <asm/statfs.h>])
482 AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
484 AC_CHECK_HEADERS([linux/btrfs.h], [
485 AC_CHECK_MEMBERS(m4_normalize([
486 struct btrfs_ioctl_feature_flags.compat_flags,
487 struct btrfs_ioctl_fs_info_args.nodesize,
488 struct btrfs_ioctl_defrag_range_args.start,
489 struct btrfs_ioctl_search_args_v2.buf_size
490 ]),,, [ #include <stdio.h>
491 #include <linux/btrfs.h>])
492 AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
493 BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
494 #include <linux/btrfs.h>])])
496 AC_CHECK_DECLS([sys_errlist])
497 AC_CHECK_DECLS(m4_normalize([
500 ]),,, [#include <sys/ptrace.h>])
502 AC_CHECK_DECLS(m4_normalize([
512 ]),,, [#include <sys/wait.h>])
514 AC_CHECK_DECLS(m4_normalize([
520 ]),,, [#include <linux/loop.h>])
522 AC_CHECK_DECLS(m4_normalize([
529 KERN_PRINTK_RATELIMIT,
530 KERN_PRINTK_RATELIMIT_BURST,
533 KERN_SPARC_SCONS_PWROFF,
535 KERN_UNKNOWN_NMI_PANIC,
536 KERN_BOOTLOADER_TYPE,
538 KERN_SETUID_DUMPABLE,
540 KERN_ACPI_VIDEO_FLAGS,
550 NET_CORE_DESTROY_DELAY,
552 NET_CORE_AEVENT_ETIME,
553 NET_CORE_AEVENT_RSEQTH,
555 NET_IPV4_IGMP_MAX_MSF,
556 NET_TCP_NO_METRICS_SAVE,
557 NET_TCP_DEFAULT_WIN_SCALE,
558 NET_TCP_MODERATE_RCVBUF,
559 NET_TCP_TSO_WIN_DIVISOR,
561 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
562 NET_TCP_CONG_CONTROL,
564 NET_IPV4_IPFRAG_MAX_DIST,
567 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
568 NET_TCP_DMA_COPYBREAK,
569 NET_TCP_SLOW_START_AFTER_IDLE,
570 NET_CIPSOV4_CACHE_ENABLE,
571 NET_CIPSOV4_CACHE_BUCKET_SIZE,
572 NET_CIPSOV4_RBM_OPTFMT,
573 NET_CIPSOV4_RBM_STRICTVALID,
574 NET_TCP_AVAIL_CONG_CONTROL,
575 NET_TCP_ALLOWED_CONG_CONTROL,
576 NET_TCP_MAX_SSTHRESH,
577 NET_TCP_FRTO_RESPONSE,
578 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
579 NET_IPV4_CONF_FORCE_IGMP_VERSION,
580 NET_IPV4_CONF_ARP_ANNOUNCE,
581 NET_IPV4_CONF_ARP_IGNORE,
582 NET_IPV4_CONF_PROMOTE_SECONDARIES,
583 NET_IPV4_CONF_ARP_ACCEPT,
584 NET_IPV4_CONF_ARP_NOTIFY,
585 NET_IPV6_MLD_MAX_MSF,
586 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
591 VM_VFS_CACHE_PRESSURE,
593 VM_SWAP_TOKEN_TIMEOUT
595 [#include <sys/types.h>
596 #include <linux/sysctl.h>])
598 AC_CHECK_DECLS(m4_normalize([
603 V4L2_FIELD_INTERLACED,
606 V4L2_FIELD_ALTERNATE,
607 V4L2_FIELD_INTERLACED_TB,
608 V4L2_FIELD_INTERLACED_BT,
609 V4L2_BUF_TYPE_VIDEO_CAPTURE,
610 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
611 V4L2_BUF_TYPE_VIDEO_OUTPUT,
612 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
613 V4L2_BUF_TYPE_VIDEO_OVERLAY,
614 V4L2_BUF_TYPE_VBI_CAPTURE,
615 V4L2_BUF_TYPE_VBI_OUTPUT,
616 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
617 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
618 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
619 V4L2_BUF_TYPE_SDR_CAPTURE,
620 V4L2_BUF_TYPE_SDR_OUTPUT,
622 V4L2_TUNER_ANALOG_TV,
623 V4L2_TUNER_DIGITAL_TV,
628 V4L2_COLORSPACE_SMPTE170M,
629 V4L2_COLORSPACE_SMPTE240M,
630 V4L2_COLORSPACE_REC709,
631 V4L2_COLORSPACE_BT878,
632 V4L2_COLORSPACE_470_SYSTEM_M,
633 V4L2_COLORSPACE_470_SYSTEM_BG,
634 V4L2_COLORSPACE_JPEG,
635 V4L2_COLORSPACE_SRGB,
637 V4L2_PRIORITY_BACKGROUND,
638 V4L2_PRIORITY_INTERACTIVE,
639 V4L2_PRIORITY_RECORD,
640 V4L2_FRMSIZE_TYPE_DISCRETE,
641 V4L2_FRMSIZE_TYPE_CONTINUOUS,
642 V4L2_FRMSIZE_TYPE_STEPWISE,
643 V4L2_FRMIVAL_TYPE_DISCRETE,
644 V4L2_FRMIVAL_TYPE_CONTINUOUS,
645 V4L2_FRMIVAL_TYPE_STEPWISE,
646 V4L2_CTRL_TYPE_INTEGER,
647 V4L2_CTRL_TYPE_BOOLEAN,
649 V4L2_CTRL_TYPE_BUTTON,
650 V4L2_CTRL_TYPE_INTEGER64,
651 V4L2_CTRL_TYPE_CTRL_CLASS,
652 V4L2_CTRL_TYPE_STRING,
653 V4L2_CTRL_TYPE_BITMASK,
654 V4L2_CTRL_TYPE_INTEGER_MENU
655 ]),,, [#include <sys/time.h>
656 #include <linux/ioctl.h>
657 #include <linux/types.h>
658 #include <linux/videodev2.h>])
660 AC_CHECK_MEMBERS(m4_normalize([
661 struct v4l2_window.global_alpha,
662 struct v4l2_sdr_format.buffersize
663 ]),,, [#include <sys/time.h>
664 #include <linux/ioctl.h>
665 #include <linux/types.h>
666 #include <linux/videodev2.h>])
668 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
669 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
671 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
672 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
673 if test $ac_cv_have_blkgetsize64 = yes; then
674 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
677 AC_CHECK_SIZEOF([long])
678 AC_CHECK_SIZEOF([long long])
679 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
680 AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
681 AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
683 AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
684 [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
685 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
687 test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
688 if test "x$st_cv_SIGRTMIN" != xno; then
689 AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
690 [SIGRTMIN defined in <asm/signal.h>])
692 AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
693 [st_cv_SA_RESTORER="$(echo SA_RESTORER |
694 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
696 test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
697 if test "x$st_cv_SA_RESTORER" != xno; then
698 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
699 [SA_RESTORER defined in <asm/signal.h>])
702 AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
703 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
704 [st_cv_have___builtin_popcount=yes],
705 [st_cv_have___builtin_popcount=no])])
706 if test "x$st_cv_have___builtin_popcount" = xyes; then
707 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
708 [Define to 1 if the system provides __builtin_popcount function])
711 AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
712 if test "x$ac_cv_lib_dl_dladdr" = xyes; then
713 AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
717 AC_PATH_PROG([PERL], [perl])
719 dnl stack trace with libunwind
723 AC_ARG_WITH([libunwind],
724 [AS_HELP_STRING([--with-libunwind],
725 [use libunwind to implement stack tracing support])],
726 [case "${withval}" in
728 *) with_libunwind=yes
729 libunwind_CPPFLAGS="-I${withval}/include"
730 libunwind_LDFLAGS="-L${withval}/lib" ;;
732 [with_libunwind=check]
736 AS_IF([test "x$with_libunwind" != xno],
737 [saved_CPPFLAGS="$CPPFLAGS"
738 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
740 AC_CHECK_HEADERS([libunwind-ptrace.h],
741 [saved_LDFLAGS="$LDFLAGS"
742 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
744 AC_CHECK_LIB([unwind], [backtrace],
745 [libunwind_LIBS="-lunwind $libunwind_LIBS"
747 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
749 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
752 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
753 [[return !unw_create_addr_space(0, 0)]])
755 [AC_MSG_RESULT([yes])
756 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
758 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
759 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
762 [if test "x$with_libunwind" != xcheck; then
763 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
770 if test "x$with_libunwind" != xcheck; then
771 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
778 [if test "x$with_libunwind" != xcheck; then
779 AC_MSG_FAILURE([failed to find libunwind])
785 LDFLAGS="$saved_LDFLAGS"
787 [if test "x$with_libunwind" != xcheck; then
788 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
793 CPPFLAGS="$saved_CPPFLAGS"
798 AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
799 if test "x$use_libunwind" = xyes; then
800 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
801 AC_SUBST(libunwind_LIBS)
802 AC_SUBST(libunwind_LDFLAGS)
803 AC_SUBST(libunwind_CPPFLAGS)
805 AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
806 AC_MSG_RESULT([$use_libunwind])
808 if test "$arch" = mips && test "$no_create" != yes; then
810 if $srcdir/linux/mips/genstub.sh linux/mips; then
811 AC_MSG_RESULT([Generated MIPS syscallent stubs])
813 AC_MSG_FAILURE([Failed to generate syscallent stubs])
817 st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
818 st_MPERS([mx32], [x86_64])
820 AX_VALGRIND_DFLT([sgcheck], [off])
823 AC_CONFIG_FILES([Makefile