Changes for 1.06
[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
3f3e009e 13my %conflicts = (
14 'Moose' => '1.04',
15);
16
17check_conflicts(%conflicts);
18
72bc0a47 19require Config;
20my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.';
06e9254b 21
22if ( -d '.git' || $ENV{MAINTAINER_MODE} ) {
23 $ccflags .= ' -Wall -Wdeclaration-after-statement';
24}
f125b31e 25
89dc39a9 26requires 'Carp';
4154c4d0 27requires 'Data::OptList';
89dc39a9 28requires 'Devel::GlobalDestruction';
50de028e 29requires 'List::MoreUtils' => '0.12';
d065fbe6 30requires 'MRO::Compat' => '0.05';
2ea94f58 31requires 'Package::DeprecationManager' => '0.04';
407a4276 32requires 'Package::Stash';
d065fbe6 33requires 'Scalar::Util' => '1.18';
34requires 'Sub::Name' => '0.04';
a8344505 35requires 'Try::Tiny' => '0.02';
89dc39a9 36requires 'Task::Weaken';
37
38test_requires 'File::Spec';
7975280a 39test_requires 'Test::More' => '0.88';
4cd537dd 40test_requires 'Test::Exception' => '0.27';
89dc39a9 41
8c463274 42repository 'git://git.moose.perl.org/Class-MOP.git';
6b951296 43add_metadata(x_authority => 'cpan:STEVAN');
8c463274 44
3fd3a2ab 45extra_tests();
46
89dc39a9 47makemaker_args( CCFLAGS => $ccflags );
48
d846ade3 49{
50 my (@clean, @OBJECT, %XS);
51
52 for my $xs (<xs/*.xs>) {
53 (my $c = $xs) =~ s/\.xs$/.c/i;
54 (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i;
55
56 $XS{$xs} = $c;
57 push @OBJECT, $o;
58 push @clean, $o;
59 }
60
61 for my $c (<*.c>) {
62 (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i;
63 push @OBJECT, $o;
64 push @clean, $o;
65 }
66
67 makemaker_args(
68 clean => { FILES => join(q{ }, @clean) },
69 OBJECT => join (q{ }, @OBJECT),
70 XS => \%XS,
71 );
72}
73
8a9fe086 74postamble(<<'EOM');
75$(OBJECT) : mop.h
76EOM
77
89dc39a9 78WriteAll();
79
d846ade3 80package MY;
81
82use Config;
83
84sub const_cccmd {
85 my $ret = shift->SUPER::const_cccmd(@_);
86 return q{} unless $ret;
87
88 if ($Config{cc} =~ /^cl\b/i) {
89 warn 'you are using MSVC... my condolences.';
90 $ret .= ' /Fo$@';
91 }
92 else {
93 $ret .= ' -o $@';
94 }
95
96 return $ret;
97}