- targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;;
-powerpc-*-nto*) targ_emul=elf32ppcnto ;;
-powerpcle-*-nto*) targ_emul=elf32lppcnto ;;
-powerpc-*-rtems*) targ_emul=elf32ppc ;;
-powerpc-*-macos*) targ_emul=ppcmacos ;;
-powerpc-*-netware*) targ_emul=ppcnw ;;
-powerpcle-*-pe) targ_emul=ppcpe ;;
-powerpcle-*-winnt*) targ_emul=ppcpe ;;
-powerpcle-*-cygwin*) targ_emul=ppcpe ;;
-powerpc-*-aix[5-9]*) targ_emul=aix5ppc ;;
-powerpc-*-aix*) targ_emul=aixppc ;;
-powerpc-*-beos*) targ_emul=aixppc ;;
-powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
-powerpc-*-lynxos*) targ_emul=ppclynx ;;
-rs6000-*-aix[5-9]*) targ_emul=aix5rs6 ;;
+ targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
+ ;;
+powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
+ | powerpc*-*-linux* | powerpc*-*-netbsd* | powerpc*-*-openbsd* \
+ | powerpc*-*-rtems* \
+ | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
+ case "${targ}" in
+ powerpc64*)
+ targ_emul=elf64ppc
+ targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
+ targ_extra_libpath="elf32ppc elf32ppclinux" ;;
+ *linux*)
+ targ_emul=elf32ppclinux
+ targ_extra_emuls="elf32ppc elf32ppcsim"
+ targ_extra_libpath=elf32ppc
+ targ64_extra_emuls=elf64ppc
+ targ64_extra_libpath=elf64ppc ;;
+ *)
+ targ_emul=elf32ppc
+ targ_extra_emuls="elf32ppclinux elf32ppcsim"
+ targ_extra_libpath=elf32ppclinux
+ targ64_extra_emuls=elf64ppc
+ targ64_extra_libpath=elf64ppc ;;
+ esac
+ td=tdir_elf32ppc
+ td64=tdir_elf64ppc
+ s=s/ppc/lppc/g
+ case "${targ}" in
+ powerpcle-* | powerpc64le-*)
+ for z in td td64 targ_emul targ_extra_emuls \
+ targ_extra_libpath targ64_extra_emuls \
+ targ64_extra_libpath
+ do
+ eval ${z}=\"\`echo \$${z} \| sed -e $s\`\"
+ done
+ s=s/lppc/ppc/g ;;
+ esac
+ # Why oh why did we set tooldir based on target_alias
+ # rather than on target?
+ eval tdir_${targ_emul}="${targ_alias}"
+ cpu=`echo "${targ_alias}" | sed -e 's/-.*//'`
+ rest=`echo "${targ_alias}" | sed -e 's/^[^-]*//'`
+ le=le
+ case "${cpu}" in
+ *little) le=little
+ esac
+ ta32=`echo "${cpu}" | sed -e s/64//`"${rest}"
+ ta64=`echo "${cpu}" | sed -e 's/64//;s/$/64/;s/'${le}'64$/64'${le}'/;s/be64$/64be/'`"${rest}"
+ eval test -n \"\$${td}\" || eval ${td}="${ta32}"
+ eval test -n \"\$${td}linux\" || eval ${td}linux="${ta32}"
+ eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}"
+ eval test -n \"\$${td64}\" || eval ${td64}="${ta64}"
+ # Now provide the other endian
+ for z in targ_extra_emuls targ_extra_libpath
+ do
+ eval ${z}=\"\$${z} \`echo ${targ_emul} \$${z} \| sed -e $s\`\"
+ done
+ for z in targ64_extra_emuls targ64_extra_libpath
+ do
+ eval ${z}=\"\$${z} \`echo \$${z} \| sed -e $s\`\"
+ done
+ td=`echo "${td}" | sed -e $s`
+ td64=`echo "${td64}" | sed -e $s`
+ case "${targ}" in
+ powerpcle-* | powerpc64le-*)
+ cpu=`echo "${cpu}" | sed -e s/${le}\$//` ;;
+ *)
+ cpu=`echo "${cpu}" | sed -e s/be\$//`${le} ;;
+ esac
+ ta32=`echo "${cpu}" | sed -e s/64//`"${rest}"
+ ta64=`echo "${cpu}" | sed -e 's/64//;s/$/64/;s/'${le}'64$/64'${le}/`"${rest}"
+ eval test -n \"\$${td}\" || eval ${td}="${ta32}"
+ eval test -n \"\$${td}linux\" || eval ${td}linux="${ta32}"
+ eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}"
+ eval test -n \"\$${td64}\" || eval ${td64}="${ta64}"
+ ;;
+powerpc-*-nto*) targ_emul=elf32ppcnto
+ ;;
+powerpcle-*-nto*) targ_emul=elf32lppcnto
+ ;;
+powerpc-*-macos*) targ_emul=ppcmacos
+ targ_extra_ofiles=
+ ;;
+powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
+ targ_emul=ppcpe
+ targ_extra_ofiles="deffilep.o pe-dll.o"
+ ;;
+powerpc-*-aix[5-9]*) targ_emul=aix5ppc
+ targ_extra_ofiles=
+ ;;
+powerpc-*-aix*) targ_emul=aixppc
+ targ_extra_ofiles=
+ ;;
+powerpc-*-beos*) targ_emul=aixppc
+ targ_extra_ofiles=
+ ;;
+powerpc-*-windiss*) targ_emul=elf32ppcwindiss
+ ;;
+powerpc-*-lynxos*) targ_emul=ppclynx
+ ;;
+pru*-*-*) targ_emul=pruelf
+ ;;
+riscv32*-*-linux*) targ_emul=elf32lriscv
+ targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64"
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
+riscv-*-* | riscv32*-*-*)
+ targ_emul=elf32lriscv
+ targ_extra_emuls="elf64lriscv"
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
+riscv64*-*-linux*) targ_emul=elf64lriscv
+ targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32"
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
+riscv64*-*-*) targ_emul=elf64lriscv
+ targ_extra_emuls="elf32lriscv"
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
+rs6000-*-aix[5-9]*) targ_emul=aix5rs6
+ targ_extra_ofiles=
+ ;;