|
|
@ -4,6 +4,10 @@ public class Environment { |
|
|
|
private static String OS = System.getProperty("os.name").toLowerCase(); |
|
|
|
private static String OS = System.getProperty("os.name").toLowerCase(); |
|
|
|
private static String ARCH = System.getProperty("os.arch").toLowerCase(); |
|
|
|
private static String ARCH = System.getProperty("os.arch").toLowerCase(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean isPowerPC() { |
|
|
|
|
|
|
|
return ARCH.contains("ppc"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean isWindows() { |
|
|
|
public static boolean isWindows() { |
|
|
|
return (OS.contains("win")); |
|
|
|
return (OS.contains("win")); |
|
|
|
} |
|
|
|
} |
|
|
@ -36,16 +40,22 @@ public class Environment { |
|
|
|
|
|
|
|
|
|
|
|
public static String getJniLibraryName(final String name) { |
|
|
|
public static String getJniLibraryName(final String name) { |
|
|
|
if (isUnix()) { |
|
|
|
if (isUnix()) { |
|
|
|
final String arch = (is64Bit()) ? "64" : "32"; |
|
|
|
final String arch = is64Bit() ? "64" : "32"; |
|
|
|
return String.format("%sjni-linux%s", name, arch); |
|
|
|
if(isPowerPC()) { |
|
|
|
|
|
|
|
return String.format("%sjni-linux-ppc%s", name, arch); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return String.format("%sjni-linux%s", name, arch); |
|
|
|
|
|
|
|
} |
|
|
|
} else if (isMac()) { |
|
|
|
} else if (isMac()) { |
|
|
|
return String.format("%sjni-osx", name); |
|
|
|
return String.format("%sjni-osx", name); |
|
|
|
} else if (isSolaris()) { |
|
|
|
} else if (isSolaris()) { |
|
|
|
return String.format("%sjni-solaris%d", name, is64Bit() ? 64 : 32); |
|
|
|
final String arch = is64Bit() ? "64" : "32"; |
|
|
|
|
|
|
|
return String.format("%sjni-solaris%s", name, arch); |
|
|
|
} else if (isWindows() && is64Bit()) { |
|
|
|
} else if (isWindows() && is64Bit()) { |
|
|
|
return String.format("%sjni-win64", name); |
|
|
|
return String.format("%sjni-win64", name); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new UnsupportedOperationException(); |
|
|
|
|
|
|
|
|
|
|
|
throw new UnsupportedOperationException(String.format("Cannot determine JNI library name for ARCH='%s' OS='%s' name='%s'", ARCH, OS, name)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static String getJniLibraryFileName(final String name) { |
|
|
|
public static String getJniLibraryFileName(final String name) { |
|
|
|