diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-07-31 12:02:03 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-07-31 12:02:17 -0400 |
commit | c9edb90e1c0de979060fe4133248b9a974d3609c (patch) | |
tree | 08df41878b1f71fe2722e6a6149165538228d369 | |
parent | faa9e82a3905d2c778b36c862f348b79a8c95549 (diff) | |
download | parse-keyword-c9edb90e1c0de979060fe4133248b9a974d3609c.tar.gz parse-keyword-c9edb90e1c0de979060fe4133248b9a974d3609c.zip |
apparently if we set OBJECT, we need to include all objects (#3)
-rw-r--r-- | Makefile.PL | 8 | ||||
-rw-r--r-- | inc/MakeMaker.pm | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Makefile.PL b/Makefile.PL index 27b181a..383791e 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -5,13 +5,19 @@ use strict; use warnings; +use Config; use ExtUtils::MakeMaker::Dist::Zilla::Develop; use Devel::CallParser 'callparser1_h', 'callparser_linkable'; open my $fh, '>', 'callparser1.h' or die "Couldn't write to callparser1.h"; $fh->print(callparser1_h); +my @linkable = callparser_linkable; +push @linkable, "Keyword$Config{obj_ext}" if @linkable; + WriteMakefile( NAME => 'Parse::Keyword', - OBJECT => join(' ', callparser_linkable), + (@linkable + ? (OBJECT => join(' ', @linkable)) + : ()), ); diff --git a/inc/MakeMaker.pm b/inc/MakeMaker.pm index 3d31c0d..e642db5 100644 --- a/inc/MakeMaker.pm +++ b/inc/MakeMaker.pm @@ -8,10 +8,13 @@ around _build_MakeFile_PL_template => sub { my $self = shift; my $tmpl = $self->$orig; my $extra = <<'EXTRA'; +use Config; use Devel::CallParser 'callparser1_h', 'callparser_linkable'; open my $fh, '>', 'callparser1.h' or die "Couldn't write to callparser1.h"; $fh->print(callparser1_h); -$WriteMakefileArgs{OBJECT} = join(' ', callparser_linkable); +my @linkable = callparser_linkable; +push @linkable, "Keyword$Config{obj_ext}" if @linkable; +$WriteMakefileArgs{OBJECT} = join(' ', @linkable) if @linkable; EXTRA $tmpl =~ s/^(WriteMakefile\()/$extra\n$1/m or die "Couldn't fix template"; |