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