aboutsummaryrefslogtreecommitdiff
path: root/Configure.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Configure.pl')
-rw-r--r--Configure.pl47
1 files changed, 35 insertions, 12 deletions
diff --git a/Configure.pl b/Configure.pl
index 829023c..0611b5f 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -1,5 +1,5 @@
#! perl
-# Copyright (C) 2009 The Perl Foundation
+# Copyright (C) 2009-2014 The Perl Foundation
use 5.008;
use strict;
@@ -32,8 +32,8 @@ MAIN: {
my %options;
GetOptions(\%options, 'help!', 'prefix=s',
- 'backends=s', 'no-clean!',
- 'gen-nqp:s',
+ 'backends=s', 'no-clean!',
+ 'gen-nqp:s', 'gen-moar:s',
'gen-parrot:s', 'parrot-option=s@',
'parrot-make-option=s@',
'make-install!', 'makefile-timing!',
@@ -64,7 +64,7 @@ MAIN: {
$options{prefix} ||= 'install';
$options{prefix} = File::Spec->rel2abs($options{prefix});
my $prefix = $options{'prefix'};
- my %known_backends = (parrot => 1, jvm => 1);
+ my %known_backends = (parrot => 1, jvm => 1, moar => 1);
my %letter_to_backend;
my $default_backend;
for (keys %known_backends) {
@@ -88,8 +88,7 @@ MAIN: {
}
else {
for my $l (sort keys %letter_to_backend) {
- # TODO: needs .exe/.bat magic on windows?
- if (-x "$prefix/bin/nqp-$l") {
+ if (-x "$prefix/bin/nqp-$l" || -x "$prefix/bin/nqp-$l.bat" || -x "$prefix/bin/nqp-$l.exe") {
my $b = $letter_to_backend{$l};
print "Found $prefix/bin/nqp-$l (backend $b)\n";
$backends{$b} = 1;
@@ -97,12 +96,32 @@ MAIN: {
}
}
unless (%backends) {
- $backends{parrot} = 1;
+ if (defined $options{'gen-moar'}) {
+ $backends{moar} = 1;
+ $default_backend = 'moar';
+ }
+ else {
+ $backends{parrot} = 1;
+ $default_backend = 'parrot';
+ }
}
}
+ $config{backend_exes} = join ' ', map
+ { '$(RAKUDO_DIR)/$(PERL6_' . uc(substr $_, 0, 1) . '_EXE)' }
+ keys %backends;
+ $config{backend_modules_install} = join ' ', map
+ { 'modules-install-' . lc(substr $_, 0, 1) }
+ keys %backends;
+ $config{backend_modules_test} = join ' ', map
+ { 'modules-test-' . lc(substr $_, 0, 1) }
+ keys %backends;
+ $config{default_backend_exe} = '$(PERL6_' .
+ uc(substr $default_backend, 0, 1) .
+ '_INSTALL)';
+
unless ($backends{parrot}) {
- warn "JVM-only builds are currently not supported, and might go wrong.\n";
+ warn "JVM/Moar-only builds are currently not supported, and might go wrong.\n";
}
# Save options in config.status
@@ -119,6 +138,7 @@ MAIN: {
$config{'stagestats'} = '--stagestats' if $options{'makefile-timing'};
$config{'cpsep'} = $^O eq 'MSWin32' ? ';' : ':';
$config{'shell'} = $^O eq 'MSWin32' ? 'cmd' : 'sh';
+ $config{'bat'} = $^O eq 'MSWin32' ? '.bat' : '';
my $make = $config{'make'} = $^O eq 'MSWin32' ? 'nmake' : 'make';
my @prefixes = sort map substr($_, 0, 1), keys %backends;
@@ -223,14 +243,17 @@ Configure.pl - $lang Configure
General Options:
--help Show this text
--prefix=dir Install files in dir; also look for executables there
- --backends=parrot,jvm Which backend(s) to use
+ --backends=parrot,jvm,moar
+ Which backend(s) to use
+ --gen-moar[=branch]
+ Download and build a copy of MoarVM
--gen-nqp[=branch]
Download and build a copy of NQP
- --gen-parrot[=branch]
+ --gen-parrot[=branch]
Download and build a copy of Parrot
- --parrot-option='--option'
+ --parrot-option='--option'
Options to pass to Parrot's Configure.pl
- --parrot-make-option='--option'
+ --parrot-make-option='--option'
Options to pass to Parrot's make, for example:
--parrot-make-option='--jobs=4'
--makefile-timing Enable timing of individual makefile commands