aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Lenz <moritz@faui2k3.org>2015-11-24 21:21:42 +0000
committerMoritz Lenz <moritz@faui2k3.org>2015-11-24 21:21:42 +0000
commit8202b71aa3c4833f06c99a28074b8874288e8246 (patch)
treeb6668b57d4d4d51d37631f7921398e35c9b61c1d
parent222cce6ca8059c9ce0f93a308520827b3f353012 (diff)
parent956d9ef2b0db4e9ad08ca06d081318260ced05de (diff)
Merge branch 'master' of github.com:rehsack/star
-rw-r--r--Configure.pl15
-rw-r--r--tools/build/Makefile.in4
-rw-r--r--tools/lib/NQP/Configure.pm7
3 files changed, 20 insertions, 6 deletions
diff --git a/Configure.pl b/Configure.pl
index 29ee0b8..f2a7047 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -32,6 +32,7 @@ MAIN: {
my %options;
GetOptions(\%options, 'help!', 'prefix=s',
+ 'sysroot=s', 'sdkroot=s',
'backends=s', 'no-clean!',
'gen-nqp:s', 'gen-moar:s',
'make-install!', 'makefile-timing!',
@@ -59,9 +60,9 @@ MAIN: {
}
unless (defined $options{prefix}) {
- my $dir = getcwd;
- print "ATTENTION: no --prefix supplied, building and installing to $dir/install\n";
- $options{prefix} = 'install';
+ my $default = defined($options{sysroot}) ? '/usr' : File::Spec->catdir(getcwd, 'install');
+ print "ATTENTION: no --prefix supplied, building and installing to $default\n";
+ $options{prefix} = $default;
}
$options{prefix} = File::Spec->rel2abs($options{prefix});
@@ -148,6 +149,11 @@ MAIN: {
}
$config{prefix} = $prefix;
+ $config{sdkroot} = $options{sdkroot};
+ $config{sysroot} = $options{sysroot};
+ $config{pass_rakudo_config} = "";
+ $config{pass_rakudo_config} .= $options{sdkroot} ? " --sdkroot=\"\$(SDKROOT_DIR)\"" : "";
+ $config{pass_rakudo_config} .= $options{sysroot} ? " --sysroot=\"\$(SYSROOT_DIR)\"" : "";
$config{slash} = $slash;
$config{'makefile-timing'} = $options{'makefile-timing'};
$config{'stagestats'} = '--stagestats' if $options{'makefile-timing'};
@@ -263,6 +269,9 @@ Configure.pl - $lang Configure
General Options:
--help Show this text
--prefix=dir Install files in dir; also look for executables there
+ --sdkroot=dir When given, use for searching build tools here, e.g.
+ nqp, java etc.
+ --sysroot=dir When given, use for searching runtime components here
--backends=jvm,moar
Which backend(s) to use
--gen-moar[=branch]
diff --git a/tools/build/Makefile.in b/tools/build/Makefile.in
index eae757a..4627f45 100644
--- a/tools/build/Makefile.in
+++ b/tools/build/Makefile.in
@@ -7,6 +7,8 @@ STAR_VERSION = 2015.11
# 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@pass_rakudo_config@ --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;