1*0Sstevel@tonic-gatepackage ExtUtils::MM; 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gateuse strict; 4*0Sstevel@tonic-gateuse Config; 5*0Sstevel@tonic-gateuse vars qw(@ISA $VERSION); 6*0Sstevel@tonic-gate$VERSION = 0.04; 7*0Sstevel@tonic-gate 8*0Sstevel@tonic-gaterequire ExtUtils::Liblist; 9*0Sstevel@tonic-gate 10*0Sstevel@tonic-gate# Original version. 11*0Sstevel@tonic-gate# require ExtUtils::MakeMaker; 12*0Sstevel@tonic-gate# Solaris/ON build version. 13*0Sstevel@tonic-gateuse ExtUtils::MakeMaker qw($Verbose); 14*0Sstevel@tonic-gate 15*0Sstevel@tonic-gate@ISA = qw(ExtUtils::Liblist ExtUtils::MakeMaker); 16*0Sstevel@tonic-gate 17*0Sstevel@tonic-gate=head1 NAME 18*0Sstevel@tonic-gate 19*0Sstevel@tonic-gateExtUtils::MM - OS adjusted ExtUtils::MakeMaker subclass 20*0Sstevel@tonic-gate 21*0Sstevel@tonic-gate=head1 SYNOPSIS 22*0Sstevel@tonic-gate 23*0Sstevel@tonic-gate require ExtUtils::MM; 24*0Sstevel@tonic-gate my $mm = MM->new(...); 25*0Sstevel@tonic-gate 26*0Sstevel@tonic-gate=head1 DESCRIPTION 27*0Sstevel@tonic-gate 28*0Sstevel@tonic-gateB<FOR INTERNAL USE ONLY> 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gateExtUtils::MM is a subclass of ExtUtils::MakeMaker which automatically 31*0Sstevel@tonic-gatechooses the appropriate OS specific subclass for you 32*0Sstevel@tonic-gate(ie. ExtUils::MM_Unix, etc...). 33*0Sstevel@tonic-gate 34*0Sstevel@tonic-gateIt also provides a convenient alias via the MM class (I didn't want 35*0Sstevel@tonic-gateMakeMaker modules outside of ExtUtils/). 36*0Sstevel@tonic-gate 37*0Sstevel@tonic-gateThis class might turn out to be a temporary solution, but MM won't go 38*0Sstevel@tonic-gateaway. 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate=cut 41*0Sstevel@tonic-gate 42*0Sstevel@tonic-gate{ 43*0Sstevel@tonic-gate # Convenient alias. 44*0Sstevel@tonic-gate package MM; 45*0Sstevel@tonic-gate use vars qw(@ISA); 46*0Sstevel@tonic-gate @ISA = qw(ExtUtils::MM); 47*0Sstevel@tonic-gate sub DESTROY {} 48*0Sstevel@tonic-gate} 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gatemy %Is = (); 51*0Sstevel@tonic-gate$Is{VMS} = 1 if $^O eq 'VMS'; 52*0Sstevel@tonic-gate$Is{OS2} = 1 if $^O eq 'os2'; 53*0Sstevel@tonic-gate$Is{MacOS} = 1 if $^O eq 'MacOS'; 54*0Sstevel@tonic-gateif( $^O eq 'MSWin32' ) { 55*0Sstevel@tonic-gate Win32::IsWin95() ? $Is{Win95} = 1 : $Is{Win32} = 1; 56*0Sstevel@tonic-gate} 57*0Sstevel@tonic-gate$Is{UWIN} = 1 if $^O eq 'uwin'; 58*0Sstevel@tonic-gate$Is{Cygwin} = 1 if $^O eq 'cygwin'; 59*0Sstevel@tonic-gate$Is{NW5} = 1 if $Config{osname} eq 'NetWare'; # intentional 60*0Sstevel@tonic-gate$Is{BeOS} = 1 if $^O =~ /beos/i; # XXX should this be that loose? 61*0Sstevel@tonic-gate$Is{DOS} = 1 if $^O eq 'dos'; 62*0Sstevel@tonic-gate 63*0Sstevel@tonic-gate# Original version. 64*0Sstevel@tonic-gate# $Is{Unix} = 1 if !keys %Is; 65*0Sstevel@tonic-gate 66*0Sstevel@tonic-gate# Start of special test for Solaris/ON builds. 67*0Sstevel@tonic-gateif (! keys(%Is)) { 68*0Sstevel@tonic-gate if ($^O eq 'solaris' && grep(/^ENV(?:CPPFLAGS|LDLIBS)\d+$/, keys(%ENV))) { 69*0Sstevel@tonic-gate $Is{Solaris_ON} = 1; 70*0Sstevel@tonic-gate } else { 71*0Sstevel@tonic-gate $Is{Unix} = 1; 72*0Sstevel@tonic-gate } 73*0Sstevel@tonic-gate} 74*0Sstevel@tonic-gate# End of special test for Solaris/ON builds 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gateif( $Is{NW5} ) { 77*0Sstevel@tonic-gate $^O = 'NetWare'; 78*0Sstevel@tonic-gate delete $Is{Win32}; 79*0Sstevel@tonic-gate} 80*0Sstevel@tonic-gate 81*0Sstevel@tonic-gate_assert( keys %Is == 1 ); 82*0Sstevel@tonic-gatemy($OS) = keys %Is; 83*0Sstevel@tonic-gate 84*0Sstevel@tonic-gate 85*0Sstevel@tonic-gatemy $class = "ExtUtils::MM_$OS"; 86*0Sstevel@tonic-gateeval "require $class" unless $INC{"ExtUtils/MM_$OS.pm"}; 87*0Sstevel@tonic-gatedie $@ if $@; 88*0Sstevel@tonic-gateunshift @ISA, $class; 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate 91*0Sstevel@tonic-gatesub _assert { 92*0Sstevel@tonic-gate my $sanity = shift; 93*0Sstevel@tonic-gate die sprintf "Assert failed at %s line %d\n", (caller)[1,2] unless $sanity; 94*0Sstevel@tonic-gate return; 95*0Sstevel@tonic-gate} 96