Skip to content

Commit a4d67fc

Browse files
abhinayagarwalJohan Vos
authored and
Johan Vos
committed
8347033: [mobile] add ios-specific build docs
Reviewed-by: jvos, ihse
1 parent 98e96a4 commit a4d67fc

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,48 @@ or either of these files:
1010
See <https://openjdk.org/> for more information about the OpenJDK
1111
Community and the JDK and see <https://bugs.openjdk.org> for JDK issue
1212
tracking.
13+
14+
## Build static image for iOS
15+
16+
> [!NOTE]
17+
> Follow the instructions in [building.md](building.md) to make sure
18+
> you can build the JDK targeting macOS before trying to build for iOS
19+
20+
### Pre-requisites
21+
Following are the prerequisites to build JDK on Mac targeting iOS:
22+
1. Download and unzip pre-built JDK24 to be used as boot JDK
23+
2. Download the [support zip](https://download2.gluonhq.com/mobile/mobile-support-20250106.zip) which contains an ios build for libffi and cups. Unzip it in the root directory of the project.
24+
3. Install `autoconf` on mac via homebrew: `brew install autoconf`
25+
26+
### Clone the mobile repository
27+
Clone the openjdk/mobile repository. The following command can be used:
28+
29+
```
30+
git clone [email protected]:openjdk/mobile.git
31+
```
32+
33+
### Configure
34+
Modify the configure script below so that it has the correct paths to your JDK24 directory,
35+
the unzipped 'support' directory, and the correct location of the iPhoneOS.platform.
36+
37+
```
38+
sh configure \
39+
--with-conf-name=zero-ios-aarch64 \
40+
--disable-warnings-as-errors \
41+
--openjdk-target=aarch64-macos-ios \
42+
--with-boot-jdk=/Users/abhinay/.sdkman/candidates/java/24.ea.29-open \
43+
--with-jvm-variants=zero \
44+
--with-libffi-include=<support-dir-absolute-path>/libffi/include \
45+
--with-libffi-lib=<support-dir-absolute-path>/libffi/libs \
46+
--with-cups-include=<support-dir-absolute-path>/cups-2.3.6
47+
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \
48+
```
49+
50+
### Build static image
51+
Execute the `make` command:
52+
53+
```
54+
make CONF=zero-ios-aarch64 static-libs-image
55+
```
56+
57+
Once the build is successful, it should have created a directory in `build/zero-ios-aarch64/images/static-libs/lib/zero` with a file `libjvm.a`.

0 commit comments

Comments
 (0)