summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2011-01-28 14:15:56 -0500
committerDavid Golden <dagolden@cpan.org>2011-01-28 14:15:56 -0500
commitf84e912d7ca932a52e18c2af3f2b83670aeaf61d (patch)
treef51b766aba79b91f71d18c133e262c27d4529386
parentf50f542d168fef110fd1cf29327341df0aca786f (diff)
downloadperl-f84e912d7ca932a52e18c2af3f2b83670aeaf61d.tar.gz
Switch ExtUtils::CBuilder to use Perl::OSType
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm58
1 files changed, 5 insertions, 53 deletions
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
index eeda40eddb..ba0f768158 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
@@ -3,59 +3,12 @@ package ExtUtils::CBuilder;
use File::Spec ();
use File::Path ();
use File::Basename ();
+use Perl::OSType qw/os_type/;
use vars qw($VERSION @ISA);
$VERSION = '0.280202';
$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
- );
-
# We only use this once - don't waste a symbol table entry on it.
# More importantly, don't make it an inheritable method.
my $load = sub {
@@ -68,20 +21,19 @@ my $load = sub {
{
my @package = split /::/, __PACKAGE__;
+ my $os_type = os_type();
+
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}");
+ } elsif ( $ostype && grep {-e File::Spec->catfile($_, @package, 'Platform', $ostype) . '.pm'} @INC) {
+ $load->(__PACKAGE__ . "::Platform::$ostype");
} else {
$load->(__PACKAGE__ . "::Base");
}
}
-sub os_type { $OSTYPES{$^O} }
-
1;
__END__