X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=b33841364923a66f347163230e2f44be0936f346;hb=d2aeefa7bf3fa14fba310493270a54a4c242723c;hp=04ccf9479fd744543705d804eb29fa5e096337ab;hpb=20fb52e2ea25c283108287f6e545bb7203c3ba27;p=gitmo%2FMoose.git diff --git a/Makefile.PL b/Makefile.PL index 04ccf94..b338413 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,77 +1,76 @@ use strict; use warnings; -use inc::Module::Install; -use 5.008001; - -check_conflicts(); - -name 'Moose'; -perl_version '5.008001'; -all_from 'lib/Moose.pm'; -license 'perl'; - -requires 'Scalar::Util' => '1.19'; -requires 'Carp'; -requires 'Class::MOP' => '0.83'; -requires 'List::MoreUtils' => '0.12'; -requires 'Sub::Exporter' => '0.972'; -requires 'Task::Weaken' => '0'; -requires 'Data::OptList' => '0'; -requires 'Sub::Name' => '0'; - -test_requires 'Test::More' => '0.77'; -test_requires 'Test::Exception' => '0.27'; - -if ( -d '.svn' || -d '.git' || $ENV{IS_MAINTAINER} ) { - system( $^X, 'author/extract-inline-tests' ); -} - -extra_tests(); -tests_recursive(); - -WriteAll(); - -# 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 = ( - 'MooseX::ClassAttribute' => '0.07', - 'MooseX::Singleton' => '0.15', - 'MooseX::StrictConstructor' => '0.07', - 'MooseX::Params::Validate' => '0.05', - 'Fey::ORM' => '0.23', - ); - my $found = 0; - for my $mod ( sort keys %conflicts ) { - eval "require $mod"; - next if $@; +use Config; +use ExtUtils::MakeMaker; - my $installed = $mod->VERSION(); - if ( $installed le $conflicts{$mod} ) { +warn <<'EOF'; - print <<"EOF"; + ********************************* WARNING ********************************** -*** - This version of Moose conflicts with the version of - $mod ($installed) you have installed. + This module uses Dist::Zilla for development. This Makefile.PL will let you + run the tests, but you are encouraged to install Dist::Zilla and the needed + plugins if you intend on doing any serious hacking. - You will need to upgrade $mod after installing - this version of Moose. -*** + **************************************************************************** EOF - $found = 1; - } +my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.'; +$ccflags .= ' -Wall -Wdeclaration-after-statement'; + +my %mm = ( CCFLAGS => $ccflags ); + +{ + my (@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; } - return unless $found; + for my $c (<*.c>) { + (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i; + push @OBJECT, $o; + } + + %mm = ( + %mm, + clean => { FILES => join( q{ }, @OBJECT ) }, + OBJECT => join( q{ }, @OBJECT ), + XS => \%XS, + ); +} + +WriteMakefile( + NAME => 'Moose', + %mm, +); + +package MY; + +use Config; + +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; +} + +sub postamble { + return <<'EOF'; +$(OBJECT) : mop.h +EOF }