Skip to content
Permalink
Browse files

[JVM] Make sure $*EXECUTABLE is always absolute

This in turn gets the relocatability logic that determines PERL6_HOME
and NQP_HOME working on JVM.
  • Loading branch information...
patzim committed Apr 27, 2019
1 parent f91de3e commit de42e7193681cf9a67d48adee8c60992be2e7ebb
Showing with 11 additions and 11 deletions.
  1. +11 −11 tools/build/create-jvm-runner.pl
@@ -40,7 +40,7 @@

my $NQP_LIB = $blib ? ': ${NQP_LIB:="blib"}' : '';

my $preamble_reloc = <<'EOS';
my $preamble_unix = <<'EOS';
#!/bin/sh
# Sourced from https://stackoverflow.com/a/29835459/1975049
@@ -70,20 +70,20 @@
fi
)
DIR=$(dirname -- "$(rreadlink "$0")")
EXEC=$(rreadlink "$0")
DIR=$(dirname -- "$EXEC")
EOS

$preamble_reloc .= "
: \${NQP_DIR:=\"\$DIR/../share/nqp\"}

my $preamble = $^O eq 'MSWin32' ? '@' :
$type eq 'install'
? $preamble_unix . ": \${NQP_DIR:=\"\$DIR/../share/nqp\"}
: \${NQP_JARS:=\"$nqpjars\"}
: \${PERL6_DIR:=\"\$DIR/../share/perl6\"}
: \${PERL6_JARS:=\"$perl6jars\"}
exec ";

my $preamble = $^O eq 'MSWin32' ? '@' :
$type eq 'install' ? $preamble_reloc :
"#!/bin/sh
$NQP_LIB
exec "
: $preamble_unix . "$NQP_LIB
: \${NQP_DIR:=\"$nqpdir\"}
: \${NQP_JARS:=\"$nqpjars\"}
: \${PERL6_DIR:=\"$perl6dir\"}
@@ -111,7 +111,7 @@ sub install {
. ' -cp ' . ($^O eq 'MSWin32' ? '"%CLASSPATH%";' : '$CLASSPATH:') . $classpath
. ' -Dperl6.prefix=' . ($type eq 'install' && $^O ne 'MSWin32' ? '$DIR/..' : $prefix)
. ' -Djna.library.path=' . $sharedir
. ($^O eq 'MSWin32' ? ' -Dperl6.execname="%~dpf0"' : ' -Dperl6.execname="$0"');
. ($^O eq 'MSWin32' ? ' -Dperl6.execname="%~dpf0"' : ' -Dperl6.execname="$EXEC"');
my $jdbopts = '-Xdebug -Xrunjdwp:transport=dt_socket,address='
. ($^O eq 'MSWin32' ? '8000' : '${RAKUDO_JDB_PORT:=8000}')
. ',server=y,suspend=y';

0 comments on commit de42e71

Please sign in to comment.
You can’t perform that action at this time.