diff --git a/src/vm/moar/HLL/Backend.nqp b/src/vm/moar/HLL/Backend.nqp index 236de995d0..7cbeee2b22 100644 --- a/src/vm/moar/HLL/Backend.nqp +++ b/src/vm/moar/HLL/Backend.nqp @@ -13,7 +13,7 @@ my sub literal_subst(str $source, str $pattern, $replacement) { class HLL::Backend::MoarVM { our %moar_config := nqp::backendconfig(); - + my sub read_ui32($fh, $buf?) { unless $buf { $buf := nqp::create($NQPBuf) } nqp::readfh($fh, $buf, 4); @@ -691,7 +691,7 @@ class HLL::Backend::MoarVM { my str $template; if !$want_json && !$want_sql { - my $temppath := nqp::backendconfig() ~ '/share/nqp/lib/profiler/template.html'; + my $temppath := nqpconfig() ~ '/share/nqp/lib/profiler/template.html'; $template := try slurp('src/vm/moar/profiler/template.html'); unless $template { $template := try slurp($temppath); diff --git a/tools/lib/NQP/Config/NQP.pm b/tools/lib/NQP/Config/NQP.pm index 1c1a59d4b0..fbf03825cd 100644 --- a/tools/lib/NQP/Config/NQP.pm +++ b/tools/lib/NQP/Config/NQP.pm @@ -93,6 +93,14 @@ sub configure_misc { $config->{moar_stage0} = $self->nfp( "src/vm/moar/stage0", no_quote => 1 ); $config->{jvm_stage0} = $self->nfp( "src/vm/jvm/stage0", no_quote => 1 ); + + # TODO: Use the template infrastructure from nqp-configure? + open my $configfile, '>', 'src/core/Config.nqp'; + print $configfile "# This file is generated automatically by $0\n"; + print $configfile "sub nqpconfig() {\n"; + print $configfile " nqp::hash('prefix', '$config->{prefix}');\n"; + print $configfile "}\n"; + close $configfile; } sub configure_moar_backend { diff --git a/tools/templates/Makefile-common.in b/tools/templates/Makefile-common.in index 93377f7680..44a02d0ca9 100644 --- a/tools/templates/Makefile-common.in +++ b/tools/templates/Makefile-common.in @@ -12,6 +12,7 @@ COMMON_HLL_SOURCES = \ HLL_COMBINED = NQPHLL.nqp CORE_SETTING_SOURCES = \ + @nfp(src/core/Config.nqp)@ \ @nfp(src/core/NativeTypes.nqp)@ \ @nfp(src/core/NQPRoutine.nqp)@ \ @nfp(src/core/NQPMu.nqp)@ \