Skip to content

Commit 4be48f9

Browse files
committed
still more work to make exporting applications for 32 and 64-bit work
1 parent eef25a4 commit 4be48f9

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

app/src/processing/mode/java/JavaBuild.java

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,16 +1352,16 @@ private boolean exportApplication(File destFolder,
13521352
runOptions += " -Xmx" +
13531353
Preferences.get("run.options.memory.maximum") + "m";
13541354
}
1355-
if (exportPlatform == PConstants.MACOSX) {
1356-
// If no bits specified (libs are all universal, or no native libs)
1357-
// then exportBits will be 0, and can be controlled via "Get Info".
1358-
// Otherwise, need to specify the bits as a VM option.
1359-
if (exportBits == 32) {
1360-
runOptions += " -d32";
1361-
} else if (exportBits == 64) {
1362-
runOptions += " -d64";
1363-
}
1364-
}
1355+
// if (exportPlatform == PConstants.MACOSX) {
1356+
// // If no bits specified (libs are all universal, or no native libs)
1357+
// // then exportBits will be 0, and can be controlled via "Get Info".
1358+
// // Otherwise, need to specify the bits as a VM option.
1359+
// if (exportBits == 32) {
1360+
// runOptions += " -d32";
1361+
// } else if (exportBits == 64) {
1362+
// runOptions += " -d64";
1363+
// }
1364+
// }
13651365

13661366
/// macosx: write out Info.plist (template for classpath, etc)
13671367

@@ -1395,6 +1395,18 @@ private boolean exportApplication(File destFolder,
13951395
sb.replace(index, index + "@@lsuipresentationmode@@".length(),
13961396
Preferences.getBoolean("export.application.fullscreen") ? "4" : "0");
13971397
}
1398+
while ((index = sb.indexOf("@@lsarchitecturepriority@@")) != -1) {
1399+
// More about this mess: http://support.apple.com/kb/TS2827
1400+
// First default to exportBits == 0 case
1401+
String arch = "<string>x86_64</string>\n <string>i386</string>";
1402+
if (exportBits == 32) {
1403+
arch = "<string>i386</string>";
1404+
} else if (exportBits == 64) {
1405+
arch = "<string>x86_64</string>";
1406+
}
1407+
sb.replace(index, index + "@@lsarchitecturepriority@@".length(), arch);
1408+
}
1409+
13981410
lines[i] = sb.toString();
13991411
}
14001412
// explicit newlines to avoid Windows CRLF

build/build.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@
343343
tofile="macosx/work/Processing.app" />
344344

345345
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
346-
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub64" perm="ugo+x" />
347346

348347
<copy todir="macosx/work/Processing.app/Contents/Resources/Java" flatten="true">
349348
<fileset refid="runtime.jars"/>
@@ -368,7 +367,6 @@
368367

369368
<!-- The ant copy command does not preserve permissions. -->
370369
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
371-
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub64" perm="ugo+x" />
372370

373371
<replace file="macosx/work/Processing.app/Contents/Info.plist"
374372
token="VERSION" value="${version}" />
@@ -404,7 +402,6 @@
404402

405403
<!-- The ant copy command does not preserve permissions. -->
406404
<chmod file="macosx/working_dir/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
407-
<chmod file="macosx/working_dir/Processing.app/Contents/MacOS/JavaApplicationStub64" perm="ugo+x" />
408405

409406
<!-- Pause briefly for the OS to catch up with the DMG changes.
410407
This prevents "hdiutil: couldn't eject "disk3" - Resource busy"
15.3 KB
Binary file not shown.
15.3 KB
Binary file not shown.
-13.7 KB
Binary file not shown.

java/application/template.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
<key>LSUIPresentationMode</key>
2828
<integer>@@lsuipresentationmode@@</integer>
2929

30+
<key>LSArchitecturePriority</key>
31+
<array>
32+
@@lsarchitecturepriority@@
33+
</array>
34+
3035
<key>Java</key>
3136
<dict>
3237
<key>VMOptions</key>

0 commit comments

Comments
 (0)