1 # Copyright (C) 2001-2007, The Perl Foundation.
6 config/auto/arch - Determine CPU architecture and operating system
10 Determines the CPU architecture, the operating system.
12 This code was formerly part of configuration step class auto::jit.
22 use base
qw(Parrot::Configure::Step);
27 $data{description
} = q{Determining CPU architecture and OS};
33 my ( $self, $conf ) = @_;
35 if ( $conf->options->get('miniparrot') ) {
36 $self->set_result('skipped');
40 my $verbose = $conf->options->get('verbose');
41 $verbose and print "\n";
43 my $archname = $conf->data->get('archname');
44 my ( $cpuarch, $osname ) = split( /-/, $archname );
47 print "determining operating system and cpu architecture\n";
48 print "archname: <$archname>\n";
51 if ( !defined $osname ) {
52 ( $osname, $cpuarch ) = ( $cpuarch, q{} );
55 # This was added to convert 9000/800 to 9000_800 on HP-UX
58 # On OS X if you are using the Perl that shipped with the system
59 # the above split fails because archname is "darwin-thread-multi-2level".
60 if ( $cpuarch =~ /darwin/ ) {
62 if ( $conf->data->get('byteorder') == 1234 ) {
70 # cpuarch and osname are reversed in archname on windows
71 elsif ( $cpuarch =~ /MSWin32/ ) {
72 $cpuarch = ( $osname =~ /x64/ ) ?
'amd64' : 'i386';
75 elsif ( $osname =~ /cygwin/i || $cpuarch =~ /cygwin/i ) {
80 if ( $archname =~ m/powerpc/ ) {
84 $cpuarch =~ s/armv[34]l?/arm/i;
85 $cpuarch =~ s/i[456]86/i386/i;
86 $cpuarch =~ s/x86_64/amd64/i;
88 print "osname: $osname\ncpuarch: $cpuarch\n" if $verbose;
102 # cperl-indent-level: 4
105 # vim: expandtab shiftwidth=4: