]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blob - Makefile.PL
Give an explicit value to dynamic_config
[perl/modules/Test-Valgrind.git] / Makefile.PL
1 use 5.006;
2
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 BEGIN {
8  eval { require Config };
9  die 'OS unsupported' if $@;
10  Config->import(qw/%Config/);
11  eval { require File::Spec };
12  die 'OS unsupported' if $@;
13 }
14
15 # Inspired from Module::Install::Can
16 print "Checking for a valid C compiler in the PATH... ";
17 my @ccs = ($Config{cc});
18 unshift @ccs, $ENV{CC} if $ENV{CC};
19 my @path = File::Spec->path;
20 @ccs = map {
21  my $cc = $_;
22  File::Spec->file_name_is_absolute($cc)
23    ? $cc
24    : map File::Spec->catfile($_, $cc), @path
25 } @ccs;
26 my $has_cc;
27 CC:
28 for my $cc (@ccs) {
29  if (-x $cc or MM->maybe_command($cc)) {
30   $has_cc = $cc;
31   last CC;
32  }
33 }
34 my (@C);
35 if ($has_cc) {
36  my $xs = 'Valgrind.xs';
37  (my $c = $xs) =~ s/\.xs$/.c/;
38  push @C, $c;
39  print $has_cc, "\n";
40 } else {
41  print "none\n";
42 }
43
44 my %PREREQ_PM = (
45  'Carp'                  => 0,
46  'Digest::MD5'           => 0,
47  'Env::Sanctify'         => 0,
48  'File::HomeDir'         => '0.86',
49  'File::Path'            => 0,
50  'File::Spec'            => 0,
51  'File::Temp'            => '0.14', # OO interface
52  'Filter::Util::Call'    => 0,
53  'Fcntl'                 => 0,
54  'List::Util'            => 0,
55  'POSIX'                 => 0,
56  'Perl::Destruct::Level' => 0,
57  'Scalar::Util'          => 0,
58  'Test::Builder'         => 0,
59  'Test::More'            => 0,
60  'XML::Twig'             => 0,
61  'base'                  => 0,
62  'version'               => 0,
63 );
64
65 my $dist = 'Test-Valgrind';
66
67 my %META = (
68  configure_requires => {
69   'File::Spec'          => 0,
70   'ExtUtils::MakeMaker' => 0,
71  },
72  build_requires => {
73   'ExtUtils::MakeMaker' => 0,
74   'Test::More'          => 0,
75   %PREREQ_PM,
76  },
77  recommends => {
78   'DynaLoader' => 0,
79   'XSLoader'   => 0,
80  },
81  dynamic_config => 1,
82  resources => {
83   bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
84   homepage   => "http://search.cpan.org/dist/$dist/",
85   license    => 'http://dev.perl.org/licenses/',
86   repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
87  },
88 );
89
90 WriteMakefile(
91     NAME             => 'Test::Valgrind',
92     AUTHOR           => 'Vincent Pit <perl@profvince.com>',
93     LICENSE          => 'perl',
94     VERSION_FROM     => 'lib/Test/Valgrind.pm',
95     ABSTRACT_FROM    => 'lib/Test/Valgrind.pm',
96     OPTIMIZE         => '-g',
97     C                => \@C,
98     PREREQ_PM        => \%PREREQ_PM,
99     MIN_PERL_VERSION => 5.006,
100     META_MERGE       => \%META,
101     dist             => {
102         PREOP    => 'pod2text lib/Test/Valgrind.pm > $(DISTVNAME)/README',
103         COMPRESS => 'gzip -9f', SUFFIX => 'gz',
104     },
105     clean            => {
106         FILES => "$dist-* Makefile.bak *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
107     },
108 );