On Mon, Jul 08, 2013 at 12:24:14AM -0700, Luca Clementi wrote:
[...]
> --- a/configure.ac
> +++ b/configure.ac
> @@ -261,6 +261,63 @@ AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include 
> <signal.h>
>  # include <asm/sigcontext.h>
>  #endif])
>  
> +
> +dnl stack trace with libunwind
> +AC_ARG_WITH([libunwind],
> +         [AS_HELP_STRING([--with-libunwind],
> +                         [libunwind is used to display system call 
> stacktrace])],
> +         [case "${withval}" in
> +          (yes|no) enable_libunwind=$withval;;
> +          (*)      enable_libunwind=yes
> +                   libunwind_CPPFLAGS="${AM_CPPFLAGS} -I${withval}/include"
> +                   libunwind_LDFLAGS="-L${withval}/lib" ;;
> +          esac],
> +         [enable_libunwind=maybe])

If the option is called --with-libunwind, then the options's argument
variable should be called with_libunwind.  BTW, do you really need this
libunwind_CPPFLAGS/libunwind_LDFLAGS stuff?  Wouldn't a simple tristate
(yes|no|check) be enough?

> +AS_IF([test "x$enable_libunwind" != xno],
> +     [saved_CPPFLAGS="${CPPFLAGS}"
> +     CPPFLAGS="${CPPFLAGS} ${libunwind_CPPFLAGS}"
> +     AC_CHECK_HEADERS([libunwind-ptrace.h libunwind.h])
> +     CPPFLAGS="${saved_CPPFLAGS}" ])
> +
> +if test "x$ac_cv_header_libunwind_ptrace_h" = "xyes" &&
> +     test "x$ac_cv_header_libunwind_h" = "xyes"; then

If --with-libunwind was given and one of these header files is not
available, configure should fail.

> +     dnl code is taken from ltrace
> +     case "${host_cpu}" in
> +             arm*|sa110)         UNWIND_ARCH="arm" ;;
> +             i?86)               UNWIND_ARCH="x86" ;;
> +             powerpc)            UNWIND_ARCH="ppc32" ;;
> +             powerpc64)          UNWIND_ARCH="ppc64" ;;
> +             mips*)              UNWIND_ARCH="mips" ;;
> +             *)                  UNWIND_ARCH="${host_cpu}" ;;
> +     esac
> +
> +     saved_LDFLAGS="${LDFLAGS}"
> +     LDFLAGS="${LDFLAGS} ${libunwind_LDFLAGS}"
> +     AC_CHECK_LIB([unwind], [backtrace],
> +                  [libunwind_LIBS="-lunwind"],
> +                  [AC_MSG_FAILURE([Unable to find libunwind])])
> +        AC_CHECK_LIB([unwind-generic], [_U${UNWIND_ARCH}_create_addr_space],
> +                  [libunwind_LIBS="-lunwind-generic $libunwind_LIBS"],
> +                  [AC_MSG_FAILURE([Unable to find libunwind-generic])],
> +                  [$libunwind_LIBS])
> +     AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
> +                  [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"],
> +                  [AC_MSG_FAILURE([Unable to find libunwind-ptrace])],
> +                  [$libunwind_LIBS])
> +     LDFLAGS="${saved_LDFLAGS}"

If --with-libunwind was not given and one of these symbols is not
available, configure should not fail.


-- 
ldv

Attachment: pgpRt1pu5xfbb.pgp
Description: PGP signature

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to