Current build instructions for iOS
Steve Hannah
steve at weblite.ca
Thu May 10 19:56:37 UTC 2018
Thanks for the tips.
I'm using the configure listed on the instructions (
http://openjdk.java.net/projects/mobile/ios.html)
cd mobile-dev
bash configure \
--enable-option-checking=fatal \
--build=x86_64-apple-darwin \
--host=x86_64-macos-ios \
--target=x86_64-macos-ios \
--disable-warnings-as-errors \
--enable-headless-only \
--with-boot-jdk=$JDK_DIR \
--with-jdk-variant=normal \
--with-jvm-variants=minimal1 \
--enable-static-build=yes \
--with-extra-cflags="-arch x86_64 -Wno-implicit-function-declaration
-Wno-unused-parameter -miphoneos-version-min=8.0.0" \
--with-extra-cxxflags="-arch x86_64 -Wno-implicit-function-declaration
-Wno-unused-parameter -miphoneos-version-min=8.0.0" \
--with-extra-ldflags="-arch x86_64 -miphoneos-version-min=8.0.0
-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system"
\
--with-cups-include=$CUPS_DIR \
--with-sys-root=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
\
--with-tools-dir=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/../../usr/bin
\
--with-debug-level=release \
--disable-precompiled-headers \
--with-freetype-lib=$FREETYPE_DIR/lib \
--with-freetype-include=$FREETYPE_DIR/include/freetype2
> For iOS builds, I'd recommend first making sure you can build for macosx
> with your installed toolchain,
> and then try the iOS specific builds.
>
Thanks, I'll try that.
>
> For the linking error, are you using more than one installed version of
> Xcode.
> e.g. "xcode-select -p" or DEVELOPER_DIR
>
I'm pretty sure I'm using just one at a time. I'm using xcode-select to
specify which Xcode to use, and I'm using the corresponding Xcode in the
configure statement.
>
> I usually would do a "LOG=debug" build to see the full command passed to
> the linker,
> but you have enough in the errors you already have.
>
> clang: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX'
> [-Wincompatible-sysroot]
>
>
> Every object file and executable is built for a specific SDK.
> The warning says the flags do not match the toolchain installed.
>
> ld: warning: directory not found for option '-F/Applications/Xcode.app/
> Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
> iPhoneSimulator.sdk/System/Library/Frameworks/JavaVM.framework/Frameworks'
>
> ld: building for OSX, but linking against dylib built for iOS
> (/Applications/Xcode.app/Contents/Developer/Platforms/
> iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libc++.tbd).
> file '/Applications/Xcode.app/Contents/Developer/Platforms/
> iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libc++.tbd'
> for architecture x86_64
>
> This would be a good time to compare the directory structure of the
> iPhoneSimulator
> SDK in Xcode 7.1 and 9.3. It may have changed.
>
Thanks. I'll do that. My attempt with 7.3 had similar results - only I
had to patch some code that required CoreServices, which apparently isn't
available in 7.3. I'm going to download 7.1 and see if that gets me
through to the end.
Best regards
Steve
More information about the mobile-dev
mailing list