summaryrefslogtreecommitdiffstats
path: root/tools/specific_arch
blob: 57da2d259459fff3c14167be0b5a82e349d77207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

%compat_arch = (
		'noarch'  => '',
		'i386'    => 'noarch',
		'i486'    => 'i386',
		'i586'    => 'i486',
		'i686'    => 'i586',
		'i786'    => 'i686',
		'k6'      => 'i586',
		'k7'      => 'k6',
		'k8'      => 'k7',
		'alpha'   => 'noarch',
		'sparc'   => 'noarch',
		'sparc32' => 'sparc',
		'sparc64' => 'sparc32',
		'ia64'	  => 'noarch',
	       );

$arch = `uname -m` || 'unknownarch';
$arch =~ s/\s//g;

print join ' ', map {
		      my $arch = $arch;
		      $arch = $compat_arch{$arch} while $arch && !-e "$_.$arch";
		      -e "$_.$arch" ? "$_.$arch" : $_;
		    } @ARGV;
print "\n";