Skip to content

Commit

Permalink
Add static_nqp_home hll-config var
Browse files Browse the repository at this point in the history
Also be more explicit about whether the nqp_home variable references the
folder (where we install to): `nqp_home`
or the static compile time override to set a different home dir:
`static_nqp_home`
  • Loading branch information
PatZim committed Apr 4, 2020
1 parent 789c41e commit 4b46995
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
13 changes: 7 additions & 6 deletions tools/build/gen-version.pl
Expand Up @@ -15,7 +15,7 @@ =head1 TITLE
use POSIX 'strftime';

my $prefix = shift // '';
my $nqp_home = shift // '';
my $static_nqp_home = shift // '';
my $libdir = shift // '';

open(my $fh, '<', 'VERSION') or die $!;
Expand All @@ -36,11 +36,12 @@ =head1 TITLE

print <<"END_VERSION";
sub hll-config(\$config) {
\$config<version> := '$VERSION';
\$config<prefix> := '$prefix';
\$config<nqp_home> := '$nqp_home';
\$config<libdir> := '$libdir';
\$config<source-digest> := '$source_digest';
\$config<version> := '$VERSION';
\$config<prefix> := '$prefix';
\$config<static-nqp-home> := '$static_nqp_home';
\$config<nqp-home> := '$static_nqp_home';
\$config<libdir> := '$libdir';
\$config<source-digest> := '$source_digest';
}
END_VERSION

Expand Down
4 changes: 3 additions & 1 deletion tools/lib/NQP/Config/NQP.pm
Expand Up @@ -74,6 +74,8 @@ sub configure_refine_vars {
|| File::Spec->catdir( $config->{'prefix'}, 'share', 'nqp' )
)
);

$config->{static_nqp_home} = $config->{relocatable} eq 'reloc' ? '' : $config->{nqp_home};
}

sub configure_misc {
Expand Down Expand Up @@ -115,7 +117,7 @@ sub configure_moar_backend {
}
else {
my $qchar = $config->{quote};
$imoar->{config}{static_nqp_home} = $config->{nqp_home};
$imoar->{config}{static_nqp_home} = $config->{static_nqp_home};
$imoar->{config}{static_nqp_home_define} =
'-DSTATIC_NQP_HOME='
. $qchar
Expand Down
2 changes: 1 addition & 1 deletion tools/templates/Makefile-backend-common.in
Expand Up @@ -117,7 +117,7 @@

@nfp(@stage_dir@/@bsm(NQP)@)@: @prev_stage_dir@ @nfp(@stage_dir@/@bsm(QAST)@)@ @nfp(@stage_dir@/@bsm(P6QREGEX)@)@ @bpm(SOURCES)@
@echo(+++ Creating stage @stage@ NQP)@
$(NOECHO)$(PERL5) @shquot(@script(gen-version.pl)@)@ @q($(PREFIX))@ @q($(NQP_HOME))@ @q($(NQP_LIB_DIR))@ > @nfpq(@stage_dir@/nqp-config.nqp)@
$(NOECHO)$(PERL5) @shquot(@script(gen-version.pl)@)@ @q($(PREFIX))@ @q($(STATIC_NQP_HOME))@ @q($(NQP_LIB_DIR))@ > @nfpq(@stage_dir@/nqp-config.nqp)@
$(NOECHO@nop())@@bpm(@ucstage@_GEN_CAT)@ @bpm(NQP_SOURCES)@ @nfpq(@stage_dir@/nqp-config.nqp)@ > @nfpq(@stage_dir@/$(NQP_COMBINED))@
$(NOECHO@nop())@@bpm(@ucprev_stage@_NQP)@ --module-path=@shquot(@stage_dir@)@ --setting-path=@shquot(@stage_dir@)@ \
--setting=NQPCORE --target=@btarget@ --no-regex-lib @bpm(PRECOMP_@ucstage@_FLAGS)@ @bpm(NQP_@ucstage@_FLAGS)@ \
Expand Down
3 changes: 2 additions & 1 deletion tools/templates/Makefile-common.in
Expand Up @@ -123,9 +123,10 @@ SYSROOT = @nfp(@sysroot@)@
PREFIX = @nfp(@prefix@)@
BIN_DIR = @nfp(@prefix@/bin)@
NQP_HOME = @nfp(@nqp_home@)@
STATIC_NQP_HOME = @nfp(@static_nqp_home@)@
NQP_LIB_DIR = @nfp($(NQP_HOME)/lib)@
PROVE_OPTIONS = -j0$(TEST_JOBS)
PROVE = prove $(PROVE_OPTIONS)
BASE_DIR = @nfp(@base_dir@)@
BASE_DIR = @nfp(@base_dir@)@

# vim: ft=make noexpandtab ts=4 sw=4
4 changes: 2 additions & 2 deletions tools/templates/jvm/Makefile.in
Expand Up @@ -74,8 +74,8 @@ THIRDPARTY_JARS = $(ASM)@cpsep@$(ASMTREE)@cpsep@$(JLINE)@cpsep@$(JNA)
@echo(+++ Preparing Java runtime)@
$(NOECHO)$(MKPATH) bin
$(NOECHO)$(JAVAC) --release 9 -cp @q($(THIRDPARTY_JARS))@ -g -d bin -encoding UTF8 $(RUNTIME_JAVAS)
$(NOECHO)$(PERL5) @shquot(@script(gen-jvm-properties.pl)@)@ . @nfpq($(NQP_HOME))@ @q($(THIRDPARTY_JARS))@ > jvmconfig.properties
$(NOECHO)$(PERL5) @shquot(@script(gen-jvm-properties.pl)@)@ @nfpq(@prefix@)@ @nfpq($(NQP_HOME))@ @q($(THIRDPARTY_JARS))@ > @nfpq(bin/jvmconfig.properties)@
$(NOECHO)$(PERL5) @shquot(@script(gen-jvm-properties.pl)@)@ . @nfpq($(STATIC_NQP_HOME))@ @q($(THIRDPARTY_JARS))@ > jvmconfig.properties
$(NOECHO)$(PERL5) @shquot(@script(gen-jvm-properties.pl)@)@ @nfpq(@prefix@)@ @nfpq($(STATIC_NQP_HOME))@ @q($(THIRDPARTY_JARS))@ > @nfpq(bin/jvmconfig.properties)@
$(NOECHO)$(JAR) cf0 @bsm(RUNTIME)@ -C @nfp(bin/)@ .

@bpm(BUILD_RUNNER)@: @mkquot(@configure_script@)@ @@template(nqp-j)@@ @@template(runner-prelude)@@
Expand Down

0 comments on commit 4b46995

Please sign in to comment.