Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
import and adapot gen-moar-runner.pl from nqp
pretty pointless so far, because we do not get that far in the compilation.
  • Loading branch information
moritz committed Oct 29, 2013
1 parent a1b98b0 commit 95476c2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/build/Makefile-Moar.in
Expand Up @@ -246,8 +246,8 @@ $(SETTING_MOAR): $(PERL6_MOAR) $(PERL6_B_MOAR) $(M_CORE_SOURCES)
@echo "The following step can take a long time, please be patient."
$(RUN_PERL6) --setting=NULL --optimize=3 --target=mbc --stagestats --output=$(SETTING_MOAR) src/gen/m-CORE.setting

$(M_RUNNER):
$(PERL) tools/build/create-moar-runner.pl dev . $(PREFIX)
$(M_RUNNER): tools/build/gen-moar-runner.pl $(PERL6_MOAR)
$(PERL) tools/build/gen-moar-runner.pl $(MOAR) .

## testing targets
blib/Test.moarvm: lib/Test.pm $(PERL6_MOAR) $(SETTING_MOAR) $(M_RUNNER)
Expand Down
31 changes: 31 additions & 0 deletions tools/build/gen-moar-runner.pl
@@ -0,0 +1,31 @@
#!/usr/bin/perl
# Copyright (C) 2013, The Perl Foundation.

use strict;
use warnings;
use 5.008;
use File::Spec;

my ($moar, $libpath) = @ARGV;

if ($^O eq 'MSWin32') {
my $install_to = 'perl6-m.bat';
open my $fh, ">", $install_to
or die "Could not open $install_to: $!";
printf q[@ "%s" --libpath="%s" perl6.moarvm %*] . "\n",
$libpath, $moar;
close $fh
or die "Could not close $install_to: $!";
}
else {
my $install_to = 'perl6-m';
open my $fh, ">", $install_to
or die "Could not open $install_to: $!";
printf $fh <<'EOS', $moar, $libpath;
#!/bin/sh
exec %s --libpath=%s perl6.moarvm "$@"
EOS
close $fh
or die "Could not close $install_to: $!";
chmod 0755, $install_to;
}

0 comments on commit 95476c2

Please sign in to comment.