sigar/bindings/perl/lib/Sigar/ArchName.pm

42 lines
755 B
Perl
Raw Normal View History

2004-06-22 06:37:04 +08:00
package Sigar::ArchName;
use strict;
use Config;
sub get_name {
my $os = lc $^O;
my $vers = $Config{osvers};
my $arch = $Config{archname};
if ($os =~ /win32/) {
return 'x86-winnt';
}
elsif ($os =~ /linux/) {
return 'x86-linux';
}
elsif ($os =~ /hpux/) {
if ($vers =~ /11\./) {
2006-07-05 03:49:18 +08:00
return 'pa-hpux-11';
2004-06-22 06:37:04 +08:00
}
}
elsif ($os =~ /aix/) {
2006-07-05 03:49:18 +08:00
return 'ppc-aix-5';
2004-06-22 06:37:04 +08:00
}
elsif ($os =~ /solaris/) {
if ($arch =~ /sun4/) {
2006-07-05 03:49:18 +08:00
return 'sparc-solaris';
2004-06-22 06:37:04 +08:00
}
elsif ($arch =~ /.86/) {
2006-07-05 03:49:18 +08:00
return 'x86-solaris';
2004-06-22 06:37:04 +08:00
}
}
elsif ($os =~ /darwin/) {
2006-07-05 03:49:18 +08:00
return 'universal-macosx';
2004-06-22 06:37:04 +08:00
}
die "Unsupported platform";
}
1;
__END__