Fix 0.01 release date
[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';
25requires 'Scalar::Util' => '1.18';
26requires 'Sub::Name' => '0.04';
a8344505 27requires 'Try::Tiny' => '0.02';
89dc39a9 28requires 'Task::Weaken';
29
30test_requires 'File::Spec';
7975280a 31test_requires 'Test::More' => '0.88';
4cd537dd 32test_requires 'Test::Exception' => '0.27';
89dc39a9 33
8c463274 34repository 'git://git.moose.perl.org/Class-MOP.git';
35
3fd3a2ab 36extra_tests();
37
89dc39a9 38makemaker_args( CCFLAGS => $ccflags );
39
d846ade3 40{
41 my (@clean, @OBJECT, %XS);
42
43 for my $xs (<xs/*.xs>) {
44 (my $c = $xs) =~ s/\.xs$/.c/i;
45 (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i;
46
47 $XS{$xs} = $c;
48 push @OBJECT, $o;
49 push @clean, $o;
50 }
51
52 for my $c (<*.c>) {
53 (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i;
54 push @OBJECT, $o;
55 push @clean, $o;
56 }
57
58 makemaker_args(
59 clean => { FILES => join(q{ }, @clean) },
60 OBJECT => join (q{ }, @OBJECT),
61 XS => \%XS,
62 );
63}
64
8a9fe086 65postamble(<<'EOM');
66$(OBJECT) : mop.h
67EOM
68
89dc39a9 69WriteAll();
70
71# Use the cpan-smolder-stable script in the Moose svn root to figure
72# out what on CPAN will break with the latest Moose, then update this
73# before a release.
74sub check_conflicts {
75 my %conflicts = (
0dc00e2f 76 'Moose' => '0.85',
89dc39a9 77 );
78
79 my $found = 0;
80 for my $mod ( sort keys %conflicts ) {
81 eval "require $mod";
82 next if $@;
83
84 my $installed = $mod->VERSION();
85 if ( $installed le $conflicts{$mod} ) {
86
87 print <<"EOF";
88
89***
90 This version of Class::MOP conflicts with the version of
91 $mod ($installed) you have installed.
92
93 You will need to upgrade $mod after installing
94 this version of Class::MOP.
95***
96
97EOF
98
99 $found = 1;
100 }
101 }
102
103 return unless $found;
104
105 # More or less copied from Module::Build
d065fbe6 106 return if $ENV{PERL_MM_USE_DEFAULT};
107 return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) );
89dc39a9 108
109 sleep 4;
110}
d846ade3 111
112package MY;
113
114use Config;
115
116sub const_cccmd {
117 my $ret = shift->SUPER::const_cccmd(@_);
118 return q{} unless $ret;
119
120 if ($Config{cc} =~ /^cl\b/i) {
121 warn 'you are using MSVC... my condolences.';
122 $ret .= ' /Fo$@';
123 }
124 else {
125 $ret .= ' -o $@';
126 }
127
128 return $ret;
129}