1 |
commit: bbd42d18598697ade22657741cb7bd96c4de40e4 |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 31 21:59:57 2016 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 2 22:34:20 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbd42d18 |
7 |
|
8 |
java-vm-2.eclass: Make get_system_arch ABI-aware |
9 |
|
10 |
The old version just sucked. Closes bug #159439. |
11 |
|
12 |
eclass/java-vm-2.eclass | 27 +++++++++++++++++++++------ |
13 |
1 file changed, 21 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass |
16 |
index c544191..52f040e 100644 |
17 |
--- a/eclass/java-vm-2.eclass |
18 |
+++ b/eclass/java-vm-2.eclass |
19 |
@@ -132,14 +132,29 @@ java_set_default_vm_() { |
20 |
# @FUNCTION: get_system_arch |
21 |
# @DESCRIPTION: |
22 |
# Get Java specific arch name. |
23 |
+# |
24 |
+# NOTE the mips and sparc values are best guesses. Oracle uses sparcv9 |
25 |
+# but does OpenJDK use sparc64? We don't support OpenJDK on sparc or any |
26 |
+# JVM on mips though so it doesn't matter much. |
27 |
|
28 |
get_system_arch() { |
29 |
- local sarch |
30 |
- 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/) |
31 |
- if [ -z "${sarch}" ]; then |
32 |
- 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/) |
33 |
- fi |
34 |
- echo ${sarch} |
35 |
+ local abi=${1-${ABI}} |
36 |
+ |
37 |
+ case $(get_abi_CHOST ${abi}) in |
38 |
+ mips*l*) echo mipsel ;; |
39 |
+ mips*) echo mips ;; |
40 |
+ ppc64le*) echo ppc64le ;; |
41 |
+ *) |
42 |
+ case ${abi} in |
43 |
+ *_fbsd) get_system_arch ${abi%_fbsd} ;; |
44 |
+ arm64) echo aarch64 ;; |
45 |
+ hppa) echo parisc ;; |
46 |
+ sparc32) echo sparc ;; |
47 |
+ sparc64) echo sparcv9 ;; |
48 |
+ x86*) echo i386 ;; |
49 |
+ *) echo ${abi} ;; |
50 |
+ esac ;; |
51 |
+ esac |
52 |
} |