[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 package ExtUtils::MM; 2 3 use strict; 4 use ExtUtils::MakeMaker::Config; 5 use vars qw(@ISA $VERSION); 6 $VERSION = '6.42'; 7 8 require ExtUtils::Liblist; 9 require ExtUtils::MakeMaker; 10 11 @ISA = qw(ExtUtils::Liblist ExtUtils::MakeMaker); 12 13 =head1 NAME 14 15 ExtUtils::MM - OS adjusted ExtUtils::MakeMaker subclass 16 17 =head1 SYNOPSIS 18 19 require ExtUtils::MM; 20 my $mm = MM->new(...); 21 22 =head1 DESCRIPTION 23 24 B<FOR INTERNAL USE ONLY> 25 26 ExtUtils::MM is a subclass of ExtUtils::MakeMaker which automatically 27 chooses the appropriate OS specific subclass for you 28 (ie. ExtUils::MM_Unix, etc...). 29 30 It also provides a convenient alias via the MM class (I didn't want 31 MakeMaker modules outside of ExtUtils/). 32 33 This class might turn out to be a temporary solution, but MM won't go 34 away. 35 36 =cut 37 38 { 39 # Convenient alias. 40 package MM; 41 use vars qw(@ISA); 42 @ISA = qw(ExtUtils::MM); 43 sub DESTROY {} 44 } 45 46 sub _is_win95 { 47 # miniperl might not have the Win32 functions available and we need 48 # to run in miniperl. 49 return defined &Win32::IsWin95 ? Win32::IsWin95() 50 : ! defined $ENV{SYSTEMROOT}; 51 } 52 53 my %Is = (); 54 $Is{VMS} = $^O eq 'VMS'; 55 $Is{OS2} = $^O eq 'os2'; 56 $Is{MacOS} = $^O eq 'MacOS'; 57 if( $^O eq 'MSWin32' ) { 58 _is_win95() ? $Is{Win95} = 1 : $Is{Win32} = 1; 59 } 60 $Is{UWIN} = $^O =~ /^uwin(-nt)?$/; 61 $Is{Cygwin} = $^O eq 'cygwin'; 62 $Is{NW5} = $Config{osname} eq 'NetWare'; # intentional 63 $Is{BeOS} = $^O =~ /beos/i; # XXX should this be that loose? 64 $Is{DOS} = $^O eq 'dos'; 65 if( $Is{NW5} ) { 66 $^O = 'NetWare'; 67 delete $Is{Win32}; 68 } 69 $Is{VOS} = $^O eq 'vos'; 70 $Is{QNX} = $^O eq 'qnx'; 71 $Is{AIX} = $^O eq 'aix'; 72 73 $Is{Unix} = !grep { $_ } values %Is; 74 75 map { delete $Is{$_} unless $Is{$_} } keys %Is; 76 _assert( keys %Is == 1 ); 77 my($OS) = keys %Is; 78 79 80 my $class = "ExtUtils::MM_$OS"; 81 eval "require $class" unless $INC{"ExtUtils/MM_$OS.pm"}; 82 die $@ if $@; 83 unshift @ISA, $class; 84 85 86 sub _assert { 87 my $sanity = shift; 88 die sprintf "Assert failed at %s line %d\n", (caller)[1,2] unless $sanity; 89 return; 90 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |