aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJens Rehsack <sno@netbsd.org>2015-10-22 21:21:42 +0200
committerJens Rehsack <sno@netbsd.org>2015-11-10 17:45:42 +0100
commitf0def6dc7b4f576668e689cfd44745e506a305ad (patch)
treeae910cfc290f3e20571416c22d682fd91e3b6f60 /tools
parent12d32ac0f8fe657730af27ca908d2137211e5ed5 (diff)
introduce support for sdkroot and sysroot to support cross-builds
To allow building for another location rather the final install prefix, regardless whether chroot based builds, cross-compile or canadian cross sdk is the goal, realize the difference between prefix, the sdk-root and the system root for final target. Signed-off-by: Jens Rehsack <sno@netbsd.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/build/Makefile.in4
-rw-r--r--tools/lib/NQP/Configure.pm7
2 files changed, 8 insertions, 3 deletions
diff --git a/tools/build/Makefile.in b/tools/build/Makefile.in
index 7b70874..68e20c6 100644
--- a/tools/build/Makefile.in
+++ b/tools/build/Makefile.in
@@ -7,6 +7,8 @@ STAR_VERSION = 2015.09
# install location
PREFIX_DIR = @prefix@
+SDKROOT_DIR = @sdkroot@
+SYSROOT_DIR = @sysroot@
# JVM install location
JVM_BIN_DIR = $(PREFIX_DIR)/bin
@@ -40,7 +42,7 @@ rakudo: @backend_exes@
@backend_exes@:
@echo "== Configuring and building Rakudo"
- cd $(RAKUDO_DIR) && $(PERL) Configure.pl --prefix=$(PREFIX_DIR) --backends=@backends@ && $(MAKE)
+ cd $(RAKUDO_DIR) && $(PERL) Configure.pl --sysroot=$(SYSROOT_DIR) --sdkroot=$(SDKROOT_DIR) --prefix=$(PREFIX_DIR) --backends=@backends@ && $(MAKE)
rakudo-test: rakudo
cd $(RAKUDO_DIR) && $(MAKE) test
diff --git a/tools/lib/NQP/Configure.pm b/tools/lib/NQP/Configure.pm
index 664f63f..2f67bf1 100644
--- a/tools/lib/NQP/Configure.pm
+++ b/tools/lib/NQP/Configure.pm
@@ -3,6 +3,7 @@ use strict;
use warnings;
use Cwd;
use File::Copy qw(copy);
+use File::Spec qw();
use base qw(Exporter);
our @EXPORT_OK = qw(sorry slurp system_or_die
@@ -217,6 +218,7 @@ sub gen_nqp {
my $gen_nqp = $options{'gen-nqp'};
my $gen_moar = $options{'gen-moar'};
my $prefix = $options{'prefix'} || cwd().'/install';
+ my $sdkroot = $options{'sdkroot'} || '';
my $startdir = cwd();
my $PARROT_REVISION = 'nqp/tools/build/PARROT_REVISION';
@@ -227,7 +229,7 @@ sub gen_nqp {
for my $b (qw/jvm moar/) {
if ($backends =~ /$b/) {
my $postfix = substr $b, 0, 1;
- my $bin = "$prefix/bin/nqp-$postfix$bat";
+ my $bin = File::Spec->catfile( $sdkroot, $prefix, 'bin', "nqp-$postfix$bat" );
$impls{$b}{bin} = $bin;
my %c = read_config($bin);
my $nqp_have = $c{'nqp::version'} || '';
@@ -280,12 +282,13 @@ sub gen_moar {
my %options = @_;
my $prefix = $options{'prefix'} || cwd()."/install";
+ my $sdkroot = $options{'sdkroot'} || '';
my $gen_moar = $options{'gen-moar'};
my @opts = @{ $options{'moar-option'} || [] };
push @opts, "--optimize";
my $startdir = cwd();
- my $moar_exe = "$prefix/bin/moar$exe";
+ my $moar_exe = File::Spec->catfile( $sdkroot, $prefix, 'bin', "moar$exe" );
my $moar_have = -e $moar_exe ? qx{ $moar_exe --version } : undef;
if ($moar_have) {
$moar_have = $moar_have =~ /version (\S+)/ ? $1 : undef;