File: Makefile.PL

package info (click to toggle)
libapp-stacktrace-perl 0.09-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 560 kB
  • sloc: perl: 297; ansic: 37; makefile: 3
file content (35 lines) | stat: -rw-r--r-- 719 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use 5.010_000;
use ExtUtils::MakeMaker;

if (! usable_gdb()) {
    print "App::Stacktrace requires gdb. Aborting installation";
    exit 0;
}

WriteMakefile(
  ABSTRACT_FROM => 'lib/App/Stacktrace.pm',
  AUTHOR => 'Josh Jore <jjore@cpan.org>',
  EXE_FILES => [
    'bin/perl-stacktrace'
  ],
  $ExtUtils::MakeMaker::VERSION >= 6.30
      ? (LICENSE => 'perl')
      : (),
  NAME => 'App::Stacktrace',
  VERSION_FROM => 'lib/App/Stacktrace.pm',
);

sub usable_gdb {
    require File::Temp;
    my $fh = File::Temp->new();

    print { $fh } <<SCRIPT;
run -e 1
quit
SCRIPT
    $fh->flush;
    $fh->sync;

    my $fn = $fh->filename;
    return 0 == system "gdb -quiet -batch -nx -x $fn $^X >/dev/null 2>&1 </dev/null";
}