5 use ExtUtils::MakeMaker;
7 my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 };
8 my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 };
11 'Test::More' => '0.88',
15 'Package::Stash' => '0.23',
16 'B::Hooks::EndOfScope' => '0.12',
19 # these pieces are needed if using the debugger on the perl range
20 my %OPT_RUN_DEPS = ( $] > 5.008_008_9 and $] < 5.013_005_1 and can_xs() )
21 # when changing versions, also change $sn_ver and $si_ver in namespace/clean.pm
22 ? ( 'Sub::Name' => '0.04', 'Sub::Identify' => '0.04' ) : ()
27 homepage => 'http://search.cpan.org/dist/namespace-clean',
29 # EUMM not supporting nested meta :(
32 # url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
33 # web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/namespace-clean.git',
36 # mailto => 'bug-namespace-clean@rt.cpan.org',
37 # web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
40 repository => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
41 bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
45 my %WriteMakefileArgs = (
46 'NAME' => 'namespace::clean',
47 'VERSION_FROM' => 'lib/namespace/clean.pm',
48 'ABSTRACT' => 'Keep imports and functions out of your namespace',
49 'AUTHOR' => 'Robert \'phaylon\' Sedlacek <rs@474.at>, Florian Ragwitz <rafl@debian.org>, Jesse Luehrs <doy@tozt.net>',
50 'CONFIGURE_REQUIRES' => { 'ExtUtils::CBuilder' => 0.27 },
52 %RUN_DEPS, %OPT_RUN_DEPS,
53 $mymeta_works ? () : (%BUILD_DEPS),
57 ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
58 'BUILD_REQUIRES' => \%BUILD_DEPS,
61 requires => \%RUN_DEPS,
64 : ( # META_ADD both to get META right - only Makefile written
67 requires => \%RUN_DEPS,
68 build_requires => \%BUILD_DEPS,
73 ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (),
79 unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) {
80 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
81 my $pp = $WriteMakefileArgs{PREREQ_PM};
82 for my $mod ( keys %$br ) {
83 if ( exists $pp->{$mod} ) {
84 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
87 $pp->{$mod} = $br->{$mod};
92 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
93 unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
95 WriteMakefile(%WriteMakefileArgs);
97 # Secondary compile testing via ExtUtils::CBuilder
99 # Do we have the configure_requires checker?
101 eval "require ExtUtils::CBuilder;";
103 # They don't obey configure_requires, so it is
104 # someone old and delicate. Try to avoid hurting
105 # them by falling back to an older simpler test.
109 return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler;
112 # can we locate a (the) C compiler
114 my @chunks = split(/ /, $Config::Config{cc}) or return;
116 # $Config{cc} may contain args; try to find out the program part
118 return can_run("@chunks") || (pop(@chunks), next);
124 # check if we can run some command
128 return $cmd if -x $cmd;
129 if (my $found_cmd = MM->maybe_command($cmd)) {
133 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
135 my $abs = File::Spec->catfile($dir, $cmd);
136 return $abs if (-x $abs or $abs = MM->maybe_command($abs));