private static String getMultiArchPath() { String cpu = Platform.ARCH; String kernel = Platform.iskFreeBSD() ? "-kfreebsd" : (Platform.isGNU() ? "" : "-linux"); String libc = "-gnu"; if (Platform.isIntel()) { cpu = (Platform.is64Bit() ? "x86_64" : "i386"); } else if (Platform.isPPC()) { cpu = (Platform.is64Bit() ? "powerpc64" : "powerpc"); } else if (Platform.isARM()) { cpu = "arm"; libc = "-gnueabi"; } else if (Platform.ARCH.equals("mips64el")) { libc = "-gnuabi64"; } return cpu + kernel + libc; }
/** * Uses the OS architecture to reproduce the following logic from the epoll header: * <code><pre> * #ifdef __x86_64__ * #define EPOLL_PACKED __attribute__((packed)) * #else * #define EPOLL_PACKED * #endif * </pre></code> * * On x86-64 (amd64) platforms, {@code ALIGN_NONE} is used (to emulate {@code __attribute__((packed))}), * and on all other platforms {@code ALIGN_GNUC} is used. */ private static int detectAlignment() { return Platform.isIntel() && Platform.is64Bit() ? ALIGN_NONE : ALIGN_GNUC; }
private static String getMultiArchPath() { String cpu = Platform.ARCH; String kernel = Platform.iskFreeBSD() ? "-kfreebsd" : (Platform.isGNU() ? "" : "-linux"); String libc = "-gnu"; if (Platform.isIntel()) { cpu = (Platform.is64Bit() ? "x86_64" : "i386"); } else if (Platform.isPPC()) { cpu = (Platform.is64Bit() ? "powerpc64" : "powerpc"); } else if (Platform.isARM()) { cpu = "arm"; libc = "-gnueabi"; } else if (Platform.ARCH.equals("mips64el")) { libc = "-gnuabi64"; } return cpu + kernel + libc; }
if (com.sun.jna.Platform.isIntel()) { platform = com.sun.jna.Platform.is64Bit() ? PlatformEnum.LINUX_X86_64 : PlatformEnum.LINUX_I686;