From 4a87681f2938c5ac305cca5d6410a3b79d2d8c1e Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 8 Sep 2019 14:35:30 +0100 Subject: [PATCH] Add cross-compilation instructions to the README --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index e438e869..d23a463a 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,16 @@ The easiest way to achieve this is to open the command prompt with the The Java Development Kit and Apache Maven `bin` directories must be manually [added to your `%PATH%` variable][path]. +##### Cross-compiling + +To compile a 32-bit DLL on a 64-bit Windows system, open the 'x64_x86 Cross +Tools Command Prompt for VS 2019' instead. + +Maven's `nar.javaHome` variable must point to a 32-bit JDK and `nar.arch` must +be set to `x86`: + + -Dnar.javaHome="C:\Program Files (x86)\path\to\jdk" -Dnar.arch=x86 + #### macOS Run `xcode-select --install` from the terminal to install the [Xcode][xcode] @@ -46,6 +56,16 @@ The easiest way to install the Java Development Kit and Apache Maven is with the [Homebrew][homebrew] package manager. After installing Homebrew, run `brew cask install java` and `brew install maven`. +##### Cross-compiling + +The last version of Java to support the 32-bit version of Mac OS X is the +[legacy Java 6 runtime][mac-legacy-java]. + +Pass the following flags to Maven to compile against the 32-bit version of the +legacy runtime on a 64-bit macOS system: + + -Dnar.javaHome=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -Dnar.arch=i386 + #### UNIX OpenRS2 requires the [GNU Compiler Collection][gcc] and the [Mesa 3D Graphics @@ -65,6 +85,14 @@ or enable its backports repository. `-headless` packages are not sufficient as the `gl-natives` module is linked with `libjawt`. +##### Cross-compiling + +To compile a 32-bit shared object on a 64-bit UNIX system, Maven's +`nar.javaHome` variable must point to a 32-bit JDK and `nar.arch` must be set +to `i386`: + + -Dnar.javaHome=/path/to/jdk -Dnar.arch=i386 + ### Non-free components OpenRS2 requires the original RuneScape client code, data and location file @@ -155,6 +183,7 @@ OpenRS2. If not, see . [idea]: https://www.jetbrains.com/idea/ [jdk]: https://jdk.java.net/ [lgpl]: https://www.gnu.org/licenses/lgpl-3.0.html +[mac-legacy-java]: https://support.apple.com/kb/DL1572 [maven]: https://maven.apache.org/ [mesa]: https://www.mesa3d.org/ [opengl]: https://www.opengl.org/