X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=ef1680fe7c63a80f340181327cc403de773f6d44;hb=1d63737e083d7c1f6a3f44e4021998ddc4bda1a2;hp=47397e988c9b6c854d537a212b8514de0f7a76a1;hpb=d065fbe654b1185bf962b2a58b04223db39786fb;p=gitmo%2FClass-MOP.git diff --git a/Makefile.PL b/Makefile.PL index 47397e9..ef1680f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,7 +10,9 @@ perl_version '5.008001'; all_from 'lib/Class/MOP.pm'; license 'perl'; -my $ccflags = -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE} ? '-Wall' : ''; +require Config; +my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.'; +$ccflags .= ' -Wall' if -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE}; requires 'Carp'; requires 'Devel::GlobalDestruction'; @@ -25,6 +27,35 @@ test_requires 'Test::Exception' => '0.21'; makemaker_args( CCFLAGS => $ccflags ); +{ + my (@clean, @OBJECT, %XS); + + for my $xs () { + (my $c = $xs) =~ s/\.xs$/.c/i; + (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i; + + $XS{$xs} = $c; + push @OBJECT, $o; + push @clean, $o; + } + + for my $c (<*.c>) { + (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i; + push @OBJECT, $o; + push @clean, $o; + } + + makemaker_args( + clean => { FILES => join(q{ }, @clean) }, + OBJECT => join (q{ }, @OBJECT), + XS => \%XS, + ); +} + +postamble(<<'EOM'); +$(OBJECT) : mop.h +EOM + WriteAll(); # Use the cpan-smolder-stable script in the Moose svn root to figure @@ -32,7 +63,7 @@ WriteAll(); # before a release. sub check_conflicts { my %conflicts = ( - 'Moose' => '0.71', + 'Moose' => '0.72', ); my $found = 0; @@ -67,3 +98,22 @@ EOF sleep 4; } + +package MY; + +use Config; + +sub const_cccmd { + my $ret = shift->SUPER::const_cccmd(@_); + return q{} unless $ret; + + if ($Config{cc} =~ /^cl\b/i) { + warn 'you are using MSVC... my condolences.'; + $ret .= ' /Fo$@'; + } + else { + $ret .= ' -o $@'; + } + + return $ret; +}