Skip to content

Commit

Permalink
Use the same perl6-m executable from configure time also at runtime
Browse files Browse the repository at this point in the history
Fixes issues with precompilation failing due to a hard coded perl6 executable
name.
  • Loading branch information
niner committed Jan 15, 2019
1 parent d9816ba commit 9e5c196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Makefile.PL
Expand Up @@ -4,10 +4,11 @@ use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

my $perl6 = qx{perl6-m -e 'say \$*EXECUTABLE.absolute'};
chomp $perl6;
my $install_cmd = q{perl6-m -e 'say $*EXECUTABLE.dirname.Str.subst(rx{\/<-[\/]>+$}, "")'};
my $install = qx{$install_cmd};
chomp $install;
say $install;

my $moar_version_cmd = q{perl6-m -e 'say $*VM.version ge v2016.11.27.g.3171.dbba'};
my $moar_version = qx{$moar_version_cmd};
Expand Down Expand Up @@ -35,6 +36,7 @@ WriteMakefile(
);

open my $header, '>', 'Perl6.h';
print { $header } qq{#define PERL6_EXECUTABLE "$perl6"\n};
print { $header } qq{#define PERL6_INSTALL_PATH "$install"\n};
print { $header } $moar_version eq 'True'
? qq{#define mark_thread_blocked(tc) MVM_gc_mark_thread_blocked(tc)\n}
Expand Down
2 changes: 1 addition & 1 deletion Perl6.xs
Expand Up @@ -62,7 +62,7 @@ initialize()

/* stash the rest of the raw command line args in the instance */
instance->prog_name = PERL6_INSTALL_PATH "/share/perl6/runtime/perl6.moarvm";
instance->exec_name = "perl6";
instance->exec_name = PERL6_EXECUTABLE;
instance->raw_clargs = NULL;

/* Map the compilation unit into memory and dissect it. */
Expand Down

0 comments on commit 9e5c196

Please sign in to comment.