diff --git a/app/src/processing/app/Library.java b/app/src/processing/app/Library.java index 757449a64..12c15b146 100644 --- a/app/src/processing/app/Library.java +++ b/app/src/processing/app/Library.java @@ -71,6 +71,7 @@ public class Library extends LocalContribution { if (name.equals("linux32")) return false; if (name.equals("linux64")) return false; if (name.equals("linux-armv6hf")) return false; + if (name.equals("linux-arm64")) return false; if (name.equals("android")) return false; } return true; @@ -173,6 +174,12 @@ public class Library extends LocalContribution { nativeLibraryFolder = hostLibrary; } } + if (hostPlatform.equals("linux") && System.getProperty("os.arch").equals("aarch64")) { + hostLibrary = new File(libraryFolder, "linux-arm64"); + if (hostLibrary.exists()) { + nativeLibraryFolder = hostLibrary; + } + } // save that folder for later use nativeLibraryPath = nativeLibraryFolder.getAbsolutePath(); @@ -182,7 +189,8 @@ public class Library extends LocalContribution { String platformName = platformNames[i]; String platformName32 = platformName + "32"; String platformName64 = platformName + "64"; - String platformNameArmv6hh = platformName + "-armv6hf"; + String platformNameArmv6hf = platformName + "-armv6hf"; + String platformNameArm64 = platformName + "-arm64"; // First check for things like 'application.macosx=' or 'application.windows32' in the export.txt file. // These will override anything in the platform-specific subfolders. @@ -194,6 +202,8 @@ public class Library extends LocalContribution { String[] platformList64 = platform64 == null ? null : PApplet.splitTokens(platform64, ", "); String platformArmv6hf = exportTable.get("application." + platformName + "-armv6hf"); String[] platformListArmv6hf = platformArmv6hf == null ? null : PApplet.splitTokens(platformArmv6hf, ", "); + String platformArm64 = exportTable.get("application." + platformName + "-arm64"); + String[] platformListArm64 = platformArm64 == null ? null : PApplet.splitTokens(platformArm64, ", "); // If nothing specified in the export.txt entries, look for the platform-specific folders. if (platformAll == null) { @@ -206,16 +216,19 @@ public class Library extends LocalContribution { platformList64 = listPlatformEntries(libraryFolder, platformName64, baseList); } if (platformListArmv6hf == null) { - platformListArmv6hf = listPlatformEntries(libraryFolder, platformNameArmv6hh, baseList); + platformListArmv6hf = listPlatformEntries(libraryFolder, platformNameArmv6hf, baseList); + } + if (platformListArm64 == null) { + platformListArm64 = listPlatformEntries(libraryFolder, platformNameArm64, baseList); } - if (platformList32 != null || platformList64 != null || platformListArmv6hf != null) { + if (platformList32 != null || platformList64 != null || platformListArmv6hf != null || platformListArm64 != null) { multipleArch[i] = true; } // if there aren't any relevant imports specified or in their own folders, // then use the baseList (root of the library folder) as the default. - if (platformList == null && platformList32 == null && platformList64 == null && platformListArmv6hf == null) { + if (platformList == null && platformList32 == null && platformList64 == null && platformListArmv6hf == null && platformListArm64 == null) { exportList.put(platformName, baseList); } else { @@ -231,7 +244,10 @@ public class Library extends LocalContribution { exportList.put(platformName64, platformList64); } if (platformListArmv6hf != null) { - exportList.put(platformNameArmv6hh, platformListArmv6hf); + exportList.put(platformNameArmv6hf, platformListArmv6hf); + } + if (platformListArm64 != null) { + exportList.put(platformNameArm64, platformListArm64); } } } @@ -412,6 +428,9 @@ public class Library extends LocalContribution { } else if (variant.equals("armv6hf")) { String[] pieces = exportList.get(platformName + "-armv6hf"); if (pieces != null) return pieces; + } else if (variant.equals("arm64")) { + String[] pieces = exportList.get(platformName + "-arm64"); + if (pieces != null) return pieces; } return exportList.get(platformName); } diff --git a/app/src/processing/app/Platform.java b/app/src/processing/app/Platform.java index 93b62d4c8..89315b92a 100644 --- a/app/src/processing/app/Platform.java +++ b/app/src/processing/app/Platform.java @@ -195,6 +195,7 @@ public class Platform { * Return the value of the os.arch property */ static public String getNativeArch() { + // This will return "arm" for 32-bit ARM, "aarch64" for 64-bit ARM (both on Linux) return System.getProperty("os.arch"); } @@ -211,8 +212,12 @@ public class Platform { static public String getVariant(int platform, String arch, int bits) { if (platform == PConstants.LINUX && bits == 32 && "arm".equals(Platform.getNativeArch())) { - return "armv6hf"; // assume armv6hf for now + return "armv6hf"; // assume armv6hf + } else if (platform == PConstants.LINUX && + bits == 64 && "aarch64".equals(Platform.getNativeArch())) { + return "arm64"; } + return Integer.toString(bits); // 32 or 64 } diff --git a/build/build.xml b/build/build.xml index adc15e658..7f60a1f3a 100644 --- a/build/build.xml +++ b/build/build.xml @@ -32,13 +32,25 @@ + + + + + + + + - + + + + + @@ -348,11 +360,13 @@ + - - + + + @@ -750,7 +764,7 @@ - + @@ -932,12 +946,18 @@ + + + + + + diff --git a/core/build.xml b/core/build.xml index 4a9d56a45..0b82eba67 100644 --- a/core/build.xml +++ b/core/build.xml @@ -37,7 +37,10 @@ - + + + + diff --git a/core/library/export.txt b/core/library/export.txt index 88d0bc274..a75048970 100644 --- a/core/library/export.txt +++ b/core/library/export.txt @@ -8,4 +8,5 @@ application.windows32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-wind application.windows64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-windows-amd64.jar,gluegen-rt-natives-windows-amd64.jar application.linux32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-i586.jar,gluegen-rt-natives-linux-i586.jar application.linux64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-amd64.jar,gluegen-rt-natives-linux-amd64.jar -application.linux-armv6hf=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar \ No newline at end of file +application.linux-armv6hf=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar +application.linux-arm64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-aarch64.jar,gluegen-rt-natives-linux-aarch64.jar diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index 5c9c2a9d6..14c7e8e5f 100644 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -709,11 +709,15 @@ public class JavaBuild { return false; } if (platform == PConstants.LINUX) { - // export the armv6hf version as well + // export the arm versions as well folder = new File(sketch.getFolder(), "application.linux-armv6hf"); if (!exportApplication(folder, platform, "armv6hf", embedJava && (bits == 32) && "arm".equals(arch))) { return false; } + folder = new File(sketch.getFolder(), "application.linux-arm64"); + if (!exportApplication(folder, platform, "arm64", embedJava && (bits == 64) && "aarch64".equals(arch))) { + return false; + } } } else { // just make a single one for this platform folder = new File(sketch.getFolder(), "application." + platformName);