| File: | config/auto/cpu.pm |
| Coverage: | 100.0% |
| line | stmt | bran | cond | sub | code |
|---|---|---|---|---|---|
| 1 | # Copyright (C) 2001-2006, Parrot Foundation. | ||||
| 2 | # $Id: cpu.pm 43393 2010-01-06 02:59:16Z jkeenan $ | ||||
| 3 | |||||
| 4 - 12 | =head1 NAME
config/auto/cpu.pm - CPU specific Files
=head1 DESCRIPTION
Runs C<runstep()> in F<config/auto/cpu/${cpuarch}/auto.pm> if it exists.
=cut | ||||
| 13 | |||||
| 14 | package auto::cpu; | ||||
| 15 | |||||
| 16 | 82 81 81 | use strict; | |||
| 17 | 81 81 81 | use warnings; | |||
| 18 | |||||
| 19 | 81 81 81 | use base qw(Parrot::Configure::Step); | |||
| 20 | |||||
| 21 | 81 81 81 | use Carp; | |||
| 22 | |||||
| 23 | |||||
| 24 | sub _init { | ||||
| 25 | 82 | my $self = shift; | |||
| 26 | 82 | my %data; | |||
| 27 | 82 | $data{description} = q{Generate CPU specific stuff}; | |||
| 28 | 82 | $data{result} = q{}; | |||
| 29 | 82 | return \%data; | |||
| 30 | } | ||||
| 31 | |||||
| 32 | sub runstep { | ||||
| 33 | 82 | my ( $self, $conf ) = @_; | |||
| 34 | |||||
| 35 | 82 | my $verbose = $conf->options->get('verbose'); | |||
| 36 | |||||
| 37 | 82 | $conf->data->add( ' ', TEMP_atomic_o => '' ); # assure a default | |||
| 38 | |||||
| 39 | 82 | my $hints = "auto::cpu::" . $conf->data->get('cpuarch') . "::auto"; | |||
| 40 | |||||
| 41 | 82 | print "\t(cpu hints = '$hints') " if $verbose; | |||
| 42 | |||||
| 43 | 81 80 80 82 | eval "use $hints"; | |||
| 44 | 82 | unless ($@) { | |||
| 45 | 80 | $hints->runstep( $conf, @_ ); | |||
| 46 | } | ||||
| 47 | else { | ||||
| 48 | 2 | print "(no cpu specific hints)" if $verbose; | |||
| 49 | } | ||||
| 50 | |||||
| 51 | 82 | return 1; | |||
| 52 | } | ||||
| 53 | |||||
| 54 | 1; | ||||
| 55 | |||||
| 56 | # Local Variables: | ||||
| 57 | # mode: cperl | ||||
| 58 | # cperl-indent-level: 4 | ||||
| 59 | # fill-column: 100 | ||||
| 60 | # End: | ||||
| 61 | # vim: expandtab shiftwidth=4: | ||||