From: gfx Date: Sat, 24 Oct 2009 05:20:34 +0000 (+0900) Subject: Add XS stuff to Makefile.PL X-Git-Tag: 0.40_01~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=0e81c55d54fbd14fb67d6f22c184df2d0d7059c0 Add XS stuff to Makefile.PL --- diff --git a/Makefile.PL b/Makefile.PL index 6800f72..1222823 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -22,6 +22,31 @@ include 'Test::Exception'; # work around 0.27_0x (its use of diehook might be wr recommends 'MRO::Compat' if $] < 5.010; +my $use_xs; + +for (@ARGV) { + /^--pp$/ and $use_xs = 0; + /^--xs$/ and $use_xs = 1; +} + +if(!defined $use_xs){ + configure_requires 'ExtUtils::CBuilder'; + require ExtUtils::CBuilder; + $use_xs = ExtUtils::CBuilder->new(quiet => 1)->have_compiler(); +} + +if($use_xs){ + require Module::Install::XSUtil; + use_ppport(3.19); + cc_warnings(); + cc_src_paths('xs-src'); + + print "Mouse configured in XS (--xs)\n"; +} +else{ + print "Mouse configured in Pure Perl (--pp)\n"; +} + if ($Module::Install::AUTHOR) { local @INC = ('lib', @INC); require 'lib/Mouse/Spec.pm';