File Coverage

blib/lib/Module/Build/Pluggable/CheckLib.pm
Criterion Covered Total %
statement 14 26 53.8
branch 0 4 0.0
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 19 37 51.3


line stmt bran cond sub pod time code
1             package Module::Build::Pluggable::CheckLib;
2 1     1   13342 use strict;
  1         2  
  1         22  
3 1     1   4 use warnings;
  1         0  
  1         19  
4 1     1   488 use utf8;
  1         11  
  1         4  
5 1     1   35 use 5.008005;
  1         2  
6             our $VERSION = '1.03';
7 1     1   379 use parent qw/Module::Build::Pluggable::Base/;
  1         234  
  1         4  
8              
9             sub HOOK_configure {
10 0     0 0   my $self = shift;
11 0 0         unless ($self->builder->have_c_compiler()) {
12 0           warn "This distribution requires a C compiler, but it's not available, stopped.(OS unsupported)\n";
13 0           exit 0;
14             }
15              
16 0           $self->configure_requires('Devel::CheckLib' => '0.04');
17 0           $self->build_requires('Devel::CheckLib' => '0.04');
18              
19 0           require Devel::CheckLib;
20              
21 0           my %opts;
22 0           for my $key (qw/lib header incpath libpath header function/) {
23 0 0         if (exists $self->{$key}) {
24 0           $opts{$key} = $self->{$key};
25             }
26             }
27 0           Devel::CheckLib::check_lib_or_exit(%opts);
28             }
29              
30             1;
31             __END__