X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=729eee290fa5be8d93cead33fd2e12a7ec3678df;hb=6807578c3cce97e7626dfac0ae9d8e4282b2e012;hp=35f9d2ae360762683f750520719437bacf126f9d;hpb=d7d45396f5a2776ad99df4867d2f6067b661d036;p=gitmo%2FClass-MOP.git diff --git a/Makefile.PL b/Makefile.PL index 35f9d2a..729eee2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -22,10 +22,12 @@ requires 'Sub::Name' => '0.04'; requires 'Task::Weaken'; test_requires 'File::Spec'; -test_requires 'Test::More' => '0.77'; +test_requires 'Test::More' => '0.88'; test_requires 'Test::Exception' => '0.27'; -extra_tests(); +install_headers('mop.h'); # need Module::Install::XSUtil + +#extra_tests(); makemaker_args( CCFLAGS => $ccflags ); @@ -65,16 +67,19 @@ WriteAll(); # before a release. sub check_conflicts { my %conflicts = ( - 'Moose' => '0.81', + 'Moose' => '0.85', ); + my $has_module_info = eval{ require Module::Info }; + my $get_version = $has_module_info + ? sub{ Module::Info->new_from_module($_[0])->version } + : sub{ eval qq{ require $_[0] } ? $_[0]->VERSION : undef }; + my $found = 0; for my $mod ( sort keys %conflicts ) { - eval "require $mod"; - next if $@; + my $installed = $get_version->($mod); - my $installed = $mod->VERSION(); - if ( $installed le $conflicts{$mod} ) { + if ( defined($installed) && $installed le $conflicts{$mod} ) { print <<"EOF";