Skip to content

Commit

Permalink
Generalize create-moar-runner.
Browse files Browse the repository at this point in the history
Means we'll be able to use it to create a perl6-debug one also.
  • Loading branch information
jnthn committed Jan 27, 2014
1 parent acf7bd2 commit cb1c86f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tools/build/Makefile-Moar.in
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ $(R_SETTING_MOAR): $(PERL6_MOAR) $(SETTING_MOAR) $(R_SETTING_SRC)
$(M_RUN_PERL6) --target=mbc --output=$(R_SETTING_MOAR) $(R_SETTING_SRC)

$(M_RUNNER): tools/build/create-moar-runner.pl $(PERL6_MOAR)
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" . "$(M_LIBPATH)" .
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm perl6-m . "$(M_LIBPATH)" .

m-runner-default: $(M_RUNNER)
$(CP) $(M_RUNNER) perl6@runner_suffix@
Expand Down Expand Up @@ -323,12 +323,12 @@ m-install: m-all tools/build/create-moar-runner.pl
$(CP) blib/lib.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(CP) blib/Pod/To/Text.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" "$(PERL6_LANG_DIR)/runtime" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm perl6-m "$(PERL6_LANG_DIR)/runtime" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"
$(CP) perl6-m$(M_BAT) $(DESTDIR)$(PREFIX)/bin
$(CHMOD) 755 $(DESTDIR)$(PREFIX)/bin/perl6-m$(M_BAT)

m-runner-default-install: m-install
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" "$(PERL6_LANG_DIR)/runtime" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm perl6-m "$(PERL6_LANG_DIR)/runtime" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"
$(CP) perl6-m$(M_BAT) $(DESTDIR)$(PREFIX)/bin/perl6$(M_BAT)
$(CHMOD) 755 $(DESTDIR)$(PREFIX)/bin/perl6$(M_BAT)

Expand Down
13 changes: 6 additions & 7 deletions tools/build/create-moar-runner.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@
use 5.008;
use File::Spec;

my ($moar, $p6_mbc_path, @libpaths) = @ARGV;
my ($moar, $mbc, $install_to, $p6_mbc_path, @libpaths) = @ARGV;
$p6_mbc_path = File::Spec->rel2abs($p6_mbc_path || '.');

if ($^O eq 'MSWin32') {
my $install_to = 'perl6-m.bat';
$install_to .= '.bat';
open my $fh, ">", $install_to
or die "Could not open $install_to: $!";
printf $fh q[@ "%s" --libpath="%s" %s\\perl6.moarvm %%*] . "\n",
$moar, join('" --libpath="', @libpaths), $p6_mbc_path;
printf $fh q[@ "%s" --libpath="%s" %s\\%s %%*] . "\n",
$moar, join('" --libpath="', @libpaths), $p6_mbc_path, $mbc;
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, join('" --libpath="', @libpaths), $p6_mbc_path;
printf $fh <<'EOS', $moar, join('" --libpath="', @libpaths), $p6_mbc_path, $mbc;
#!/bin/sh
exec %s --libpath="%s" %s/perl6.moarvm "$@"
exec %s --libpath="%s" %s/%s "$@"
EOS
close $fh
or die "Could not close $install_to: $!";
Expand Down

0 comments on commit cb1c86f

Please sign in to comment.