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

Imported Upstream version 2015.03

parent ea168771
......@@ -40,6 +40,9 @@ U: azawawi
E: ahmad.zawawi@gmail.com
D: Rakudo builtins, win32 patches
N: Andrew Egeler
U: retupmoca
N: Andrew Whitworth
E: wknight8111@gmail.com
U: Whiteknight
......@@ -69,6 +72,12 @@ U: mmcleric
E: me@berekuk.ru
D: Whatever-currying, colonpair fixes
N: Bart Wiegmans
U: bdw
U: brrt
E: bartwiegmans@gmail.com
D: Hack MoarVM JIT stuff
N: Bernhard Schmalhofer
U: bernhard
E: Bernhard.Schmalhofer@gmx.de
......@@ -100,6 +109,10 @@ N: Carl Mäsak
E: cmasak@gmail.com
U: masak
N: Carlin Bingham
E: cb@viennan.net
U: carbin
N: Chip Salzenberg
D: Release manager emeritus
D: Architect emeritus (0.1.2-0.4.5)
......@@ -119,6 +132,11 @@ N: Chris Fields
U: cjfields
D: Rakudo patches
N: Christian Bartolomäus
U: usev6
U: bartolin
E: bartolin@gmx.de
N: Christoph Otto a.k.a. cotto
U: cotto
E: christoph@mksig.org
......@@ -305,8 +323,7 @@ E: mls@suse.de
N: Moritz Lenz
E: moritz@faui2k3.org
U: moritz
U: moritz_
D: Test infrastructure, tests, various Rakudo features and built-ins
D: Test infrastructure, tests, general Rakudo hacking
N: Nicholas Clark
U: nicholas
......@@ -332,6 +349,11 @@ N: Paul Cochrane
U: paultcochrane
E: paultcochrane@gmail.com
N: Pepe Schwarz
U: psch
U: peschwa
E: peschwa@gmail.com
N: Peter Gibbs
U: petergibbs
E: peter@emkel.co.za
......
......@@ -36,9 +36,8 @@ MAIN: {
'gen-nqp:s',
'gen-moar:s', 'moar-option=s@',
'git-protocol=s',
'gen-parrot:s', 'parrot-option=s@',
'parrot-make-option=s@',
'make-install!', 'makefile-timing!',
'git-depth=s', 'git-reference=s',
) or do {
print_help();
exit(1);
......@@ -50,27 +49,38 @@ MAIN: {
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});
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 $default_backend;
for (keys %known_backends) {
$letter_to_backend{ substr($_, 0, 1) } = $_;
}
my @backends;
my %backends;
if (defined $options{backends}) {
$options{backends} = join ",", keys %known_backends
$options{backends} = join ",", @known_backends
if uc($options{backends}) eq 'ALL';
for my $b (split /,\s*/, $options{backends}) {
$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}) {
die "Unknown backend '$b'; Supported backends are: " .
join(", ", sort keys %known_backends) .
"\n";
}
$backends{$b} = 1;
push @backends, $b;
$default_backend ||= $b;
}
unless (%backends) {
......@@ -79,30 +89,25 @@ 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.exe" || -x "$prefix/bin/nqp-$l.bat") {
my $b = $letter_to_backend{$l};
print "Found $prefix/bin/nqp-$l (backend $b)\n";
$backends{$b} = 1;
push @backends, $b;
$default_backend ||= $b;
}
}
if (exists $options{'gen-moar'}) {
push @backends, 'moar' unless $backends{moar};
$backends{moar} = 1;
$default_backend ||= 'moar';
}
if (exists $options{'gen-parrot'}) {
$backends{parrot} = 1;
$default_backend ||= 'parrot';
}
unless (%backends) {
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"
. "\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"
. "\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"
. "\tperl Configure.pl --backends=jvm --gen-nqp\n\n";
}
......@@ -129,7 +134,7 @@ MAIN: {
open my $MAKEFILE, '>', 'Makefile'
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";
......@@ -144,61 +149,30 @@ MAIN: {
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);
# determine the version of NQP we want
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 %impls = gen_nqp($nqp_want, prefix => $prefix, backends => join(',', sort keys %backends), %options);
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}) {
$config{j_nqp} = $impls{jvm}{bin};
$config{j_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32';
......@@ -241,9 +215,12 @@ MAIN: {
$config{m_nqp} = $impls{moar}{bin};
$config{m_nqp} =~ s{/}{\\}g if $^O eq 'MSWin32';
my %nqp_config;
if ( $impls{moar}{config} ) {
if ( $impls{moar}{ok} ) {
%nqp_config = %{ $impls{moar}{config} };
}
elsif ( $impls{moar}{config} ) {
push @errors, "The nqp-m binary is too old";
}
else {
push @errors, "Unable to read configuration from NQP on MoarVM";
}
......@@ -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;
push @options_to_pass, "--gen-parrot" if $backends{parrot};
push @options_to_pass, "--gen-moar" if $backends{moar};
push @options_to_pass, "--gen-nqp" unless @options_to_pass;
my $options_to_pass = join ' ', @options_to_pass;
my $want_executables = $backends{parrot} && $backends{moar}
? ', Parrot and MoarVM'
: $backends{parrot}
? ' and Parrot'
: $backends{moar}
my $want_executables =$backends{moar}
? ' and MoarVM'
: '';
my $s1 = @options_to_pass > 1 ? 's' : '';
......@@ -325,7 +297,7 @@ Configure.pl - $lang Configure
General Options:
--help Show this text
--prefix=dir Install files in dir; also look for executables there
--backends=parrot,jvm,moar
--backends=jvm,moar
Which backend(s) to use (or ALL for all of them)
--gen-nqp[=branch]
Download and build a copy of NQP
......@@ -333,15 +305,14 @@ General Options:
Download and build a copy of MoarVM to use
--moar-option='--option=value'
Options to pass to MoarVM's Configure.pl
--gen-parrot[=branch]
Download and build a copy of Parrot
--parrot-option='--option'
Options to pass to Parrot's Configure.pl
--parrot-make-option='--option'
Options to pass to Parrot's make, for example:
--parrot-make-option='--jobs=4'
--git-protocol={ssh,https,git}
Protocol used for cloning git repos
--git-depth=<number>
Use the --git-depth option for git clone with parameter number
--git-reference=<path>
Use --git-reference option to identify local path where git repositories are stored
For example: --git-reference=/home/user/repo/for_perl6
Folders 'nqp' and 'MoarVM' with corresponding git repos should be in for_perl6 folder
--makefile-timing Enable timing of individual makefile commands
Configure.pl also reads options from 'config.default' in the current directory.
......
Build requirements (Installing from source)
For building Rakudo you need at least a C compiler, a "make" utility,
and Perl 5.8 or newer. To automatically obtain and build Parrot or MoarVM
and Perl 5.8 or newer. To automatically obtain and build MoarVM
as well as NQP, you may also need a a git client, which is also needed
for fetching the test suite.
Building rakudo can take up to 1.5G of memory when compiling for the
parrot runtime. The requirements are likely higher for the JVM backend
and 1G is sufficient to build everything for the MoarVM backend.
In order to fully support Unicode on parrot, you'll also want to have
the ICU library installed (<http://site.icu-project.org/>). Rakudo on
parrot can run without ICU, but some Unicode-related features do not
work properly. Rakudo on JVM and MoarVM don't need ICU.
Building rakudo can take up to 1G of memory when compiling for the
MoarVM runtime. The requirements are higher for the JVM backend.
To get readline support (command history and editing), you'll also
need the "libreadline-dev" library.
......@@ -19,7 +13,7 @@
As an example, on Debian GNU/Linux or Ubuntu Linux, the necessary
components for building Rakudo can be installed via the command
aptitude install make gcc libicu-dev libreadline-dev git-core
aptitude install make gcc libreadline-dev git
(Perl is installed by default already). To enable parallel testing you
also need the CPAN module Test::Harness in version 3.16 or newer; you
......@@ -45,11 +39,10 @@
Once you have an up-to-date copy of Rakudo, build it as follows:
$ cd rakudo
$ perl Configure.pl --gen-parrot # to get only the parrot backend
$ perl Configure.pl --gen-parrot --gen-moar # to get parrot & moar
# or to get parrot, moar and jvm:
$ perl Configure.pl --gen-parrot --gen-moar --backends=parrot,moar,jvm
$ perl Configure.pl --gen-moar --gen-nqp --backends=moar # Moar only
or:
$ perl Configure.pl --gen-nqp --backends=jvm # needs JDK 1.7 installed
then:
$ make
This will create a "perl6" or "perl6.exe" executable in the current
......@@ -70,40 +63,40 @@
the "install/bin" directory locally, no additional root
privileges necessary.
If you want to have perl6, nqp, parrot, and moar installed into a
If you want to have perl6, nqp, and moar installed into a
different directory, you may supply --prefix= to Configure.pl.
The "--gen-parrot" above option tells Configure.pl to automatically
download and build the most appropriate version of NQP and Parrot
into local "nqp/" and "parrot/" subdirectories, install NQP and Parrot
The "--gen-moar" above option tells Configure.pl to automatically
download and build the most appropriate version of NQP and MoarVM
into local "nqp/" and "moar/" subdirectories, install NQP and MoarVM
into the "install/" subdirectory, and use them for building Rakudo.
It's okay to use the "--gen-parrot" option on later invocations of
Configure.pl; the configure system will re-build NQP and/or Parrot
It's okay to use the "--gen-moar" option on later invocations of
Configure.pl; the configure system will re-build NQP and/or MoarVM
only if a newer version is needed for whatever version of Rakudo
you're working with. The --gen-moar flag works the same way.
you're working with.
If you already have Parrot installed, you can use
"--with-parrot=/path/to/bin/parrot" to use it instead of