5 use ExtUtils::MakeMaker;
9 eval { require Config };
10 die 'OS unsupported' if $@;
11 Config->import(qw/%Config/);
12 eval { require File::Spec };
13 die 'OS unsupported' if $@;
14 $has_version_pm = eval "require version; 1" || 0;
18 print 'Checking for valgrind ' . ('>= 3.1.0 ' x $has_version_pm) .'in PATH... ';
19 require Test::Valgrind::Session;
21 Test::Valgrind::Session->new((min_version => '3.1.0') x $has_version_pm)
31 # Inspired from Module::Install::Can
32 print "Checking for a valid C compiler in the PATH... ";
33 my @ccs = ($Config{cc});
34 unshift @ccs, $ENV{CC} if $ENV{CC};
35 my @path = File::Spec->path;
38 File::Spec->file_name_is_absolute($cc)
40 : map File::Spec->catfile($_, $cc), @path
45 if (-x $cc or MM->maybe_command($cc)) {
52 my $xs = 'Valgrind.xs';
53 (my $c = $xs) =~ s/\.xs$/.c/;
64 'File::HomeDir' => '0.86',
70 'Perl::Destruct::Level' => 0,
77 my $dist = 'Test-Valgrind';
80 configure_requires => {
83 'ExtUtils::MakeMaker' => 0,
91 'ExtUtils::MakeMaker' => 0,
100 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
101 homepage => "http://search.cpan.org/dist/$dist/",
102 license => 'http://dev.perl.org/licenses/',
103 repository => "http://git.profvince.com/perl/modules/$dist.git",
108 NAME => 'Test::Valgrind',
109 AUTHOR => 'Vincent Pit <perl@profvince.com>',
111 VERSION_FROM => 'lib/Test/Valgrind.pm',
112 ABSTRACT_FROM => 'lib/Test/Valgrind.pm',
115 PREREQ_PM => \%PREREQ_PM,
116 MIN_PERL_VERSION => 5.006,
117 META_MERGE => \%META,
119 PREOP => 'pod2text lib/Test/Valgrind.pm > $(DISTVNAME)/README',
120 COMPRESS => 'gzip -9f', SUFFIX => 'gz',
123 FILES => "$dist-* Makefile.bak *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"