On Mon, Jul 08, 2013 at 10:28:33PM -0700, Luca Clementi wrote: > On Mon, Jul 8, 2013 at 3:08 PM, Dmitry V. Levin <[email protected]> wrote: > > 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. > > Sorry that's a leftover from previous tests.
Also,
- there should be no need to use ${AM_CPPFLAGS} in configure.ac;
- autoconf documentation suggest using "check" instead of "maybe";
- with_libunwind=$withval is a no-op.
> >> + 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.
>
> But I enter this "if" block only if I find the headers.
> My default is: if no option is given and the headers are found it's
> like if you use --with-libunwind (then you can use --with-libunwind=no
> to disable that).
> Is that wrong?
It's not obvious for me why presence of these two header files means
--with-libunwind. I thought the default behaviour (for the case when
neither --with-libunwind nor --without-libunwind is given) would be
--without-libunwind if no suitable libunwind found, and --with-libunwind
otherwise.
--
ldv
pgpI4_4O_JlZK.pgp
Description: PGP signature
------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
