Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Introduce --with-llvm option to explicitly link to LLVM

fixes tt #2092, patch courtesy of kid51++
  • Loading branch information...
commit 370a41843ce08a1f7ceab1ecfed6fb4e96ef142e 1 parent 48f56a3
@cotto cotto authored
View
5 Configure.pl
@@ -407,6 +407,11 @@ =head2 Other Options
Use this option if you want imcc's parser and lexer files to be generated.
Needs a working parser and lexer.
+=item C<--with-llvm>
+
+Use this option if you have a recent version of LLVM installed and wish Parrot
+to link to it.
+
=back
=head1 CONFIGURATION-FILE INTERFACE
View
12 config/auto/llvm.pm
@@ -7,7 +7,11 @@ config/auto/llvm - Check whether the Low Level Virtual Machine is present
=head1 DESCRIPTION
Determines whether the Low Level Virtual Machine (LLVM) is installed and
-functional on the system. It is OK when it doesn't exist.
+functional on the system. It is okay when it is not present. When a
+sufficiently up-to-date version of LLVM is present, you will need to
+specify C<--with-llvm> as an option to C<perl Configure.pl> in order to tell
+Parrot to link to LLVM, I<i.e.,> building without LLVM is Parrot's default
+setting.
=cut
@@ -30,7 +34,11 @@ sub runstep {
my ( $self, $conf ) = @_;
my $verbose = $conf->options->get( 'verbose' );
- my $llvm_config = $conf->options->get( 'llvm-config' ) || 'llvm-config';
+ unless ( $conf->options->get( 'with-llvm' ) ) {
+ $self->_handle_result( $conf, 0 );
+ print "LLVM not requested\n" if $verbose;
+ return 1;
+ }
# We will run various probes for LLVM. If the probes are unsuccessful, we
# will set_result to 'no', set 'has_llvm' to '', then return from
View
1  lib/Parrot/Configure/Options/Conf/Shared.pm
@@ -71,6 +71,7 @@ our @shared_valid_options = qw{
verbose
verbose-step
version
+ with-llvm
without-crypto
without-core-nci-thunks
without-extra-nci-thunks
View
35 t/steps/auto/llvm-01.t
@@ -5,7 +5,7 @@
use strict;
use warnings;
use File::Temp qw( tempdir );
-use Test::More tests => 48;
+use Test::More tests => 56;
use Carp;
use lib qw( lib t/configure/testlib );
use_ok('config::auto::llvm');
@@ -36,13 +36,13 @@ $conf->options->set( %{$args} );
my $step = test_step_constructor_and_description($conf);
my $ret = $step->runstep($conf);
ok( $ret, "runstep() returned true value" );
-like( $step->result(), qr/yes|no/,
- "Result was either 'yes' or 'no'" );
+like( $step->result(), qr/no/,
+ "LLVM not requested; hence result is 'no'" );
+ok( ! $conf->data->get( 'has_llvm' ),
+ "'has_llvm' set to false value, as expected" );
$conf->replenish($serialized);
-########## --verbose ##########
-
($args, $step_list_ref) = process_options( {
argv => [ q{--verbose} ],
mode => q{configure},
@@ -58,6 +58,31 @@ $step = test_step_constructor_and_description($conf);
\$stdout
);
ok( $ret, "runstep() returned true value" );
+ like( $step->result(), qr/no/,
+ "LLVM not requested; hence result is 'no'" );
+ ok( ! $conf->data->get( 'has_llvm' ),
+ "'has_llvm' set to false value, as expected" );
+ like( $stdout, qr/LLVM not requested/s,
+ "LLVM not requested; got expected verbose output" );
+}
+
+########### --verbose ##########
+
+($args, $step_list_ref) = process_options( {
+ argv => [ q{--verbose}, q{--with-llvm} ],
+ mode => q{configure},
+} );
+
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+{
+ my $stdout;
+ my $ret = capture(
+ sub { $step->runstep($conf) },
+ \$stdout
+ );
+ ok( $ret, "runstep() returned true value" );
like( $step->result(), qr/yes|no/,
"Result was either 'yes' or 'no'" );
SKIP: {
Please sign in to comment.
Something went wrong with that request. Please try again.