Fix elf-default-arch detection to work on secondary archs (RHBZ#634951)
[febootstrap.git] / helper / elf-default-arch
1 #!/bin/sh -
2 # Copyright (C) 2010 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 # Calculate the default ELF object architecture for this format.
19 # There doesn't seem to be an easy way to derive this from binutils,
20 # so instead we hard code it.
21
22 case $(uname -m) in
23     i[3456]86) echo "elf32-i386 i386" ;;
24     x86_64) echo "elf64-x86-64 i386" ;;
25     s390) echo "elf32-s390 s390:31-bit" ;;
26     s390x) echo "elf64-s390 s390:31-bit" ;;
27     *)
28         echo "This architecture is not recognized.  Please update helper/elf-default-arch."
29 esac