| 1 | package Module::Build; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | # This module doesn't do much of anything itself, it inherits from the | ||||||||||||||
| 4 | # modules that do the real work. The only real thing it has to do is | ||||||||||||||
| 5 | # figure out which OS-specific module to pull in. Many of the | ||||||||||||||
| 6 | # OS-specific modules don't do anything either - most of the work is | ||||||||||||||
| 7 | # done in Module::Build::Base. | ||||||||||||||
| 8 | |||||||||||||||
| 9 | 297 | ▶ | use 5.006; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | 297 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 297 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 12 | 297 | ▶ | use File::Spec (); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | 297 | ▶ | use File::Path (); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 14 | 297 | ▶ | use File::Basename (); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 15 | 297 | ▶ | use Perl::OSType (); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 16 | |||||||||||||||
| 17 | 297 | ▶ | use Module::Build::Base; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 18 | |||||||||||||||
| 19 | 297 | our @ISA = qw(Module::Build::Base); | |||||||||||||
| 20 | 297 | our $VERSION = '0.4234'; | |||||||||||||
| 21 | 297 | $VERSION = eval $VERSION; | |||||||||||||
| 22 | |||||||||||||||
| 23 | # Inserts the given module into the @ISA hierarchy between | ||||||||||||||
| 24 | # Module::Build and its immediate parent | ||||||||||||||
| 25 | 297 | ▶ | sub _interpose_module { | ||||||||||||
|
Subroutine
_interpose_module: called CC=4 SCAR=14.2
| |||||||||||||||
| 26 | 297 | my ($self, $mod) = @_; | |||||||||||||
| 27 | 297 | ▶ | eval "use $mod"; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 28 | 297 | ▶ | die $@ if $@; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 29 | |||||||||||||||
| 30 | 297 | ▶ | no strict 'refs'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 31 | 297 | my $top_class = $mod; | |||||||||||||
| 32 | 297 | ▶ | while (@{"${top_class}::ISA"}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 33 | 297 | ▶ | last if ${"${top_class}::ISA"}[0] eq $ISA[0]; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 34 | 0 | $top_class = ${"${top_class}::ISA"}[0]; | |||||||||||||
| 35 | } | ||||||||||||||
| 36 | |||||||||||||||
| 37 | 297 | @{"${top_class}::ISA"} = @ISA; | |||||||||||||
| 38 | 297 | @ISA = ($mod); | |||||||||||||
| 39 | } | ||||||||||||||
| 40 | |||||||||||||||
| 41 | 297 | ▶ | if (grep {-e File::Spec->catfile($_, qw(Module Build Platform), $^O) . '.pm'} @INC) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 42 | 0 | __PACKAGE__->_interpose_module("Module::Build::Platform::$^O"); | |||||||||||||
| 43 | |||||||||||||||
| 44 | } elsif ( my $ostype = os_type() ) { | ||||||||||||||
| 45 | 297 | __PACKAGE__->_interpose_module("Module::Build::Platform::$ostype"); | |||||||||||||
| 46 | |||||||||||||||
| 47 | } else { | ||||||||||||||
| 48 | 0 | warn "Unknown OS type '$^O' - using default settings\n"; | |||||||||||||
| 49 | } | ||||||||||||||
| 50 | |||||||||||||||
| 51 | 297 | ▶ | sub os_type { return Perl::OSType::os_type() } | ||||||||||||
|
Subroutine
os_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 52 | |||||||||||||||
| 53 | 95 | ▶ | sub is_vmsish { return Perl::OSType::is_os_type('VMS') } | ||||||||||||
|
Subroutine
is_vmsish: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 54 | 13 | ▶ | sub is_windowsish { return Perl::OSType::is_os_type('Windows') } | ||||||||||||
|
Subroutine
is_windowsish: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 55 | 3 | ▶ | sub is_unixish { return Perl::OSType::is_os_type('Unix') } | ||||||||||||
|
Subroutine
is_unixish: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 56 | |||||||||||||||
| 57 | 297 | 1; | |||||||||||||
| 58 | |||||||||||||||
| 59 | __END__ | ||||||||||||||