From 5b4e0d64172c2d5a50415654ce25754ade5128a7 Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Wed, 4 Jan 2023 14:34:18 +0100 Subject: [PATCH] documentation: add iOS build steps to the manual --- src/doc/manual/user-guide/building.txi | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/doc/manual/user-guide/building.txi b/src/doc/manual/user-guide/building.txi index 415e430be..fc7fa1049 100644 --- a/src/doc/manual/user-guide/building.txi +++ b/src/doc/manual/user-guide/building.txi @@ -159,3 +159,55 @@ make install Library and assets are installed in the "ecl-android" directory and are ready to run on the Android system. + +@subsubsection iOS + +The cross-compilation steps for iOS are similar to those for Android. + +Build the host ECL: +@example +@verbatim +./configure --prefix=`pwd`/ecl-iOS-host --disable-c99complex +make -j9 +make install +rm -r build +export ECL_TO_RUN=`pwd`/ecl-iOS-host/bin/ecl +@end verbatim +@end example + +Configure the toolchain: +@example +@verbatim +export IOS_VERSION_MIN="8.0" +export IOS_SDK_DIR="`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/" + +export CC="clang" +export CXX="clang++" + +export CFLAGS="-arch arm64 -miphoneos-version-min=${IOS_VERSION_MIN} -isysroot ${IOS_SDK_DIR}" +export CFLAGS="$CFLAGS -pipe -Wno-trigraphs -Wreturn-type -Wunused-variable" +export CFLAGS="$CFLAGS -fpascal-strings -fasm-blocks -fmessage-length=0 -fvisibility=hidden" +export CFLAGS="$CFLAGS -O2 -DNO_ASM" + +export LD="ld" +export LDFLAGS="-arch arm64 -pipe -std=c99 -gdwarf-2 -isysroot ${IOS_SDK_DIR}" +export LIBS="-framework Foundation" +@end verbatim +@end example + +Build and install the target library: +@example +@verbatim +export CFLAGS="$CFLAGS -DGC_DISABLE_INCREMENTAL -DECL_RWLOCK" +export CXXFLAGS="$CFLAGS" +./configure --host=aarch64-apple-darwin \ + --prefix=`pwd`/ecl-iOS \ + --disable-c99complex \ + --disable-shared \ + --with-cross-config=`pwd`/src/util/iOS-arm64.cross_config +make -j9 +make install +@end verbatim +@end example + +Library and assets in the "ecl-iOS" directory are ready to run on the iOS system.