bump version to 1.04
[gitmo/Class-MOP.git] / Makefile.PL
CommitLineData
591a9381 1use strict;
2use warnings;
89dc39a9 3use inc::Module::Install;
4use 5.008001;
5
6check_conflicts();
7
8name 'Class-MOP';
9perl_version '5.008001';
10all_from 'lib/Class/MOP.pm';
11license 'perl';
591a9381 12
72bc0a47 13require Config;
14my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.';
06e9254b 15
16if ( -d '.git' || $ENV{MAINTAINER_MODE} ) {
17 $ccflags .= ' -Wall -Wdeclaration-after-statement';
18}
f125b31e 19
89dc39a9 20requires 'Carp';
4154c4d0 21requires 'Data::OptList';
89dc39a9 22requires 'Devel::GlobalDestruction';
50de028e 23requires 'List::MoreUtils' => '0.12';
d065fbe6 24requires 'MRO::Compat' => '0.05';
1b948345 25requires 'Package::DeprecationManager';
407a4276 26requires 'Package::Stash';
d065fbe6 27requires 'Scalar::Util' => '1.18';
28requires 'Sub::Name' => '0.04';
a8344505 29requires 'Try::Tiny' => '0.02';
89dc39a9 30requires 'Task::Weaken';
31
32test_requires 'File::Spec';
7975280a 33test_requires 'Test::More' => '0.88';
4cd537dd 34test_requires 'Test::Exception' => '0.27';
89dc39a9 35
8c463274 36repository 'git://git.moose.perl.org/Class-MOP.git';
6b951296 37add_metadata(x_authority => 'cpan:STEVAN');
8c463274 38
3fd3a2ab 39extra_tests();
40
89dc39a9 41makemaker_args( CCFLAGS => $ccflags );
42
d846ade3 43{
44 my (@clean, @OBJECT, %XS);
45
46 for my $xs (<xs/*.xs>) {
47 (my $c = $xs) =~ s/\.xs$/.c/i;
48 (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i;
49
50 $XS{$xs} = $c;
51 push @OBJECT, $o;
52 push @clean, $o;
53 }
54
55 for my $c (<*.c>) {
56 (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i;
57 push @OBJECT, $o;
58 push @clean, $o;
59 }
60
61 makemaker_args(
62 clean => { FILES => join(q{ }, @clean) },
63 OBJECT => join (q{ }, @OBJECT),
64 XS => \%XS,
65 );
66}
67
8a9fe086 68postamble(<<'EOM');
69$(OBJECT) : mop.h
70EOM
71
89dc39a9 72WriteAll();
73
74# Use the cpan-smolder-stable script in the Moose svn root to figure
75# out what on CPAN will break with the latest Moose, then update this
76# before a release.
77sub check_conflicts {
78 my %conflicts = (
a53e76d9 79 'Moose' => '1.04',
89dc39a9 80 );
81
82 my $found = 0;
83 for my $mod ( sort keys %conflicts ) {
84 eval "require $mod";
85 next if $@;
86
87 my $installed = $mod->VERSION();
88 if ( $installed le $conflicts{$mod} ) {
89
90 print <<"EOF";
91
92***
93 This version of Class::MOP conflicts with the version of
94 $mod ($installed) you have installed.
95
96 You will need to upgrade $mod after installing
97 this version of Class::MOP.
98***
99
100EOF
101
102 $found = 1;
103 }
104 }
105
106 return unless $found;
107
108 # More or less copied from Module::Build
d065fbe6 109 return if $ENV{PERL_MM_USE_DEFAULT};
110 return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) );
89dc39a9 111
112 sleep 4;
113}
d846ade3 114
115package MY;
116
117use Config;
118
119sub const_cccmd {
120 my $ret = shift->SUPER::const_cccmd(@_);
121 return q{} unless $ret;
122
123 if ($Config{cc} =~ /^cl\b/i) {
124 warn 'you are using MSVC... my condolences.';
125 $ret .= ' /Fo$@';
126 }
127 else {
128 $ret .= ' -o $@';
129 }
130
131 return $ret;
132}