1 # Copyright (C) 2001-2007, The Perl Foundation.
6 config/auto/backtrace.pm - GNU C Compiler
10 Determines whether libc has the backtrace* functions. The backtrace() and
11 backtrace_symbols() functions exist in GNU libc, and also in OS X versions
16 package auto
::backtrace
;
21 use base
qw(Parrot::Configure::Step);
23 use Parrot
::Configure
::Utils
':auto';
29 $data{description
} = q{Determining whether libc has the backtrace* functions};
35 my ( $self, $conf ) = @_;
37 my $anyerror = _probe_for_backtrace
($conf);
39 $self->_evaluate_backtrace($conf, $anyerror);
44 sub _probe_for_backtrace
{
46 $conf->cc_gen("config/auto/backtrace/test_c.in");
48 # If the program builds (e.g. the linker found backtrace* in libc)
49 # then we have the "backtrace" and "backtrace_symbols" functions. If the
50 # program fails to build for whatever reason we're just going to assume
51 # that the build failure is because these symbols are missing.
53 eval { $conf->cc_build(); };
59 sub _evaluate_backtrace
{
60 my ($self, $conf, $anyerror) = @_;
62 $self->set_result("no");
65 $conf->data->set( backtrace
=> 1 );
66 $self->set_result("yes");
74 # cperl-indent-level: 4
77 # vim: expandtab shiftwidth=4: