diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-07-10 01:35:05 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-07-10 01:43:42 -0500 |
commit | 574b3e491b6ee87753bb1228376c62481ae5bfc3 (patch) | |
tree | e3f40dd3c18d4201b71e9d63a8220cc5973c1a36 | |
parent | 6624bc8b7b053d3fda504531087426b107882593 (diff) | |
download | smartmatch-engine-core-574b3e491b6ee87753bb1228376c62481ae5bfc3.tar.gz smartmatch-engine-core-574b3e491b6ee87753bb1228376c62481ae5bfc3.zip |
for now, don't use xs implementation on pre-5.014 perls
they don't have the cv_set_call_checker stuff, and i'm not quite sure
how Devel::CallChecker works
-rw-r--r-- | dist.ini | 4 | ||||
-rw-r--r-- | inc/MakeMaker.pm | 27 | ||||
-rw-r--r-- | lib/smartmatch/engine/core.pm | 2 | ||||
-rw-r--r-- | t/core.t | 5 | ||||
-rw-r--r-- | t/error.t | 5 |
5 files changed, 42 insertions, 1 deletions
@@ -7,7 +7,11 @@ copyright_holder = Jesse Luehrs [@Filter] -bundle = @DOY -remove = NoTabsTests +-remove = MakeMaker dist = smartmatch-engine-core +; authordep Dist::Zilla::Plugin::MakeMaker::Awesome +[=inc::MakeMaker] + [Prereqs] smartmatch = 0 diff --git a/inc/MakeMaker.pm b/inc/MakeMaker.pm new file mode 100644 index 0000000..b41113a --- /dev/null +++ b/inc/MakeMaker.pm @@ -0,0 +1,27 @@ +package inc::MakeMaker; +use Moose; + +extends 'Dist::Zilla::Plugin::MakeMaker::Awesome'; + +override _build_MakeFile_PL_template => sub { + my $self = shift; + + my $tmpl = super; + + my $depends = <<'END'; +if ($] < 5.014) { + %WriteMakefileArgs = ( + %WriteMakefileArgs, + XS => {}, + C => [], + ); +} +END + + $tmpl =~ s/(WriteMakefile\()/$depends\n$1/; + + return $tmpl; +}; + +__PACKAGE__->meta->make_immutable; +1; diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm index 7bf5c02..6769350 100644 --- a/lib/smartmatch/engine/core.pm +++ b/lib/smartmatch/engine/core.pm @@ -8,7 +8,7 @@ use parent 'DynaLoader'; sub dl_load_flags { 0x01 } -if (!$smartmatch::engine::core::USE_PP) { +if (!$smartmatch::engine::core::USE_PP && $] >= 5.014) { __PACKAGE__->bootstrap( # we need to be careful not to touch $VERSION at compile time, # otherwise DynaLoader will assume it's set and check against it, which @@ -3,6 +3,11 @@ use strict; use warnings; use Test::More; +BEGIN { + plan skip_all => "no c implementation for pre-5.14 for now" + if $] < 5.014; +} + use smartmatch 'core'; no warnings 'uninitialized'; @@ -3,6 +3,11 @@ use strict; use warnings; use Test::More; +BEGIN { + plan skip_all => "no c implementation for pre-5.14 for now" + if $] < 5.014; +} + my $foo = bless {}; my $bar = bless {}; |