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