summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2016-07-31 22:59:57 +0100
committerJames Le Cuirot <chewi@gentoo.org>2016-08-02 23:34:20 +0100
commitbbd42d18598697ade22657741cb7bd96c4de40e4 (patch)
treef4ea5d8c1237f9890e1e55c1d5ec24381be0be58 /eclass
parentdev-perl/Test-CleanNamespaces: Weaken dependency on dev-perl/Test-Tester (diff)
downloadgentoo-bbd42d18598697ade22657741cb7bd96c4de40e4.tar.gz
gentoo-bbd42d18598697ade22657741cb7bd96c4de40e4.tar.bz2
gentoo-bbd42d18598697ade22657741cb7bd96c4de40e4.zip
java-vm-2.eclass: Make get_system_arch ABI-aware
The old version just sucked. Closes bug #159439.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/java-vm-2.eclass27
1 files changed, 21 insertions, 6 deletions
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass
index c544191ffcf5..52f040e5a0ee 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
}