3 use inc::Module::Install;
9 perl_version '5.008001';
10 all_from 'lib/Class/MOP.pm';
14 my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.';
15 $ccflags .= ' -Wall' if -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE};
18 requires 'Devel::GlobalDestruction';
19 requires 'MRO::Compat' => '0.05';
20 requires 'Scalar::Util' => '1.18';
21 requires 'Sub::Name' => '0.04';
22 requires 'Task::Weaken';
24 test_requires 'File::Spec';
25 test_requires 'Test::More' => '0.88';
26 test_requires 'Test::Exception' => '0.27';
28 install_headers('mop.h'); # need Module::Install::XSUtil
32 makemaker_args( CCFLAGS => $ccflags );
35 my (@clean, @OBJECT, %XS);
37 for my $xs (<xs/*.xs>) {
38 (my $c = $xs) =~ s/\.xs$/.c/i;
39 (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i;
47 (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i;
53 clean => { FILES => join(q{ }, @clean) },
54 OBJECT => join (q{ }, @OBJECT),
65 # Use the cpan-smolder-stable script in the Moose svn root to figure
66 # out what on CPAN will break with the latest Moose, then update this
73 my $has_module_info = eval{ require Module::Info };
74 my $get_version = $has_module_info
75 ? sub{ Module::Info->new_from_module($_[0])->version }
76 : sub{ eval qq{ require $_[0] } ? $_[0]->VERSION : undef };
79 for my $mod ( sort keys %conflicts ) {
80 my $installed = $get_version->($mod);
82 if ( defined($installed) && $installed le $conflicts{$mod} ) {
87 This version of Class::MOP conflicts with the version of
88 $mod ($installed) you have installed.
90 You will need to upgrade $mod after installing
91 this version of Class::MOP.
100 return unless $found;
102 # More or less copied from Module::Build
103 return if $ENV{PERL_MM_USE_DEFAULT};
104 return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) );
114 my $ret = shift->SUPER::const_cccmd(@_);
115 return q{} unless $ret;
117 if ($Config{cc} =~ /^cl\b/i) {
118 warn 'you are using MSVC... my condolences.';