Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'nom' into newio
  • Loading branch information
lizmat committed Feb 20, 2015
2 parents 8619e2c + 9a75383 commit b327d0e
Show file tree
Hide file tree
Showing 78 changed files with 209 additions and 7,135 deletions.
7 changes: 0 additions & 7 deletions .gitignore
Expand Up @@ -62,7 +62,6 @@ perl6-debug-m
perl6-debug-m.bat
t/localtest.data
t/spec
/parrot
perl6.c
perl6.o
MANIFEST
Expand All @@ -77,12 +76,6 @@ dynext/*.pdb
dynext/*.dylib
perl6_group.?
perl6_group.obj
libparrot.dll
cygparrot*.dll
src/vm/parrot/guts/*.o
src/vm/parrot/guts/*.obj
src/vm/parrot/guts/*.bundle
src/vm/parrot/guts/*.pdb
docs/test_summary.times
docs/test_summary.times.tmp
lib/DateTime/strftime.pir
Expand Down
85 changes: 11 additions & 74 deletions Configure.pl
Expand Up @@ -36,8 +36,6 @@
'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 {
Expand All @@ -58,7 +56,7 @@
}
$options{prefix} = File::Spec->rel2abs($options{prefix});
my $prefix = $options{'prefix'};
my @known_backends = qw/moar jvm parrot/;
my @known_backends = qw/moar jvm/;
my %known_backends = map { $_, 1; } @known_backends;
my %letter_to_backend;
my $default_backend;
Expand All @@ -72,6 +70,10 @@
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) .
Expand Down Expand Up @@ -100,19 +102,12 @@
$backends{moar} = 1;
$default_backend ||= 'moar';
}
if (exists $options{'gen-parrot'}) {
push @backends, 'parrot' unless $backends{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";
}
Expand Down Expand Up @@ -171,59 +166,13 @@
# 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} };
unless ($nqp_config{'parrot::has_icu'}) {
push @errors, 'Parrot without ICU is not supported anymore.';
}
}
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';
Expand Down Expand Up @@ -293,17 +242,12 @@
}
}

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' : '';
Expand Down Expand Up @@ -353,29 +297,22 @@ sub print_help {
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
--gen-moar[=branch]
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', 'MoarVM', 'parrot' with corresponding git repos should be in for_perl6 folder
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.
Expand Down
34 changes: 13 additions & 21 deletions INSTALL.txt
@@ -1,25 +1,19 @@
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 install on Parrot, you'll also need to have the ICU
library installed (<http://site.icu-project.org/>). Parrot itself can
be installed without ICU, but Rakudo needs it to be installed for some
Unicode-related features. 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.

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
Expand All @@ -46,8 +40,6 @@
Once you have an up-to-date copy of Rakudo, build it as follows:

$ perl Configure.pl --gen-moar --gen-nqp --backends=moar # Moar only
or:
$ perl Configure.pl --gen-parrot --gen-nqp --backends=parrot # Parrot
or:
$ perl Configure.pl --gen-nqp --backends=jvm # needs JDK 1.7 installed
then:
Expand All @@ -71,7 +63,7 @@
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-moar" above option tells Configure.pl to automatically
Expand All @@ -81,30 +73,30 @@
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-parrot flag works the same way.
you're working with.

If you already have MoarVM installed, you can use
"--with-moar=/path/to/bin/moar" to use it instead of
building a new one. This installed MoarVM must include its
development environment. Similarly, if you already have NQP
installed, you can specify "--with-nqp=/path/to/bin/nqp"
to use it. (Note that this must be NQP, not the NQP-rx that
comes with MoarVM.) Also, "--with-parrot" does what you'd expect.
comes with MoarVM.)

The versions of any already installed NQP or MoarVM/Parrot binaries must
The versions of any already installed NQP or MoarVM binaries must
satify a minimum specified by the Rakudo being built -- Configure.pl
and "make" will verify this for you. Released versions of Rakudo
generally build against the latest release of MoarVM/Parrot; checkouts of
Rakudo's HEAD revision from Github often require a version of MoarVM/Parrot
that is newer than the most recent MoarVM/Parrot monthly release.
generally build against the latest release of MoarVM; checkouts of
Rakudo's HEAD revision from Github often require a version of MoarVM
that is newer than the most recent MoarVM monthly release.

Once built, Rakudo's "make install" target will install Rakudo and its
libraries into the directories specified by the MoarVM/Parrot installation
libraries into the directories specified by the MoarVM installation
used to create it or whatever you specified with the --prefix flag.
Until this step is performed, the "perl6" executable created by "make"
above can only be reliably run from the root of Rakudo's build directory.
After "make install" is performed, the installed executable can be run
from any directory (as long as the Parrot and/or MoarVM installations that
from any directory (as long as the MoarVM installation that
were used to create it remain intact).

If the Rakudo compiler is invoked without an explicit script to run, it
Expand Down
22 changes: 5 additions & 17 deletions README.md
@@ -1,7 +1,6 @@
# Rakudo Perl 6

This is Rakudo Perl, a Perl 6 compiler for the Parrot virtual machine,
the JVM and MoarVM.
This is Rakudo Perl, a Perl 6 compiler for the MoarVM and JVM.

Rakudo Perl is Copyright (C) 2008-2015, The Perl Foundation. Rakudo Perl
is distributed under the terms of the Artistic License 2.0. For more
Expand Down Expand Up @@ -44,14 +43,6 @@ To automatically download and build a fresh MoarVM and NQP, run:

perl Configure.pl --gen-moar --gen-nqp --backends=moar

### Configuring Rakudo to run on Parrot

To automatically download and build a fresh Parrot and NQP, run:

perl Configure.pl --gen-parrot --gen-nqp --backends=parrot

It is recommended to first install the libicu-dev and libreadline-dev packages.

### Configuring Rakudo to run on the JVM

Note that to run Rakudo on JVM, JDK 1.7 must be installed. To automatically
Expand All @@ -70,19 +61,18 @@ By supplying combinations of backends to the `--backends` flag, you
can get two or three backends built in the same prefix. The first
backend you supply in the list is the one that gets the `perl6` name
as a symlink, and all backends are installed seperately as
`perl6-m`, `perl6-p`, or `perl6-j` for Rakudo on
MoarVM, Parrot, or JVM respectively.
`perl6-m` or `perl6-j` for Rakudo on
MoarVM, or JVM respectively.

The format for the `--backends` flag is:

$ perl Configure.pl --backends=moar,parrot
$ perl Configure.pl --backends=parrot,moar,jvm
$ perl Configure.pl --backends=moar,jvm
$ perl Configure.pl --backends=ALL

## Where to get help or answers to questions

There are several mailing lists, IRC channels, and wikis available with
help for Perl 6 and Rakudo on Parrot. Figuring out the right one to use
help for Perl 6 and Rakudo. Figuring out the right one to use
is often the biggest battle. Here are some rough guidelines:

The central hub for Perl 6 information is [perl6.org](http://perl6.org/).
Expand All @@ -99,8 +89,6 @@ to help. You can follow "@rakudoperl" on Twitter, and there's
a Perl 6 news aggregator at [Planet Perl 6](http://pl6anet.org/).

Questions about NQP can also be posted to the #perl6 IRC channel.
For questions about Parrot, see <http://parrot.org/> for links and
resources, or join the #parrot IRC channel on irc.perl.org .
For questions about MoarVM, you can join #moarvm on freenode.

## Reporting bugs
Expand Down

0 comments on commit b327d0e

Please sign in to comment.