X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=c0af551634df3b7064422745a5cb6189303062f5;hb=3f3e009e602ec89c1f724e3fabef114ddf68e6d3;hp=47397e988c9b6c854d537a212b8514de0f7a76a1;hpb=d065fbe654b1185bf962b2a58b04223db39786fb;p=gitmo%2FClass-MOP.git diff --git a/Makefile.PL b/Makefile.PL index 47397e9..c0af551 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,60 +10,88 @@ perl_version '5.008001'; all_from 'lib/Class/MOP.pm'; license 'perl'; -my $ccflags = -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE} ? '-Wall' : ''; +my %conflicts = ( + 'Moose' => '1.04', +); + +check_conflicts(%conflicts); + +require Config; +my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.'; + +if ( -d '.git' || $ENV{MAINTAINER_MODE} ) { + $ccflags .= ' -Wall -Wdeclaration-after-statement'; +} requires 'Carp'; +requires 'Data::OptList'; requires 'Devel::GlobalDestruction'; +requires 'List::MoreUtils' => '0.12'; requires 'MRO::Compat' => '0.05'; +requires 'Package::DeprecationManager' => '0.04'; +requires 'Package::Stash'; requires 'Scalar::Util' => '1.18'; requires 'Sub::Name' => '0.04'; +requires 'Try::Tiny' => '0.02'; requires 'Task::Weaken'; test_requires 'File::Spec'; -test_requires 'Test::More' => '0.77'; -test_requires 'Test::Exception' => '0.21'; +test_requires 'Test::More' => '0.88'; +test_requires 'Test::Exception' => '0.27'; + +repository 'git://git.moose.perl.org/Class-MOP.git'; +add_metadata(x_authority => 'cpan:STEVAN'); + +extra_tests(); makemaker_args( CCFLAGS => $ccflags ); -WriteAll(); +{ + my (@clean, @OBJECT, %XS); -# Use the cpan-smolder-stable script in the Moose svn root to figure -# out what on CPAN will break with the latest Moose, then update this -# before a release. -sub check_conflicts { - my %conflicts = ( - 'Moose' => '0.71', - ); + for my $xs () { + (my $c = $xs) =~ s/\.xs$/.c/i; + (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i; - my $found = 0; - for my $mod ( sort keys %conflicts ) { - eval "require $mod"; - next if $@; + $XS{$xs} = $c; + push @OBJECT, $o; + push @clean, $o; + } - my $installed = $mod->VERSION(); - if ( $installed le $conflicts{$mod} ) { + for my $c (<*.c>) { + (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i; + push @OBJECT, $o; + push @clean, $o; + } - print <<"EOF"; + makemaker_args( + clean => { FILES => join(q{ }, @clean) }, + OBJECT => join (q{ }, @OBJECT), + XS => \%XS, + ); +} -*** - This version of Class::MOP conflicts with the version of - $mod ($installed) you have installed. +postamble(<<'EOM'); +$(OBJECT) : mop.h +EOM - You will need to upgrade $mod after installing - this version of Class::MOP. -*** +WriteAll(); -EOF +package MY; - $found = 1; - } - } +use Config; - return unless $found; +sub const_cccmd { + my $ret = shift->SUPER::const_cccmd(@_); + return q{} unless $ret; - # More or less copied from Module::Build - return if $ENV{PERL_MM_USE_DEFAULT}; - return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); + if ($Config{cc} =~ /^cl\b/i) { + warn 'you are using MSVC... my condolences.'; + $ret .= ' /Fo$@'; + } + else { + $ret .= ' -o $@'; + } - sleep 4; + return $ret; }