| File: | config/auto/thread.pm |
| Coverage: | 100.0% |
| line | stmt | bran | cond | sub | code |
|---|---|---|---|---|---|
| 1 | # Copyright (C) 2009, Parrot Foundation. | ||||
| 2 | |||||
| 3 - 11 | =head1 NAME config/auto/thread.pm - Thread support =head1 DESCRIPTION Determining if the system has thread support. =cut | ||||
| 12 | |||||
| 13 | package auto::thread; | ||||
| 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 Parrot::Configure::Utils ':auto'; | |||
| 21 | |||||
| 22 | sub _init { | ||||
| 23 | 3 | my $self = shift; | |||
| 24 | 3 | my %data; | |||
| 25 | 3 | $data{description} = q{Does your system have threads}; | |||
| 26 | 3 | $data{result} = q{}; | |||
| 27 | 3 | return \%data; | |||
| 28 | } | ||||
| 29 | |||||
| 30 | sub runstep { | ||||
| 31 | 5 | my ( $self, $conf ) = @_; | |||
| 32 | |||||
| 33 | 5 | my $without = $conf->options->get( qw| without-threads |); | |||
| 34 | |||||
| 35 | 5 | if ($without) { | |||
| 36 | 1 | $conf->data->set( HAS_THREADS => 0 ); | |||
| 37 | 1 | $self->set_result('no'); | |||
| 38 | 1 | return 1; | |||
| 39 | } | ||||
| 40 | |||||
| 41 | 4 | if ($conf->data->get('osname') eq 'MSWin32' | |||
| 42 | || $conf->data->get('i_pthread') eq 'define') { | ||||
| 43 | 3 | $conf->data->set( HAS_THREADS => 1 ); | |||
| 44 | 3 | $self->set_result('yes'); | |||
| 45 | } | ||||
| 46 | else { | ||||
| 47 | 1 | $conf->data->set( HAS_THREADS => 0 ); | |||
| 48 | 1 | $self->set_result('no'); | |||
| 49 | } | ||||
| 50 | |||||
| 51 | 4 | 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: | ||||