Skip to content

Commit

Permalink
If C compiler is gcc, capture the 'defines' and make them available t…
Browse files Browse the repository at this point in the history
…o Parrot

as 'gccdefines*' in %PConfig.


git-svn-id: https://svn.parrot.org/parrot/branches/gcc_defines@49729 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
jkeenan committed Oct 30, 2010
1 parent e978f09 commit 393c136
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion config/auto/gcc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ config/auto/gcc.pm - GNU C Compiler
=head1 DESCRIPTION
Determines whether the C compiler is actually C<gcc>.
Determines whether the C compiler is actually C<gcc>. If so, sets
C<gccdefines*> attributes.
=cut

Expand All @@ -33,6 +34,16 @@ sub runstep {
my ( $self, $conf ) = @_;
my $gnucref = _probe_for_gcc($conf);
my $rv = $self->_evaluate_gcc($conf, $gnucref);

if (defined( $conf->data->get('gccversion') ) ) {
my @gccdefines = `gcc -x c -E -dM /dev/null`;
chomp @gccdefines;
foreach my $def (@gccdefines) {
my @data = split /\s+/, $def, 3;
$conf->data->set("gccdefines$data[1]" => $data[2]);
}
}

return $rv;
}

Expand Down

0 comments on commit 393c136

Please sign in to comment.