On Mon, 6 Aug 2007, Mark Glines via RT wrote: > On Mon, 6 Aug 2007 15:20:39 -0700 > chromatic <[EMAIL PROTECTED]> wrote: > > That's not exactly the same as a stringified hash. I think we can > > just remove the cc_run() bits and be fine (at least, it worked for > > me). > > Indeed, with the attached patch I have working attributes again.
Thanks. This next patch does a little more cleanup on the attributes checking. I revised config/auto/attributes.pm to use the existing Configure routines cc_build() and conf->data_add() rather than re-implementing them. I also removed some now unnecessary #includes"parrot/compiler.h" statements and cc_inc fiddling in config/init/hints/solaris.pm There should be no functional changes. diff -r -u parrot-orig/config/auto/attributes.pm parrot-andy/config/auto/attributes.pm --- parrot-orig/config/auto/attributes.pm 2007-08-07 03:15:09.000000000 -0400 +++ parrot-andy/config/auto/attributes.pm 2007-08-07 13:09:29.000000000 -0400 @@ -63,62 +63,24 @@ my $cc = $conf->option_or_data( 'cc' ); cc_gen('config/auto/attributes/test_c.in'); - my $ccflags = $conf->option_or_data( 'ccflags'); - my $tryflags = "$ccflags -D$attr"; + my $tryflags = "-D$attr"; # These are OK to fail, because we're trying them out. - my $command_line = "$cc -o test -Iinclude $tryflags test.c"; - $verbose and print " ", $command_line, $/; + eval { cc_build($tryflags) } ; - my $exit_code = Parrot::Configure::Step::_run_command( - $command_line, 'test.cco', 'test.ccr' ); - $verbose and print " exit code: $exit_code$/"; - - return if $exit_code; + if ($@) { + print " Failed: [EMAIL PROTECTED]" if $verbose; + } + else { + print " Ok.\n" if $verbose; + $conf->data->add(' ', ccflags => $tryflags); + } - $conf->data->set( ccflags => $tryflags ); + cc_clean(); return; } -sub blerugh { - my ( $self, $conf, $attr ) = @_; - - my $verbose = $conf->options->get('verbose'); - if ( 0 ) { - my $hints_used = 0; - - my $hints = "init::hints::" . lc($^O); - - print "[ $hints " if $verbose; - - eval "use $hints"; - die $@ if $@; - - # Call the runstep method if it exists. - # Otherwise the step must have done - # its work when it was loaded. - $hints->runstep( $conf, @_ ) if $hints->can('runstep'); - $hints_used++; - - $hints = "init::hints::local"; - print "$hints " if $verbose; - eval "use $hints"; - unless ($@) { - $hints->runstep( $conf, @_ ) if $hints->can('runstep'); - $hints_used++; - } - - if ( $hints_used == 0 ) { - print "(no hints) " if $verbose; - } - - print "]" if $verbose; - } - - return $self; -} - 1; # Local Variables: diff -r -u parrot-orig/config/auto/gcc/test_c.in parrot-andy/config/auto/gcc/test_c.in --- parrot-orig/config/auto/gcc/test_c.in 2007-08-06 19:15:12.000000000 -0400 +++ parrot-andy/config/auto/gcc/test_c.in 2007-08-07 09:15:53.000000000 -0400 @@ -4,8 +4,6 @@ #include <stdio.h> #include <stdlib.h> -#include "parrot/compiler.h" - int main(int argc, char **argv) diff -r -u parrot-orig/config/auto/msvc/test_c.in parrot-andy/config/auto/msvc/test_c.in --- parrot-orig/config/auto/msvc/test_c.in 2007-08-06 19:15:13.000000000 -0400 +++ parrot-andy/config/auto/msvc/test_c.in 2007-08-07 12:57:23.000000000 -0400 @@ -4,8 +4,6 @@ #include <stdio.h> #include <stdlib.h> -#include "parrot/compiler.h" - int main(int argc, char *argv[]) diff -r -u parrot-orig/config/init/hints/solaris.pm parrot-andy/config/init/hints/solaris.pm --- parrot-orig/config/init/hints/solaris.pm 2007-08-03 11:15:16.000000000 -0400 +++ parrot-andy/config/init/hints/solaris.pm 2007-08-07 09:03:36.000000000 -0400 @@ -35,8 +35,7 @@ # Can't call cc_build since we haven't set all the flags yet. # This should suffice for this test. - my $cc_inc = $conf->data->get('cc_inc'); - Parrot::Configure::Step::_run_command( "$cc -o test test.c $cc_inc", 'test.cco', 'test.cco' ) + Parrot::Configure::Step::_run_command( "$cc -o test test.c", 'test.cco', 'test.cco' ) and confess "C compiler failed (see test.cco)"; %gnuc = eval cc_run() or die "Can't run the test program: $!"; if ( defined $gnuc{__GNUC__} ) { -- Andy Dougherty [EMAIL PROTECTED]