Browse files

[cage] Improve llvm detection

Probe for llvm-config-3.0 llvm-config-2.9 llvm-config-2.8 which do exist on debian,
where llvm-config does not exist.

Print found version, like "yes, 3.0" as with gcc and other libs.
If not requested, print "not requested" instead of "no" to give a hint,
that --with-llvm is wanted.

Add llvm and inline probes to ChangeLog
  • Loading branch information...
1 parent c0dd90b commit e97ecc5854c1cc8ce5166da5bed777b3a4f7269f @rurban rurban committed Oct 1, 2012
Showing with 16 additions and 6 deletions.
  1. +2 −0 ChangeLog
  2. +14 −6 config/auto/llvm.pm
View
2 ChangeLog
@@ -15,6 +15,8 @@
+ Cleaned wrong UNUSED(arg) macros in all pmc's due to an improved
pmc2c compiler, which SHIMs all UNUSED args. [GH #836]
+ Added clang++ support and a new auto::alignof Configure step. [GH #844]
+ + Fixed auto::inline for C++ compilers
+ + Improved auto::llvm
- Branches
+ The threads branch is almost ready to be merged. Some remaining races
have been fixed. There are only some remaining platforms errors on
View
20 config/auto/llvm.pm
@@ -36,6 +36,7 @@ sub runstep {
my $verbose = $conf->options->get( 'verbose' );
unless ( $conf->options->get( 'with-llvm' ) ) {
$self->_handle_result( $conf, 0 );
+ $self->set_result('not requested');
print "LLVM not requested\n" if $verbose;
return 1;
}
@@ -45,8 +46,15 @@ sub runstep {
# runstep() with a value of 1. If a given probe does not rule out LLVM,
# we will proceed onward.
- my $llvm_bindir = capture_output( qw| llvm-config --bindir | ) || '';
- chomp $llvm_bindir;
+ my ($llvm_bindir, $llvm_config);
+ for my $bin (qw(llvm-config llvm-config-3.0 llvm-config-2.9 llvm-config-2.8)) {
+ $llvm_bindir = capture_output( $bin, "--bindir" ) || '';
+ chomp $llvm_bindir;
+ if ( $llvm_bindir ) {
+ $llvm_config = $bin;
+ last;
+ }
+ }
if (! $llvm_bindir ) {
print "Unable to find directory for 'llvm-config' executable\n"
if $verbose;
@@ -69,7 +77,7 @@ sub runstep {
}
}
- $self->_handle_result($conf, 1);
+ $self->_handle_result($conf, $rv);
return 1;
# Having gotten this far, we will take a simple C file, compile it into
@@ -176,14 +184,14 @@ sub version_check {
if ($verbose) {
print "Found 'lli' version $version\n";
}
- return 1;
+ return $version;
}
}
else {
print "Unable to extract version for LLVM component 'lli'\n"
if $verbose;
$self->_handle_result( $conf, 0 );
- return;
+ return 0;
}
}
@@ -219,7 +227,7 @@ sub _handle_failure_to_assemble_assembly {
sub _handle_result {
my ($self, $conf, $result) = @_;
if ( $result ) {
- $self->set_result('yes');
+ $self->set_result( "yes, ".$result );
$conf->data->set( has_llvm => 1 );
}
else {

0 comments on commit e97ecc5

Please sign in to comment.