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>
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions
13 # 1. Redistributions of source code must retain the above copyright
14 # notice, this list of conditions and the following disclaimer.
15 # 2. Redistributions in binary form must reproduce the above copyright
16 # notice, this list of conditions and the following disclaimer in the
17 # documentation and/or other materials provided with the distribution.
18 # 3. The name of the author may not be used to endorse or promote products
19 # derived from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 m4_esyscmd([./git-version-gen .tarball-version]),
35 [strace-devel@lists.sourceforge.net])
36 AC_CONFIG_SRCDIR([strace.c])
37 AC_CONFIG_AUX_DIR([.])
38 AC_CONFIG_HEADERS([config.h])
39 AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests])
43 RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')"
44 AC_SUBST(RPM_CHANGELOGTIME)
45 DEB_CHANGELOGTIME="$(LC_TIME=C date -R)"
46 AC_SUBST(DEB_CHANGELOGTIME)
54 AC_USE_SYSTEM_EXTENSIONS
57 AC_MSG_CHECKING([for supported architecture])
63 AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
67 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
71 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
75 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
80 AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
84 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
88 AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
92 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
96 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
99 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
103 #endif], [], arch=powerpc64, arch=powerpc)
104 if test "$arch" = "powerpc64"; then
106 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
111 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
116 AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
120 AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
124 AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
128 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
132 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
136 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
140 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
144 AC_DEFINE([SH], 1, [Define for the SH architecture.])
151 #endif], [], arch=x32, arch=x86_64)
152 if test "$arch" = "x86_64"; then
154 AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
156 AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
161 AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
165 AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
169 AC_DEFINE([TILE], 1, [Define for the Tile architecture])
173 AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
177 AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
182 AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
187 AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
192 AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
197 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
202 test -n "$arch_m32" ||
204 test -n "$arch_mx32" ||
211 if test "$arch" = mips; then
212 AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
213 [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM],
214 [#include <sgidefs.h>],
215 [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
217 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
219 [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
220 [[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
221 [st_cv_mips_abi=o32],
223 [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
224 [[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
225 [st_cv_mips_abi=n32],
227 [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
228 [[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
229 [st_cv_mips_abi=n64],
230 [st_cv_mips_abi=unknown])])])])
232 case "$st_cv_mips_abi" in
233 o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _MIPS_SIM_ABI32.]);;
234 n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _MIPS_SIM_NABI32.]);;
235 n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _MIPS_SIM_ABI64.]);;
236 *) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
238 MIPS_ABI="$st_cv_mips_abi"
242 AC_ARG_ENABLE([arm-oabi],
243 [AS_HELP_STRING([--enable-arm-oabi],
244 [enable OABI support on ARM EABI])],
245 [], [enable_arm_oabi=no])
246 case "$enable_arm_oabi" in
247 yes) enable_arm_oabi=1 ;;
248 no) enable_arm_oabi=0 ;;
249 *) AC_MSG_ERROR([bad value $enable_arm_oabi for arm-oabi option]) ;;
251 AC_DEFINE_UNQUOTED([ENABLE_ARM_OABI], [$enable_arm_oabi],
252 [Define to 1 if you want OABI support on ARM EABI.])
255 gl_WARN_ADD([-Wempty-body])
256 gl_WARN_ADD([-Wformat-security])
257 gl_WARN_ADD([-Wignored-qualifiers])
258 gl_WARN_ADD([-Winit-self])
259 gl_WARN_ADD([-Wlogical-op])
260 gl_WARN_ADD([-Wmissing-parameter-type])
261 gl_WARN_ADD([-Wnested-externs])
262 gl_WARN_ADD([-Wold-style-declaration])
263 gl_WARN_ADD([-Wold-style-definition])
264 gl_WARN_ADD([-Wsign-compare])
265 gl_WARN_ADD([-Wtype-limits])
266 gl_WARN_ADD([-Wwrite-strings])
267 AC_ARG_ENABLE([gcc-Werror],
268 [AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
270 yes) gl_WARN_ADD([-Werror]) ;;
272 *) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
275 AC_SUBST([WARN_CFLAGS])
292 AC_CHECK_FUNCS(m4_normalize([
317 AC_CHECK_TYPES([sig_atomic_t, struct sigcontext],,, [#include <signal.h>])
319 AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
321 AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,,
322 [#include <asm/posix_types.h>])
324 AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
325 [#include <sys/types.h>
326 #include <asm/stat.h>])
328 AC_CHECK_TYPES(m4_normalize([
329 struct pt_all_user_regs,
331 struct ptrace_peeksiginfo_args
332 ]),,, [#include <sys/ptrace.h>])
334 AC_CHECK_TYPES(m4_normalize([
337 struct __kernel_flock,
338 struct __kernel_flock64
340 [#include <sys/types.h>
341 #include <linux/fcntl.h>])
343 AC_CHECK_MEMBERS(m4_normalize([
344 struct stat.st_atim.tv_nsec,
345 struct stat.st_ctim.tv_nsec,
346 struct stat.st_mtim.tv_nsec
349 AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
351 AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
353 AC_CHECK_MEMBERS(m4_normalize([
354 struct stat.st_atime_nsec,
355 struct stat.st_ctime_nsec,
356 struct stat.st_mtime_nsec
357 ]),,, [#include <sys/types.h>
358 #include <asm/stat.h>])
360 AC_CHECK_MEMBERS(m4_normalize([
361 siginfo_t.si_syscall,
362 siginfo_t.si_timerid,
364 ]),,, [#include <signal.h>])
366 AC_CHECK_HEADERS(m4_normalize([
369 bluetooth/bluetooth.h
405 AC_CHECK_HEADERS([asm/sigcontext.h],,, [#include <signal.h>])
407 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
409 AC_CHECK_HEADERS([linux/mqueue.h],,, [#include <linux/types.h>])
411 AC_CHECK_HEADERS(m4_normalize([
412 linux/netfilter_arp/arp_tables.h
413 linux/netfilter_bridge/ebtables.h
414 linux/netfilter_ipv4/ip_tables.h
415 linux/netfilter_ipv6/ip6_tables.h
416 ]),,, [#include <netinet/in.h>
417 #include <net/if.h>])
419 AC_CHECK_HEADERS([linux/input.h], [
420 AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
423 AC_CHECK_HEADERS([linux/bpf.h], [
424 AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works],
425 [st_cv_have_union_bpf_attr_log_buf],
427 [AC_LANG_PROGRAM([[#include <linux/bpf.h>]],
428 [[union bpf_attr a = { .log_buf = 0 };]])],
429 [st_cv_have_union_bpf_attr_log_buf=yes],
430 [st_cv_have_union_bpf_attr_log_buf=no])])
431 if test $st_cv_have_union_bpf_attr_log_buf = yes; then
432 AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1],
433 [Define to 1 if union bpf_attr.log_buf initialization works])
437 AC_CHECK_TYPES([struct statfs], [
438 AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include <linux/types.h>
439 #include <asm/statfs.h>])
440 AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include <linux/types.h>
441 #include <asm/statfs.h>])
442 AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include <linux/types.h>
443 #include <asm/statfs.h>])
444 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include <linux/types.h>
445 #include <asm/statfs.h>])
446 ],, [#include <linux/types.h>
447 #include <asm/statfs.h>])
449 AC_CHECK_TYPES([struct statfs64], [
450 AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include <linux/types.h>
451 #include <asm/statfs.h>])
452 AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include <linux/types.h>
453 #include <asm/statfs.h>])
454 AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include <linux/types.h>
455 #include <asm/statfs.h>])
456 AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include <linux/types.h>
457 #include <asm/statfs.h>])
458 ],, [#include <linux/types.h>
459 #include <asm/statfs.h>])
461 AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
463 AC_CHECK_HEADERS([linux/btrfs.h], [
464 AC_CHECK_MEMBERS(m4_normalize([
465 struct btrfs_ioctl_feature_flags.compat_flags,
466 struct btrfs_ioctl_fs_info_args.nodesize,
467 struct btrfs_ioctl_defrag_range_args.start,
468 struct btrfs_ioctl_search_args_v2.buf_size
469 ]),,, [ #include <stdio.h>
470 #include <linux/btrfs.h>])
471 AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
472 BTRFS_COMPRESS_LZO]),,,[ #include <stdio.h>
473 #include <linux/btrfs.h>])])
475 AC_CHECK_DECLS([sys_errlist])
476 AC_CHECK_DECLS(m4_normalize([
479 ]),,, [#include <sys/ptrace.h>])
481 AC_CHECK_DECLS(m4_normalize([
491 ]),,, [#include <sys/wait.h>])
493 AC_CHECK_DECLS(m4_normalize([
497 ]),,, [#include <linux/loop.h>])
499 AC_CHECK_DECLS(m4_normalize([
506 KERN_PRINTK_RATELIMIT,
507 KERN_PRINTK_RATELIMIT_BURST,
510 KERN_SPARC_SCONS_PWROFF,
512 KERN_UNKNOWN_NMI_PANIC,
513 KERN_BOOTLOADER_TYPE,
515 KERN_SETUID_DUMPABLE,
517 KERN_ACPI_VIDEO_FLAGS,
527 NET_CORE_DESTROY_DELAY,
529 NET_CORE_AEVENT_ETIME,
530 NET_CORE_AEVENT_RSEQTH,
532 NET_IPV4_IGMP_MAX_MSF,
533 NET_TCP_NO_METRICS_SAVE,
534 NET_TCP_DEFAULT_WIN_SCALE,
535 NET_TCP_MODERATE_RCVBUF,
536 NET_TCP_TSO_WIN_DIVISOR,
538 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
539 NET_TCP_CONG_CONTROL,
541 NET_IPV4_IPFRAG_MAX_DIST,
544 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
545 NET_TCP_DMA_COPYBREAK,
546 NET_TCP_SLOW_START_AFTER_IDLE,
547 NET_CIPSOV4_CACHE_ENABLE,
548 NET_CIPSOV4_CACHE_BUCKET_SIZE,
549 NET_CIPSOV4_RBM_OPTFMT,
550 NET_CIPSOV4_RBM_STRICTVALID,
551 NET_TCP_AVAIL_CONG_CONTROL,
552 NET_TCP_ALLOWED_CONG_CONTROL,
553 NET_TCP_MAX_SSTHRESH,
554 NET_TCP_FRTO_RESPONSE,
555 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
556 NET_IPV4_CONF_FORCE_IGMP_VERSION,
557 NET_IPV4_CONF_ARP_ANNOUNCE,
558 NET_IPV4_CONF_ARP_IGNORE,
559 NET_IPV4_CONF_PROMOTE_SECONDARIES,
560 NET_IPV4_CONF_ARP_ACCEPT,
561 NET_IPV4_CONF_ARP_NOTIFY,
562 NET_IPV6_MLD_MAX_MSF,
563 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
568 VM_VFS_CACHE_PRESSURE,
570 VM_SWAP_TOKEN_TIMEOUT
572 [#include <sys/types.h>
573 #include <linux/sysctl.h>])
575 AC_CHECK_DECLS(m4_normalize([
580 V4L2_FIELD_INTERLACED,
583 V4L2_FIELD_ALTERNATE,
584 V4L2_FIELD_INTERLACED_TB,
585 V4L2_FIELD_INTERLACED_BT,
586 V4L2_BUF_TYPE_VIDEO_CAPTURE,
587 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
588 V4L2_BUF_TYPE_VIDEO_OUTPUT,
589 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
590 V4L2_BUF_TYPE_VIDEO_OVERLAY,
591 V4L2_BUF_TYPE_VBI_CAPTURE,
592 V4L2_BUF_TYPE_VBI_OUTPUT,
593 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE,
594 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,
595 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY,
597 V4L2_TUNER_ANALOG_TV,
598 V4L2_TUNER_DIGITAL_TV,
603 V4L2_COLORSPACE_SMPTE170M,
604 V4L2_COLORSPACE_SMPTE240M,
605 V4L2_COLORSPACE_REC709,
606 V4L2_COLORSPACE_BT878,
607 V4L2_COLORSPACE_470_SYSTEM_M,
608 V4L2_COLORSPACE_470_SYSTEM_BG,
609 V4L2_COLORSPACE_JPEG,
610 V4L2_COLORSPACE_SRGB,
612 V4L2_PRIORITY_BACKGROUND,
613 V4L2_PRIORITY_INTERACTIVE,
614 V4L2_PRIORITY_RECORD,
615 V4L2_FRMSIZE_TYPE_DISCRETE,
616 V4L2_FRMSIZE_TYPE_CONTINUOUS,
617 V4L2_FRMSIZE_TYPE_STEPWISE,
618 V4L2_FRMIVAL_TYPE_DISCRETE,
619 V4L2_FRMIVAL_TYPE_CONTINUOUS,
620 V4L2_FRMIVAL_TYPE_STEPWISE,
621 V4L2_CTRL_TYPE_INTEGER,
622 V4L2_CTRL_TYPE_BOOLEAN,
624 V4L2_CTRL_TYPE_BUTTON,
625 V4L2_CTRL_TYPE_INTEGER64,
626 V4L2_CTRL_TYPE_CTRL_CLASS,
627 V4L2_CTRL_TYPE_STRING,
628 V4L2_CTRL_TYPE_BITMASK,
629 V4L2_CTRL_TYPE_INTEGER_MENU
630 ]),,, [#include <sys/time.h>
631 #include <linux/ioctl.h>
632 #include <linux/types.h>
633 #include <linux/videodev2.h>])
635 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
636 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
638 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
639 [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
640 if test $ac_cv_have_blkgetsize64 = yes; then
641 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
644 AC_CHECK_SIZEOF([long])
645 AC_CHECK_SIZEOF([long long])
646 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
647 AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
649 AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
650 [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
651 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
653 test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]])
654 if test "x$st_cv_SIGRTMIN" != xno; then
655 AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN],
656 [SIGRTMIN defined in <asm/signal.h>])
658 AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER],
659 [st_cv_SA_RESTORER="$(echo SA_RESTORER |
660 $CPP $CPPFLAGS -P -imacros asm/signal.h - |
662 test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no])
663 if test "x$st_cv_SA_RESTORER" != xno; then
664 AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER],
665 [SA_RESTORER defined in <asm/signal.h>])
668 AC_CACHE_CHECK([for __builtin_popcount], [st_cv_have___builtin_popcount],
669 [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_popcount(0)])],
670 [st_cv_have___builtin_popcount=yes],
671 [st_cv_have___builtin_popcount=no])])
672 if test "x$st_cv_have___builtin_popcount" = xyes; then
673 AC_DEFINE([HAVE___BUILTIN_POPCOUNT], [1],
674 [Define to 1 if the system provides __builtin_popcount function])
677 AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
678 if test "x$ac_cv_lib_dl_dladdr" = xyes; then
679 AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
683 AC_PATH_PROG([PERL], [perl])
685 dnl stack trace with libunwind
689 AC_ARG_WITH([libunwind],
690 [AS_HELP_STRING([--with-libunwind],
691 [use libunwind to implement stack tracing support])],
692 [case "${withval}" in
694 *) with_libunwind=yes
695 libunwind_CPPFLAGS="-I${withval}/include"
696 libunwind_LDFLAGS="-L${withval}/lib" ;;
698 [with_libunwind=check]
702 AS_IF([test "x$with_libunwind" != xno],
703 [saved_CPPFLAGS="$CPPFLAGS"
704 CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
706 AC_CHECK_HEADERS([libunwind-ptrace.h],
707 [saved_LDFLAGS="$LDFLAGS"
708 LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
710 AC_CHECK_LIB([unwind], [backtrace],
711 [libunwind_LIBS="-lunwind $libunwind_LIBS"
713 AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
715 LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
718 [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
719 [[return !unw_create_addr_space(0, 0)]])
721 [AC_MSG_RESULT([yes])
722 libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
724 AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
725 [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
728 [if test "x$with_libunwind" != xcheck; then
729 AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
736 if test "x$with_libunwind" != xcheck; then
737 AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
744 [if test "x$with_libunwind" != xcheck; then
745 AC_MSG_FAILURE([failed to find libunwind])
751 LDFLAGS="$saved_LDFLAGS"
753 [if test "x$with_libunwind" != xcheck; then
754 AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
759 CPPFLAGS="$saved_CPPFLAGS"
764 AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
765 if test "x$use_libunwind" = xyes; then
766 AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
767 AC_SUBST(libunwind_LIBS)
768 AC_SUBST(libunwind_LDFLAGS)
769 AC_SUBST(libunwind_CPPFLAGS)
771 AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
772 AC_MSG_RESULT([$use_libunwind])
774 if test "$arch" = mips && test "$no_create" != yes; then
776 if $srcdir/linux/mips/genstub.sh linux/mips; then
777 AC_MSG_RESULT([Generated MIPS syscallent stubs])
779 AC_MSG_FAILURE([Failed to generate syscallent stubs])
783 st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
784 st_MPERS([mx32], [x86_64])
786 AC_CONFIG_FILES([Makefile