This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix ExtUtils-CBuilder tests for Perl 5.6
[perl5.git] / dist / ExtUtils-CBuilder / lib / ExtUtils / CBuilder.pm
index 103c0c8..897b833 100644 (file)
@@ -1,60 +1,13 @@
 package ExtUtils::CBuilder;
 package ExtUtils::CBuilder;
-
+$ExtUtils::CBuilder::VERSION = '0.280227';
 use File::Spec ();
 use File::Path ();
 use File::Basename ();
 use File::Spec ();
 use File::Path ();
 use File::Basename ();
+use Perl::OSType qw/os_type/;
 
 
-use vars qw($VERSION @ISA);
-$VERSION = '0.280201';
-$VERSION = eval $VERSION;
-
-# Okay, this is the brute-force method of finding out what kind of
-# platform we're on.  I don't know of a systematic way.  These values
-# came from the latest (bleadperl) perlport.pod.
-
-my %OSTYPES = qw(
-                aix       Unix
-                bsdos     Unix
-                dgux      Unix
-                dynixptx  Unix
-                freebsd   Unix
-                linux     Unix
-                hpux      Unix
-                irix      Unix
-                darwin    Unix
-                machten   Unix
-                next      Unix
-                openbsd   Unix
-                netbsd    Unix
-                dec_osf   Unix
-                svr4      Unix
-                svr5      Unix
-                sco_sv    Unix
-                unicos    Unix
-                unicosmk  Unix
-                solaris   Unix
-                sunos     Unix
-                cygwin    Unix
-                os2       Unix
-                gnu       Unix
-                gnukfreebsd Unix
-                haiku     Unix
-                
-                dos       Windows
-                MSWin32   Windows
-
-                os390     EBCDIC
-                os400     EBCDIC
-                posix-bc  EBCDIC
-                vmesa     EBCDIC
-
-                MacOS     MacOS
-                VMS       VMS
-                VOS       VOS
-                riscos    RiscOS
-                amigaos   Amiga
-                mpeix     MPEiX
-               );
+use warnings;
+use strict;
+use vars qw(@ISA);
 
 # We only use this once - don't waste a symbol table entry on it.
 # More importantly, don't make it an inheritable method.
 
 # We only use this once - don't waste a symbol table entry on it.
 # More importantly, don't make it an inheritable method.
@@ -67,21 +20,21 @@ my $load = sub {
 
 {
   my @package = split /::/, __PACKAGE__;
 
 {
   my @package = split /::/, __PACKAGE__;
-  
+
+  my $ostype = os_type();
+
   if (grep {-e File::Spec->catfile($_, @package, 'Platform', $^O) . '.pm'} @INC) {
   if (grep {-e File::Spec->catfile($_, @package, 'Platform', $^O) . '.pm'} @INC) {
-    $load->(__PACKAGE__ . "::Platform::$^O");
-    
-  } elsif (exists $OSTYPES{$^O} and
-          grep {-e File::Spec->catfile($_, @package, 'Platform', $OSTYPES{$^O}) . '.pm'} @INC) {
-    $load->(__PACKAGE__ . "::Platform::$OSTYPES{$^O}");
-    
+      $load->(__PACKAGE__ . "::Platform::$^O");
+
+  } elsif ( $ostype &&
+            grep {-e File::Spec->catfile($_, @package, 'Platform', $ostype) . '.pm'} @INC) {
+      $load->(__PACKAGE__ . "::Platform::$ostype");
+
   } else {
   } else {
-    $load->(__PACKAGE__ . "::Base");
+      $load->(__PACKAGE__ . "::Base");
   }
 }
 
   }
 }
 
-sub os_type { $OSTYPES{$^O} }
-
 1;
 __END__
 
 1;
 __END__
 
@@ -313,10 +266,23 @@ other platform-specific issues.  Ilya Zakharevich has contributed
 fixes for OS/2; John E. Malmberg and Peter Prymmer have done likewise
 for VMS.
 
 fixes for OS/2; John E. Malmberg and Peter Prymmer have done likewise
 for VMS.
 
+=head1 SUPPORT
+
+ExtUtils::CBuilder is maintained as part of the Perl 5 core.  Please
+submit any bug reports via the F<perlbug> tool included with Perl 5.
+Bug reports will be included in the Perl 5 ticket system at
+L<http://rt.perl.org>.
+
+The Perl 5 source code is available at <http://perl5.git.perl.org/perl.git>
+and ExtUtils-CBuilder may be found in the F<dist/ExtUtils-CBuilder> directory
+of the repository.
+
 =head1 AUTHOR
 
 Ken Williams, kwilliams@cpan.org
 
 =head1 AUTHOR
 
 Ken Williams, kwilliams@cpan.org
 
+Additional contributions by The Perl 5 Porters.
+
 =head1 COPYRIGHT
 
 Copyright (c) 2003-2005 Ken Williams.  All rights reserved.
 =head1 COPYRIGHT
 
 Copyright (c) 2003-2005 Ken Williams.  All rights reserved.