| File: | config/auto/cpu.pm |
| Coverage: | 95.2% |
| line | stmt | bran | cond | sub | code |
|---|---|---|---|---|---|
| 1 | # Copyright (C) 2001-2006, Parrot Foundation. | ||||
| 2 | |||||
| 3 - 11 | =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 | ||||
| 12 | |||||
| 13 | package auto::cpu; | ||||
| 14 | |||||
| 15 | 2 2 2 | use strict; | |||
| 16 | 2 2 2 | use warnings; | |||
| 17 | |||||
| 18 | 2 2 2 | use base qw(Parrot::Configure::Step); | |||
| 19 | |||||
| 20 | 2 2 2 | use Carp; | |||
| 21 | |||||
| 22 | |||||
| 23 | sub _init { | ||||
| 24 | 3 | my $self = shift; | |||
| 25 | 3 | my %data; | |||
| 26 | 3 | $data{description} = q{Generate CPU specific stuff}; | |||
| 27 | 3 | $data{result} = q{}; | |||
| 28 | 3 | return \%data; | |||
| 29 | } | ||||
| 30 | |||||
| 31 | sub runstep { | ||||
| 32 | 3 | my ( $self, $conf ) = @_; | |||
| 33 | |||||
| 34 | 3 | $conf->data->add( ' ', TEMP_atomic_o => '' ); # assure a default | |||
| 35 | |||||
| 36 | 3 | my $hints = "auto::cpu::" . $conf->data->get('cpuarch') . "::auto"; | |||
| 37 | |||||
| 38 | 3 | $conf->debug("\t(cpu hints = '$hints') "); | |||
| 39 | |||||
| 40 | 2 1 1 1 0 0 3 | eval "use $hints"; | |||
| 41 | 3 | unless ($@) { | |||
| 42 | 1 | $hints->runstep( $conf, @_ ); | |||
| 43 | } | ||||
| 44 | else { | ||||
| 45 | 2 | $conf->debug("(no cpu specific hints)"); | |||
| 46 | } | ||||
| 47 | |||||
| 48 | 3 | return 1; | |||
| 49 | } | ||||
| 50 | |||||
| 51 | 1; | ||||
| 52 | |||||
| 53 | # Local Variables: | ||||
| 54 | # mode: cperl | ||||
| 55 | # cperl-indent-level: 4 | ||||
| 56 | # fill-column: 100 | ||||
| 57 | # End: | ||||
| 58 | # vim: expandtab shiftwidth=4: | ||||