Commit 0ac6ac77 authored by Dominique Dumont's avatar Dominique Dumont

Imported Upstream version 2015.03

parent ea168771
...@@ -40,6 +40,9 @@ U: azawawi ...@@ -40,6 +40,9 @@ U: azawawi
E: ahmad.zawawi@gmail.com E: ahmad.zawawi@gmail.com
D: Rakudo builtins, win32 patches D: Rakudo builtins, win32 patches
N: Andrew Egeler
U: retupmoca
N: Andrew Whitworth N: Andrew Whitworth
E: wknight8111@gmail.com E: wknight8111@gmail.com
U: Whiteknight U: Whiteknight
...@@ -69,6 +72,12 @@ U: mmcleric ...@@ -69,6 +72,12 @@ U: mmcleric
E: me@berekuk.ru E: me@berekuk.ru
D: Whatever-currying, colonpair fixes D: Whatever-currying, colonpair fixes
N: Bart Wiegmans
U: bdw
U: brrt
E: bartwiegmans@gmail.com
D: Hack MoarVM JIT stuff
N: Bernhard Schmalhofer N: Bernhard Schmalhofer
U: bernhard U: bernhard
E: Bernhard.Schmalhofer@gmx.de E: Bernhard.Schmalhofer@gmx.de
...@@ -100,6 +109,10 @@ N: Carl Mäsak ...@@ -100,6 +109,10 @@ N: Carl Mäsak
E: cmasak@gmail.com E: cmasak@gmail.com
U: masak U: masak
N: Carlin Bingham
E: cb@viennan.net
U: carbin
N: Chip Salzenberg N: Chip Salzenberg
D: Release manager emeritus D: Release manager emeritus
D: Architect emeritus (0.1.2-0.4.5) D: Architect emeritus (0.1.2-0.4.5)
...@@ -119,6 +132,11 @@ N: Chris Fields ...@@ -119,6 +132,11 @@ N: Chris Fields
U: cjfields U: cjfields
D: Rakudo patches D: Rakudo patches
N: Christian Bartolomäus
U: usev6
U: bartolin
E: bartolin@gmx.de
N: Christoph Otto a.k.a. cotto N: Christoph Otto a.k.a. cotto
U: cotto U: cotto
E: christoph@mksig.org E: christoph@mksig.org
...@@ -305,8 +323,7 @@ E: mls@suse.de ...@@ -305,8 +323,7 @@ E: mls@suse.de
N: Moritz Lenz N: Moritz Lenz
E: moritz@faui2k3.org E: moritz@faui2k3.org
U: moritz U: moritz
U: moritz_ D: Test infrastructure, tests, general Rakudo hacking
D: Test infrastructure, tests, various Rakudo features and built-ins
N: Nicholas Clark N: Nicholas Clark
U: nicholas U: nicholas
...@@ -332,6 +349,11 @@ N: Paul Cochrane ...@@ -332,6 +349,11 @@ N: Paul Cochrane
U: paultcochrane U: paultcochrane
E: paultcochrane@gmail.com E: paultcochrane@gmail.com
N: Pepe Schwarz
U: psch
U: peschwa
E: peschwa@gmail.com
N: Peter Gibbs N: Peter Gibbs
U: petergibbs U: petergibbs
E: peter@emkel.co.za E: peter@emkel.co.za
......
...@@ -36,9 +36,8 @@ MAIN: { ...@@ -36,9 +36,8 @@ MAIN: {
'gen-nqp:s', 'gen-nqp:s',
'gen-moar:s', 'moar-option=s@', 'gen-moar:s', 'moar-option=s@',
'git-protocol=s', 'git-protocol=s',
'gen-parrot:s', 'parrot-option=s@',
'parrot-make-option=s@',
'make-install!', 'makefile-timing!', 'make-install!', 'makefile-timing!',
'git-depth=s', 'git-reference=s',
) or do { ) or do {
print_help(); print_help();
exit(1); exit(1);
...@@ -50,27 +49,38 @@ MAIN: { ...@@ -50,27 +49,38 @@ MAIN: {
exit(0); exit(0);
} }
$options{prefix} ||= 'install'; unless (defined $options{prefix}) {
my $dir = getcwd;
print "ATTENTION: no --prefix supplied, building and installing to $dir/install\n";
$options{prefix} = 'install';
}
$options{prefix} = File::Spec->rel2abs($options{prefix}); $options{prefix} = File::Spec->rel2abs($options{prefix});
my $prefix = $options{'prefix'}; my $prefix = $options{'prefix'};
my %known_backends = (parrot => 1, jvm => 1, moar => 1); my @known_backends = qw/moar jvm/;
my %known_backends = map { $_, 1; } @known_backends;
my %letter_to_backend; my %letter_to_backend;
my $default_backend; my $default_backend;
for (keys %known_backends) { for (keys %known_backends) {
$letter_to_backend{ substr($_, 0, 1) } = $_; $letter_to_backend{ substr($_, 0, 1) } = $_;
} }
my @backends;
my %backends; my %backends;
if (defined $options{backends}) { if (defined $options{backends}) {
$options{backends} = join ",", keys %known_backends $options{backends} = join ",", @known_backends
if uc($options{backends}) eq 'ALL'; if uc($options{backends}) eq 'ALL';
for my $b (split /,\s*/, $options{backends}) { for my $b (split /,\s*/, $options{backends}) {
$b = lc $b; $b = lc $b;
if ($b eq 'parrot') {
die "The Parrot backend has been suspended.\n"
. "Please use Rakudo 2015.02 (which still supports parrot), or the MoarVM backend instead\n";
}
unless ($known_backends{$b}) { unless ($known_backends{$b}) {
die "Unknown backend '$b'; Supported backends are: " . die "Unknown backend '$b'; Supported backends are: " .
join(", ", sort keys %known_backends) . join(", ", sort keys %known_backends) .
"\n"; "\n";
} }
$backends{$b} = 1; $backends{$b} = 1;
push @backends, $b;
$default_backend ||= $b; $default_backend ||= $b;
} }
unless (%backends) { unless (%backends) {
...@@ -79,30 +89,25 @@ MAIN: { ...@@ -79,30 +89,25 @@ MAIN: {
} }
else { else {
for my $l (sort keys %letter_to_backend) { for my $l (sort keys %letter_to_backend) {
# TODO: needs .exe/.bat magic on windows? if (-x "$prefix/bin/nqp-$l" || -x "$prefix/bin/nqp-$l.exe" || -x "$prefix/bin/nqp-$l.bat") {
if (-x "$prefix/bin/nqp-$l") {
my $b = $letter_to_backend{$l}; my $b = $letter_to_backend{$l};
print "Found $prefix/bin/nqp-$l (backend $b)\n"; print "Found $prefix/bin/nqp-$l (backend $b)\n";
$backends{$b} = 1; $backends{$b} = 1;
push @backends, $b;
$default_backend ||= $b; $default_backend ||= $b;
} }
} }
if (exists $options{'gen-moar'}) { if (exists $options{'gen-moar'}) {
push @backends, 'moar' unless $backends{moar};
$backends{moar} = 1; $backends{moar} = 1;
$default_backend ||= 'moar'; $default_backend ||= 'moar';
} }
if (exists $options{'gen-parrot'}) {
$backends{parrot} = 1;
$default_backend ||= 'parrot';
}
unless (%backends) { unless (%backends) {
die "No suitable nqp executables found! Please specify some --backends, or a --prefix that contains nqp-{p,j,m} executables\n\n" die "No suitable nqp executables found! Please specify some --backends, or a --prefix that contains nqp-{p,j,m} executables\n\n"
. "Example to build for all backends (which will take a while):\n" . "Example to build for all backends (which will take a while):\n"
. "\tperl Configure.pl --backends=moar,parrot,jvm --gen-moar --gen-parrot\n\n" . "\tperl Configure.pl --backends=moar,jvm --gen-moar\n\n"
. "Example to build for MoarVM only:\n" . "Example to build for MoarVM only:\n"
. "\tperl Configure.pl --gen-moar\n\n" . "\tperl Configure.pl --gen-moar\n\n"
. "Example to build for Parrot only:\n"
. "\tperl Configure.pl --gen-parrot\n\n"
. "Example to build for JVM only:\n" . "Example to build for JVM only:\n"
. "\tperl Configure.pl --backends=jvm --gen-nqp\n\n"; . "\tperl Configure.pl --backends=jvm --gen-nqp\n\n";
} }
...@@ -129,7 +134,7 @@ MAIN: { ...@@ -129,7 +134,7 @@ MAIN: {
open my $MAKEFILE, '>', 'Makefile' open my $MAKEFILE, '>', 'Makefile'
or die "Cannot open 'Makefile' for writing: $!"; or die "Cannot open 'Makefile' for writing: $!";
my @prefixes = sort map substr($_, 0, 1), keys %backends; my @prefixes = map substr($_, 0, 1), @backends;
print $MAKEFILE "\n# Makefile code generated by Configure.pl:\n"; print $MAKEFILE "\n# Makefile code generated by Configure.pl:\n";
...@@ -144,61 +149,30 @@ MAIN: { ...@@ -144,61 +149,30 @@ MAIN: {
print $MAKEFILE "$t: ", join(' ', map "$_-$t", @prefixes), "\n"; print $MAKEFILE "$t: ", join(' ', map "$_-$t", @prefixes), "\n";
} }
for my $target (qw/common_bootstrap_sources moar_core_sources/) {
open my $FILELIST, '<', "tools/build/$target"
or die "Cannot read 'tools/build/$target': $!";
my @lines;
while (<$FILELIST>) {
chomp;
push @lines, " $_\\\n";
}
close $FILELIST;
$config{$target} = join '', @lines;
}
fill_template_file('tools/build/Makefile-common.in', $MAKEFILE, %config); fill_template_file('tools/build/Makefile-common.in', $MAKEFILE, %config);
# determine the version of NQP we want # determine the version of NQP we want
my ($nqp_want) = split(' ', slurp('tools/build/NQP_REVISION')); my ($nqp_want) = split(' ', slurp('tools/build/NQP_REVISION'));
$options{'gen-nqp'} ||= '' if exists $options{'gen-parrot'} || exists $options{'gen-moar'}; $options{'gen-nqp'} ||= '' if exists $options{'gen-moar'};
my %binaries; my %binaries;
my %impls = gen_nqp($nqp_want, prefix => $prefix, backends => join(',', sort keys %backends), %options); my %impls = gen_nqp($nqp_want, prefix => $prefix, backends => join(',', sort keys %backends), %options);
my @errors; my @errors;
my %errors; my %errors;
if ($backends{parrot}) {
my %nqp_config;
if ($impls{parrot}{ok}) {
%nqp_config = %{ $impls{parrot}{config} };
}
elsif ($impls{parrot}{config}) {
push @errors, "The nqp-p binary is too old";
}
else {
push @errors, "Unable to read configuration from NQP on Parrot";
}
my $nqp_have = $nqp_config{'nqp::version'} || '';
if ($nqp_have && cmp_rev($nqp_have, $nqp_want) < 0) {
push @errors, "NQP revision $nqp_want required (currently $nqp_have).";
}
if (!@errors) {
push @errors, verify_install([ @NQP::Configure::required_parrot_files,
@NQP::Configure::required_nqp_files ],
%config, %nqp_config);
push @errors,
"(Perhaps you need to 'make install', 'make install-dev',",
"or install the 'devel' package for NQP or Parrot?)"
if @errors;
}
$errors{parrot}{'no gen-nqp'} = @errors && !defined $options{'gen-nqp'};
unless (@errors) {
print "Using $impls{parrot}{bin} (version $nqp_config{'nqp::version'} / Parrot $nqp_config{'parrot::VERSION'}).\n";
if ($^O eq 'MSWin32' or $^O eq 'cygwin') {
$config{'dll'} = '$(PARROT_BIN_DIR)/$(PARROT_LIB_SHARED)';
$config{'dllcopy'} = '$(PARROT_LIB_SHARED)';
$config{'make_dllcopy'} =
'$(PARROT_DLL_COPY): $(PARROT_DLL)'."\n\t".'$(CP) $(PARROT_DLL) .';
}
my $make = fill_template_text('@make@', %config, %nqp_config);
fill_template_file('tools/build/Makefile-Parrot.in', $MAKEFILE, %config, %nqp_config);
}
}
if ($backends{jvm}) { if ($backends{jvm}) {
$config{j_nqp} = $impls{jvm}{bin}; $config{j_nqp} = $impls{jvm}{bin};
$config{j_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32'; $config{j_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32';
...@@ -241,9 +215,12 @@ MAIN: { ...@@ -241,9 +215,12 @@ MAIN: {
$config{m_nqp} = $impls{moar}{bin}; $config{m_nqp} = $impls{moar}{bin};
$config{m_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32'; $config{m_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32';
my %nqp_config; my %nqp_config;
if ( $impls{moar}{config} ) { if ( $impls{moar}{ok} ) {
%nqp_config = %{ $impls{moar}{config} }; %nqp_config = %{ $impls{moar}{config} };
} }
elsif ( $impls{moar}{config} ) {
push @errors, "The nqp-m binary is too old";
}
else { else {
push @errors, "Unable to read configuration from NQP on MoarVM"; push @errors, "Unable to read configuration from NQP on MoarVM";
} }
...@@ -265,17 +242,12 @@ MAIN: { ...@@ -265,17 +242,12 @@ MAIN: {
} }
} }
if ($errors{parrot}{'no gen-nqp'} || $errors{jvm}{'no gen-nqp'} || $errors{moar}{'no gen-nqp'}) { if ($errors{jvm}{'no gen-nqp'} || $errors{moar}{'no gen-nqp'}) {
my @options_to_pass; my @options_to_pass;
push @options_to_pass, "--gen-parrot" if $backends{parrot};
push @options_to_pass, "--gen-moar" if $backends{moar}; push @options_to_pass, "--gen-moar" if $backends{moar};
push @options_to_pass, "--gen-nqp" unless @options_to_pass; push @options_to_pass, "--gen-nqp" unless @options_to_pass;
my $options_to_pass = join ' ', @options_to_pass; my $options_to_pass = join ' ', @options_to_pass;
my $want_executables = $backends{parrot} && $backends{moar} my $want_executables =$backends{moar}
? ', Parrot and MoarVM'
: $backends{parrot}
? ' and Parrot'
: $backends{moar}