Skip to content

Commit

Permalink
Use NQP prefix for finding profiler template
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloé committed Mar 30, 2020
1 parent a10d8a3 commit a7806d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm/moar/HLL/Backend.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -691,7 +691,7 @@ class HLL::Backend::MoarVM {
my str $template;

if !$want_json && !$want_sql {
my $temppath := nqp::backendconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
my $temppath := nqpconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
$template := try slurp('src/vm/moar/profiler/template.html');
unless $template {
$template := try slurp($temppath);
Expand Down
8 changes: 8 additions & 0 deletions tools/lib/NQP/Config/NQP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions tools/templates/Makefile-common.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)@ \
Expand Down

0 comments on commit a7806d5

Please sign in to comment.