| 1 | #!/bin/sh |
| 2 | |
| 3 | # config.bfd |
| 4 | # Convert a canonical host type into a BFD host type. |
| 5 | # Call with canonical name as the argument. |
| 6 | # Echos the result. |
| 7 | |
| 8 | canon="$1" |
| 9 | cpu=`echo $canon | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` |
| 10 | |
| 11 | # WHEN ADDING ENTRIES TO THIS MATRIX: |
| 12 | # Make sure that the left side always has two dashes. Otherwise you |
| 13 | # can get spurious matches. Even for unambiguous cases, do this as a |
| 14 | # convention, else the table becomes a real mess to understand and maintain. |
| 15 | |
| 16 | case "${canon}" in |
| 17 | alpha-*-netware*) bfd_name=alpha-nlm ;; |
| 18 | alpha-*-*) bfd_name=alphaosf ;; |
| 19 | a29k-*-ebmon*) bfd_name=a29k-coff ;; |
| 20 | a29k-*-udi*) bfd_name=a29k-coff ;; |
| 21 | a29k-*-aout*) bfd_name=a29k-aout ;; |
| 22 | a29k-*-coff*) bfd_name=a29k-coff ;; |
| 23 | a29k-*-sym1*) bfd_name=a29k-coff ;; |
| 24 | h8300*-*-*) bfd_name=h8300-coff ;; |
| 25 | h8500-*-*) bfd_name=h8500-coff ;; |
| 26 | sh-*-*) bfd_name=sh-coff ;; |
| 27 | hppa*-*-*elf*) bfd_name=hppa-elf ;; |
| 28 | hppa*-*-bsd*) bfd_name=hppabsd ;; |
| 29 | hppa*-*-hpux*) bfd_name=hppahpux ;; |
| 30 | hppa*-*-hiux*) bfd_name=hppahpux ;; |
| 31 | hppa*-*-osf*) bfd_name=hppaosf ;; |
| 32 | i[34]86-*-sysv4*) bfd_name=i386-elf ;; |
| 33 | i[34]86-*-unixware) bfd_name=i386-elf ;; |
| 34 | i[34]86-*-solaris2*) bfd_name=i386-elf ;; |
| 35 | i[34]86-*-sysv*) bfd_name=i386-coff ;; |
| 36 | i[34]86-*-isc*) bfd_name=i386-coff ;; |
| 37 | i[34]86-*-sco*) bfd_name=i386-coff ;; |
| 38 | i[34]86-sequent-bsd*) bfd_name=i386-dynix ;; |
| 39 | i[34]86-*-bsd*) bfd_name=i386-bsd ;; |
| 40 | i[34]86-*-coff) bfd_name=i386-coff ;; |
| 41 | i[34]86-*-aix*) bfd_name=i386-coff ;; |
| 42 | i[34]86-*-elf) bfd_name=i386-elf ;; |
| 43 | i[34]86-*-netbsd*) bfd_name=i386-netbsd ;; |
| 44 | i[34]86-*-netware*) bfd_name=i386-nlm ;; |
| 45 | i[34]86-*-linux*) bfd_name=i386-linux ;; |
| 46 | i[34]86-*-lynxos*) bfd_name=i386-lynx ;; |
| 47 | i[34]86-*-gnu*) bfd_name=i386-mach3 ;; |
| 48 | i[34]86-*-mach*) bfd_name=i386-mach3 ;; |
| 49 | i[34]86-*-osf1mk*) bfd_name=i386-mach3 ;; |
| 50 | i[34]86-*-os9k) bfd_name=i386-os9k;; |
| 51 | i[34]86-none-*) bfd_name=i386-coff ;; |
| 52 | i960-*-vxworks4*) bfd_name=i960-bout ;; |
| 53 | i960-*-vxworks5.0) bfd_name=i960-bout ;; |
| 54 | i960-*-vxworks5.*) bfd_name=i960-coff ;; |
| 55 | i960-*-vxworks*) bfd_name=i960-bout ;; |
| 56 | i960-*-aout*) bfd_name=i960-bout ;; |
| 57 | i960-*-bout*) bfd_name=i960-bout ;; |
| 58 | i960-*-coff*) bfd_name=i960-coff ;; |
| 59 | i960-*-nindy*) bfd_name=i960-bout ;; |
| 60 | m68*-apollo-*) bfd_name=apollo ;; |
| 61 | m68*-bull-sysv*) bfd_name=u68k-coff ;; |
| 62 | m68*-hp-bsd*) bfd_name=hp300bsd ;; |
| 63 | m68*-*-aout*) bfd_name=m68k-0aout ;; |
| 64 | m68*-*-coff*) bfd_name=m68k-coff ;; |
| 65 | m68*-*-hpux*) bfd_name=hp300hpux ;; |
| 66 | m68*-*-lynxos*) bfd_name=m68k-lynx ;; |
| 67 | m68*-*-os68k*) bfd_name=m68k-aout ;; |
| 68 | m68*-*-sunos*) bfd_name=m68k-aout ;; |
| 69 | m68*-*-sysv4*) bfd_name=m68k-elf ;; |
| 70 | m68*-*-sysv*) bfd_name=m68k-coff ;; |
| 71 | m68*-*-vxworks*) bfd_name=m68k-aout ;; |
| 72 | m68*-ericsson-*) bfd_name=m68k-ose ;; |
| 73 | m68*-netx-*) bfd_name=m68k-aout ;; |
| 74 | |
| 75 | m88*-*-sysv4*) bfd_name=m88k-elf ;; |
| 76 | # DGUX used to use COFF, but now (Jan 94) I believe it uses ELF by default. |
| 77 | m88*-*-dgux*) bfd_name=m88k-elf ;; |
| 78 | m88*-*-*) bfd_name=m88k-coff ;; |
| 79 | |
| 80 | mips*-big-*) bfd_name=bigmips ;; |
| 81 | mips*-dec-bsd*) bfd_name=mipsdecbsd ;; |
| 82 | mips*-dec-*) bfd_name=decstation ;; |
| 83 | mips*el-*-ecoff*) bfd_name=decstation ;; |
| 84 | mips*-*-ecoff*) bfd_name=bigmips ;; |
| 85 | mips*-*-irix5*) bfd_name=mipsbelf ;; |
| 86 | mips*-sgi-*) bfd_name=bigmips ;; |
| 87 | mips*-*-sysv4*) bfd_name=mipsbelf ;; |
| 88 | mips*-*-sysv*) bfd_name=riscos ;; |
| 89 | mips*-*-riscos*) bfd_name=riscos ;; |
| 90 | mips*-*-bsd*) bfd_name=bigmips ;; # Sony News |
| 91 | mips*el-*-elf*) bfd_name=mipslelf ;; |
| 92 | mips*-*-elf*) bfd_name=mipsbelf ;; |
| 93 | # Apparently this is similar enough to 386 mach to use the same target. |
| 94 | ns32*-*-mach*) bfd_name=i386-mach3 ;; |
| 95 | powerpc-*-aix*) bfd_name=rs6000 ;; |
| 96 | powerpc-*-sysv4*) bfd_name=ppc-elf ;; |
| 97 | powerpc-*-netware*) bfd_name=ppc-nlm ;; |
| 98 | rs6000-*-*) bfd_name=rs6000 ;; |
| 99 | sparc-*-lynxos*) bfd_name=sparc-lynx ;; |
| 100 | sparc-*-solaris2*) bfd_name=sparc-elf ;; |
| 101 | sparc-*-sysv4*) bfd_name=sparc-elf ;; |
| 102 | sparc64-*-aout*) bfd_name=sparc-aout ;; |
| 103 | sparc64-*-elf*) bfd_name=sparc64-elf ;; |
| 104 | sparc-*-netware*) bfd_name=sparc-nlm ;; |
| 105 | sparc*-*-coff*) bfd_name=sparc-coff ;; |
| 106 | sparc*-*-*) bfd_name=sparc-aout ;; |
| 107 | tahoe-*-*) bfd_name=tahoe ;; |
| 108 | vax-*-vms*) bfd_name=vax-vms ;; |
| 109 | vax-*-*) bfd_name=vax ;; |
| 110 | we32k-*-*) bfd_name=we32k ;; |
| 111 | z8k*-*-*) bfd_name=z8k-coff ;; |
| 112 | |
| 113 | *-*-aout*) bfd_name=${cpu}-aout ;; |
| 114 | *-*-bsd*) bfd_name=${cpu}-aout ;; |
| 115 | *-*-netware*) bfd_name=${cpu}-nlm ;; |
| 116 | *-*-sysv4*) bfd_name=${cpu}-elf ;; |
| 117 | *-*-solaris2*) bfd_name=${cpu}-elf ;; |
| 118 | *-*-vsta*) bfd_name=${cpu}-aout ;; |
| 119 | *-*-go32*) bfd_name=${cpu}-coff ;; |
| 120 | *-*-sysv*) bfd_name=${cpu}-coff ;; |
| 121 | |
| 122 | *-*-aout64*) bfd_name=${cpu}-aout64 ;; |
| 123 | *-*-elf64*) bfd_name=${cpu}-elf64 ;; |
| 124 | |
| 125 | *-adobe-*) bfd_name=adobe ;; |
| 126 | *-sony-*) bfd_name=news ;; |
| 127 | *-intel-*) bfd_name=${cpu}-coff ;; |
| 128 | *-stratus-*) bfd_name=${cpu}-elf ;; |
| 129 | *-cbm-*) bfd_name=${cpu}-elf ;; |
| 130 | *-ncr-*) bfd_name=${cpu}-elf ;; |
| 131 | *-tandem-*) bfd_name=st2000 ;; |
| 132 | |
| 133 | # Allow targets that config.sub doesn't recognize, like "all". |
| 134 | *) bfd_name=$canon ;; |
| 135 | esac |
| 136 | |
| 137 | echo $bfd_name |