diff options
author | James Le Cuirot <chewi@gentoo.org> | 2016-07-31 22:59:57 +0100 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2016-08-02 23:34:20 +0100 |
commit | bbd42d18598697ade22657741cb7bd96c4de40e4 (patch) | |
tree | f4ea5d8c1237f9890e1e55c1d5ec24381be0be58 | |
parent | 1e16f7f70a224731b1b7bc53bb47b8ab1da211e9 (diff) | |
download | gentoo-bbd42d18598697ade22657741cb7bd96c4de40e4.tar.gz gentoo-bbd42d18598697ade22657741cb7bd96c4de40e4.tar.xz |
java-vm-2.eclass: Make get_system_arch ABI-aware
The old version just sucked. Closes bug #159439.
-rw-r--r-- | eclass/java-vm-2.eclass | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass index c544191ffcf..52f040e5a0e 100644 --- a/eclass/java-vm-2.eclass +++ b/eclass/java-vm-2.eclass @@ -132,14 +132,29 @@ java_set_default_vm_() { # @FUNCTION: get_system_arch # @DESCRIPTION: # Get Java specific arch name. +# +# NOTE the mips and sparc values are best guesses. Oracle uses sparcv9 +# but does OpenJDK use sparc64? We don't support OpenJDK on sparc or any +# JVM on mips though so it doesn't matter much. get_system_arch() { - local sarch - sarch=$(echo ${ARCH} | sed -e s/[i]*.86/i386/ -e s/x86_64/amd64/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/) - if [ -z "${sarch}" ]; then - sarch=$(uname -m | sed -e s/[i]*.86/i386/ -e s/x86_64/amd64/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/) - fi - echo ${sarch} + local abi=${1-${ABI}} + + case $(get_abi_CHOST ${abi}) in + mips*l*) echo mipsel ;; + mips*) echo mips ;; + ppc64le*) echo ppc64le ;; + *) + case ${abi} in + *_fbsd) get_system_arch ${abi%_fbsd} ;; + arm64) echo aarch64 ;; + hppa) echo parisc ;; + sparc32) echo sparc ;; + sparc64) echo sparcv9 ;; + x86*) echo i386 ;; + *) echo ${abi} ;; + esac ;; + esac } |