Skip to content

Commit a7806d5

Browse files
author
Chloé
committed
Use NQP prefix for finding profiler template
1 parent a10d8a3 commit a7806d5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/vm/moar/HLL/Backend.nqp

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ my sub literal_subst(str $source, str $pattern, $replacement) {
1313

1414
class HLL::Backend::MoarVM {
1515
our %moar_config := nqp::backendconfig();
16-
16+
1717
my sub read_ui32($fh, $buf?) {
1818
unless $buf { $buf := nqp::create($NQPBuf) }
1919
nqp::readfh($fh, $buf, 4);
@@ -691,7 +691,7 @@ class HLL::Backend::MoarVM {
691691
my str $template;
692692

693693
if !$want_json && !$want_sql {
694-
my $temppath := nqp::backendconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
694+
my $temppath := nqpconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
695695
$template := try slurp('src/vm/moar/profiler/template.html');
696696
unless $template {
697697
$template := try slurp($temppath);

tools/lib/NQP/Config/NQP.pm

+8
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ sub configure_misc {
9393

9494
$config->{moar_stage0} = $self->nfp( "src/vm/moar/stage0", no_quote => 1 );
9595
$config->{jvm_stage0} = $self->nfp( "src/vm/jvm/stage0", no_quote => 1 );
96+
97+
# TODO: Use the template infrastructure from nqp-configure?
98+
open my $configfile, '>', 'src/core/Config.nqp';
99+
print $configfile "# This file is generated automatically by $0\n";
100+
print $configfile "sub nqpconfig() {\n";
101+
print $configfile " nqp::hash('prefix', '$config->{prefix}');\n";
102+
print $configfile "}\n";
103+
close $configfile;
96104
}
97105

98106
sub configure_moar_backend {

tools/templates/Makefile-common.in

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ COMMON_HLL_SOURCES = \
1212
HLL_COMBINED = NQPHLL.nqp
1313

1414
CORE_SETTING_SOURCES = \
15+
@nfp(src/core/Config.nqp)@ \
1516
@nfp(src/core/NativeTypes.nqp)@ \
1617
@nfp(src/core/NQPRoutine.nqp)@ \
1718
@nfp(src/core/NQPMu.nqp)@ \

0 commit comments

Comments
 (0)