From f0cfdf2d87299b5282364fe4a1b818bf111447b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bartolom=C3=A4us?= Date: Sat, 25 Jul 2020 13:31:20 +0200 Subject: [PATCH] [JVM] Make osname available in nqp::backendconfig This key is available on the other backends, and there are a couple of special cases in Rakudo's code base because the operating system name had to be taken from nqp::jvmgetproperties(){'os.name'}. --- src/HLL/Compiler.nqp | 5 ++--- tools/build/gen-jvm-properties.pl | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HLL/Compiler.nqp b/src/HLL/Compiler.nqp index 6a428e4efc..9e0d0b46cf 100644 --- a/src/HLL/Compiler.nqp +++ b/src/HLL/Compiler.nqp @@ -817,13 +817,12 @@ class HLL::Compiler does HLL::Backend::Default { method nqp-home() { if !$!nqp-home { # Determine NQP directory + my $config := nqp::backendconfig(); + my $sep := $config eq 'MSWin32' ?? '\\' !! '/'; #?if jvm - my $sep := nqp::atkey(nqp::jvmgetproperties,'os.name') eq 'MSWin32' ?? '\\' !! '/'; my $execname := nqp::atkey(nqp::jvmgetproperties,'nqp.execname') // ''; #?endif #?if !jvm - my $config := nqp::backendconfig(); - my $sep := $config eq 'MSWin32' ?? '\\' !! '/'; my $execname := nqp::execname(); #?endif my $install-dir := $execname eq '' diff --git a/tools/build/gen-jvm-properties.pl b/tools/build/gen-jvm-properties.pl index 76a3ae0f75..9a0888b740 100755 --- a/tools/build/gen-jvm-properties.pl +++ b/tools/build/gen-jvm-properties.pl @@ -53,4 +53,5 @@ nativecall.lddlflags=$Config{lddlflags} nativecall.libs=$Config{libs} nativecall.perllibs=$Config{perllibs} +osname=$^O END