Checking in changes prior to tagging of version 0.40_04. Changelog diff is:
[gitmo/Mouse.git] / Makefile.PL
CommitLineData
08f7a8db 1use strict;
2use warnings;
c3398f5b 3use inc::Module::Install;
4
3f9d4c2b 5system($^X, 'author/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
6 or warn "Cannot generate Mouse::Tiny: $!";
7
c3398f5b 8name 'Mouse';
9all_from 'lib/Mouse.pm';
10
b9add211 11tests 't/*.t t/*/*.t';
12
ec53d678 13# Scalar::Util < 1.14 has a bug.
14# > Fixed looks_like_number(undef) to return false for perl >= 5.009002
15requires 'Scalar::Util' => 1.14;
272a1930 16
4dd800c6 17configure_requires 'ExtUtils::CBuilder';
18
eb88905f 19test_requires 'Test::More' => 0.88;
20test_requires 'Test::Exception' => 0.27;
f1c70cbe 21# test_requires 'Test::Output' => 0.16; # too many dependencies!
22
c6cb4ba0 23include_deps 'Test::Exception'; # work around 0.27_0x (its use of diehook might be wrong)
c3398f5b 24
179ac6cc 25recommends 'MRO::Compat' if $] < 5.010;
26
98f255c5 27require 'lib/Mouse/Spec.pm'; # for the version
28
29if(Mouse::Spec->MouseVersion =~ /_/){ # DEVEL RELEASE
30 require Carp::Always; Carp::Always->import();
31 include_deps 'Carp::Always';
32}
33
df6dd016 34my $use_xs;
35
36for (@ARGV) {
37 /^--pp$/ and $use_xs = 0;
38 /^--xs$/ and $use_xs = 1;
39}
0e81c55d 40
3ea28db6 41if($] < 5.008_001){
42 $use_xs = 0;
43}
44
0e81c55d 45if(!defined $use_xs){
c6cb4ba0 46 $use_xs = eval {
47 require ExtUtils::CBuilder;
48 ExtUtils::CBuilder->new(quiet => 1)->have_compiler();
49 };
0e81c55d 50}
51
52if($use_xs){
7b92a82b 53 print "Mouse configured with XS.\n",
98f255c5 54 "NOTE: You can try --pp option to configure Mouse with Pure Perl.\n";
7b92a82b 55 ;
56
0e81c55d 57 require Module::Install::XSUtil;
bb543d7f 58 Module::Install::XSUtil->VERSION(0.15); # for co-developpers
59
0e81c55d 60 use_ppport(3.19);
61 cc_warnings();
62 cc_src_paths('xs-src');
0e81c55d 63}
64else{
7b92a82b 65 print "Mouse configured with Pure Perl.\n";
0e81c55d 66}
67
83eab7b3 68if (author_context()) {
121acb8a 69 my $require_version = Mouse::Spec->MooseVersion;
bf9f3f91 70
71 if (eval{ require Moose; Moose->VERSION($require_version) }) {
314fe304 72 if (eval 'use Module::Install::AuthorTests; 1') {
32cf1353 73 do 'author/create-moose-compatibility-tests.pl';
314fe304 74 recursive_author_tests('xt');
75 } else {
76 print "you don't have a M::I::AuthorTests.\n";
77 }
78 } else {
bf9f3f91 79 print "you don't have Moose $require_version. skipping moose compatibility test\n";
314fe304 80 }
4358792d 81
82 if($use_xs){
83 # repeat testing
84 # see also ExtUtils::MM_Any::test_via_harness()
85 my $test_via_harness = q{$(FULLPERLRUN) -MExtUtils::Command::MM -e}
86 .q{ "do 'author/force-pp.pl'; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"}
87 .q{ $(TEST_FILES)} . "\n";
88
89 postamble qq{test_dynamic :: test_pp\n\n}
90 . qq{test_pp :: pure_all\n}
91 . qq{\t} . $test_via_harness;
92 }
314fe304 93}
94
28b86abc 95clean_files 'lib/Mouse/Tiny.pm $(O_FILES)';
02cf53bb 96
eb88905f 97WriteAll check_nmake => 0;