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 # a sub-namer is needed if using the debugger on some perls
20 my %OPT_RUN_DEPS = ( (
21 require 'lib/namespace/clean/_Util.pm'
23 namespace::clean::_Util::DEBUGGER_NEEDS_CV_RENAME()
25 namespace::clean::_Util::_namer_load_error()
29 # when changing version, also change $sn_ver in namespace/clean/_Util.pm
30 ? ( 'Sub::Name' => '0.04' )
36 homepage => 'http://search.cpan.org/dist/namespace-clean',
38 # EUMM not supporting nested meta :(
41 # url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
42 # web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/namespace-clean.git',
45 # mailto => 'bug-namespace-clean@rt.cpan.org',
46 # web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
49 repository => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
50 bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
54 my %WriteMakefileArgs = (
55 'NAME' => 'namespace::clean',
56 'VERSION_FROM' => 'lib/namespace/clean.pm',
57 'ABSTRACT' => 'Keep imports and functions out of your namespace',
58 'AUTHOR' => 'Robert \'phaylon\' Sedlacek <rs@474.at>, Florian Ragwitz <rafl@debian.org>, Jesse Luehrs <doy@tozt.net>',
59 'CONFIGURE_REQUIRES' => { 'ExtUtils::CBuilder' => 0.27 },
61 %RUN_DEPS, %OPT_RUN_DEPS,
62 $mymeta_works ? () : (%BUILD_DEPS),
66 ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
67 'BUILD_REQUIRES' => \%BUILD_DEPS,
70 requires => \%RUN_DEPS,
73 : ( # META_ADD both to get META right - only Makefile written
76 requires => \%RUN_DEPS,
77 build_requires => \%BUILD_DEPS,
82 ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (),
88 unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) {
89 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
90 my $pp = $WriteMakefileArgs{PREREQ_PM};
91 for my $mod ( keys %$br ) {
92 if ( exists $pp->{$mod} ) {
93 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
96 $pp->{$mod} = $br->{$mod};
101 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
102 unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
104 WriteMakefile(%WriteMakefileArgs);
106 # Secondary compile testing via ExtUtils::CBuilder
108 # Do we have the configure_requires checker?
110 eval "require ExtUtils::CBuilder;";
112 # They don't obey configure_requires, so it is
113 # someone old and delicate. Try to avoid hurting
114 # them by falling back to an older simpler test.
118 return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler;
121 # can we locate a (the) C compiler
123 my @chunks = split(/ /, $Config::Config{cc}) or return;
125 # $Config{cc} may contain args; try to find out the program part
127 return can_run("@chunks") || (pop(@chunks), next);
133 # check if we can run some command
137 return $cmd if -x $cmd;
138 if (my $found_cmd = MM->maybe_command($cmd)) {
142 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
144 my $abs = File::Spec->catfile($dir, $cmd);
145 return $abs if (-x $abs or $abs = MM->maybe_command($abs));