Setup new arch in java loadlibrary
This commit is contained in:
parent
086f16a916
commit
e0db7e7f9c
@ -22,6 +22,9 @@ package it.ernytech.tdlib.utils;
|
||||
*/
|
||||
public enum Arch {
|
||||
amd64,
|
||||
i686,
|
||||
i386,
|
||||
armhf,
|
||||
aarch64,
|
||||
ppc64el
|
||||
unknown
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ package it.ernytech.tdlib.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.*;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
@ -99,10 +100,32 @@ public class LoadLibrary {
|
||||
return Arch.amd64;
|
||||
}
|
||||
|
||||
case "x86" : {
|
||||
return Arch.i686;
|
||||
case "x86_64" : {
|
||||
return Arch.amd64;
|
||||
}
|
||||
|
||||
case "i386" : {
|
||||
return Arch.i386;
|
||||
}
|
||||
|
||||
case "x86" : {
|
||||
return Arch.i386;
|
||||
}
|
||||
|
||||
case "arm" : {
|
||||
return Arch.armhf;
|
||||
}
|
||||
|
||||
case "aarch64" : {
|
||||
return Arch.aarch64;
|
||||
}
|
||||
|
||||
case "ppc64" : {
|
||||
if (!ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { // Java always returns ppc64 for all 64-bit powerpc but
|
||||
return Arch.ppc64el; // powerpc64le (our target) is very different, it uses
|
||||
} // little-endian unlike powerpc64, so we just check
|
||||
} // this condition to accurately identify the architecture
|
||||
|
||||
default : {
|
||||
return Arch.unknown;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user