]> granicus.if.org Git - strace/blobdiff - configure.ac
print_array: enhance printing of unfetchable object addresses
[strace] / configure.ac
index c2d1be7f07c0f73b8722aebcaae82d1ee313bed3..231a861b3e3a95037b39658835af4157e84e6f80 100644 (file)
@@ -5,7 +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-2017 The strace developers.
+# Copyright (c) 2002-2018 The strace developers.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@
 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])
 m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year]))
@@ -46,9 +46,9 @@ 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
@@ -322,7 +322,9 @@ 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>])
@@ -382,7 +384,6 @@ AC_CHECK_HEADERS(m4_normalize([
        asm/cachectl.h
        asm/guarded_storage.h
        asm/sysmips.h
-       bluetooth/bluetooth.h
        elf.h
        iconv.h
        inttypes.h
@@ -436,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
@@ -466,16 +466,14 @@ AC_CHECK_HEADERS([linux/input.h], [
 ])
 
 AC_CHECK_HEADERS([linux/bpf.h], [
-       AC_CHECK_MEMBERS(m4_normalize([
-               union bpf_attr.attach_flags,
-               union bpf_attr.bpf_fd,
-               union bpf_attr.flags,
-               union bpf_attr.info.info,
-               union bpf_attr.next_id,
-               union bpf_attr.numa_node,
-               union bpf_attr.prog_flags,
-               union bpf_attr.test.duration
-       ]),,, [#include <linux/bpf.h>])
+       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([
@@ -566,7 +564,8 @@ AC_CHECK_HEADERS([linux/btrfs.h], [
                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,
@@ -755,11 +754,16 @@ 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 - |
@@ -798,158 +802,74 @@ if test "x$st_cv_have_program_invocation_name" = xyes; then
                  [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])
 
 AC_CHECK_TOOL([READELF], [readelf])
 
-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])
-
-dnl demangling symbols in the stack trace
-libiberty_CPPFLAGS=
-libiberty_LDFLAGS=
-libiberty_LIBS=
-AC_ARG_WITH([libiberty],
-           [AS_HELP_STRING([--with-libiberty],
-                           [use libiberty to demangle symbols in stack trace])],
-           [case "${withval}" in
-            yes|no|check) ;;
-            *) with_libiberty=yes
-               libiberty_CPPFLAGS="-I${withval}/include"
-               libiberty_LDFLAGS="-L${withval}/lib" ;;
-            esac],
-           [with_libiberty=check]
-)
-
-use_libiberty=no
-AS_IF([test "x$use_libunwind" = xyes && test "x$with_libiberty" != xno],
-      [saved_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS"
-       AC_CHECK_HEADERS([demangle.h libiberty/demangle.h],
-        [saved_LDFLAGS="$LDFLAGS"
-         LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
-         AC_CHECK_LIB([iberty],[cplus_demangle],
-           [libiberty_LIBS="-liberty"
-            use_libiberty=yes
-           ],
-           [if test "x$with_libiberty" != xcheck; then
-              AC_MSG_FAILURE([failed to find cplus_demangle in libiberty])
-            fi
-           ]
-         )
-         LDFLAGS="$saved_LDFLAGS"
-        ],
-        [if test "x$with_libiberty" != xcheck; then
-             AC_MSG_FAILURE([failed to find demangle.h])
-         fi
-        ]
-       )
-       CPPFLAGS="$saved_CPPFLAGS"
-      ]
-)
-
-dnl enable libiberty
-AC_MSG_CHECKING([whether to enable demangling symbols in stack trace])
-if test "x$use_libiberty" = xyes; then
-       AC_DEFINE([USE_DEMANGLE], 1, [Do demangling symbols in stack trace])
-       AC_SUBST(libiberty_LIBS)
-       AC_SUBST(libiberty_LDFLAGS)
-       AC_SUBST(libiberty_CPPFLAGS)
-fi
-AM_CONDITIONAL([USE_DEMANGLE], [test "x$use_libiberty" = xyes])
-AC_MSG_RESULT([$use_libiberty])
+st_STACKTRACE
 
 if test "$arch" = mips && test "$no_create" != yes; then
        mkdir -p linux/mips