summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjan Iversen <jani@libreoffice.org>2017-10-04 17:22:57 +0200
committerjan Iversen <jani@libreoffice.org>2017-10-04 18:43:13 +0200
commit7b5b3c041404c33b3d76eeea71920d042df5d8c3 (patch)
tree7513ed93edeb7e4d08e62f7b74f16a813ffb92d6
parente409e6b02745b528eb5ce497fd2583bd5035c425 (diff)
iOS, simulator compiles as nactive mac OSX host
Make simulator (and especially third party libraries) compile as OSX host, but with iPhonesimulator SDK. Change-Id: I2b282d1e84c5c6544dcb98413fec5c6e811efda6
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac47
-rw-r--r--ios/CustomTarget_iOS.mk4
-rw-r--r--ios/README24
4 files changed, 37 insertions, 39 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 5dd5d1481ad5..8442f07425f0 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -620,7 +620,6 @@ export WPG_CFLAGS=$(gb_SPACE)@WPG_CFLAGS@
export WPG_LIBS=$(gb_SPACE)@WPG_LIBS@
export WPS_CFLAGS=$(gb_SPACE)@WPS_CFLAGS@
export WPS_LIBS=$(gb_SPACE)@WPS_LIBS@
-export IOS_ARCH=@IOS_ARCH@
export IOS_SDK=@IOS_SDK@
export XINERAMA_LINK=@XINERAMA_LINK@
export XMLLINT=@XMLLINT@
diff --git a/configure.ac b/configure.ac
index 8c12f1301046..3e197436cdcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -620,7 +620,11 @@ darwin*) # Mac OS X or iOS
test_freetype=no
test_fontconfig=no
test_dbus=no
- if test "$host_cpu" = "arm64"; then
+ if test -n "$LODE_HOME" ; then
+ mac_sanitize_path
+ AC_MSG_NOTICE([sanitized the PATH to $PATH])
+ fi
+ if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
_os=iOS
test_gtk=no
test_cups=no
@@ -635,10 +639,6 @@ darwin*) # Mac OS X or iOS
with_ppds=no
else
_os=Darwin
- if test -n "$LODE_HOME" ; then
- mac_sanitize_path
- AC_MSG_NOTICE([sanitized the PATH to $PATH])
- fi
INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
INSTROOTCONTENTSUFFIX=/Contents
SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
@@ -2872,18 +2872,16 @@ if test $_os = iOS; then
if test "$enable_ios_simulator" = "yes"; then
platform=iPhoneSimulator
versionmin=-mios-simulator-version-min=10.3
- IOS_ARCH=x86_64
BITNESS=-fembed-bitcode
else
platform=iPhoneOS
versionmin=-miphoneos-version-min=10.3
- IOS_ARCH=arm64
BITNESS=-fembed-bitcode
fi
xcode_developer=`xcode-select -print-path`
current_sdk_ver=10.2
- for sdkver in 10.3 10.2 10.1 10.0 9.3; do
+ for sdkver in 11.0 10.3 10.2 10.1; do
t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
if test -d $t; then
ios_sdk=$sdkver
@@ -2911,8 +2909,8 @@ if test $_os = iOS; then
stdlib="-stdlib=libc++"
- CC="`xcrun -find clang` -arch $IOS_ARCH -fvisibility=hidden $BITNESS -isysroot $sysroot $lto $versionmin"
- CXX="`xcrun -find clang++` -arch $IOS_ARCH -fvisibility=hidden $stdlib $BITNESS -isysroot $sysroot $lto $versionmin"
+ CC="`xcrun -find clang` -arch $host_cpu -fvisibility=hidden $BITNESS -isysroot $sysroot $lto $versionmin"
+ CXX="`xcrun -find clang++` -arch $host_cpu -fvisibility=hidden $stdlib $BITNESS -isysroot $sysroot $lto $versionmin"
INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
AR=`xcrun -find ar`
@@ -2922,7 +2920,6 @@ if test $_os = iOS; then
RANLIB=`xcrun -find ranlib`
fi
-AC_SUBST(IOS_ARCH)
AC_SUBST(IOS_SDK)
AC_MSG_CHECKING([whether to treat the installation as read-only])
@@ -3079,9 +3076,7 @@ if test "$_os" = "WINNT"; then
fi
fi
if test "$_os" = "iOS"; then
- if test "$host_cpu" = "arm64" ; then
- cross_compiling="yes"
- fi
+ cross_compiling="yes"
fi
if test "$cross_compiling" = "yes"; then
@@ -3945,9 +3940,7 @@ darwin*)
arm64)
OS=IOS
if test "$enable_ios_simulator" = "yes"; then
- CPUNAME=X86_64
- RTL_ARCH=X86_64
- PLATFORMID=macosx_x86_64
+ AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
else
CPUNAME=ARM64
RTL_ARCH=ARM_EABI
@@ -3958,6 +3951,9 @@ darwin*)
AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
;;
x86_64)
+ if test "$enable_ios_simulator" = "yes"; then
+ OS=IOS
+ fi
CPUNAME=X86_64
RTL_ARCH=X86_64
PLATFORMID=macosx_x86_64
@@ -5571,16 +5567,13 @@ dnl ===================================================================
if test "$_os" != "WINNT"; then
if test "$_os" == "iOS"; then
-if test "$host_cpu" == "arm64"; then
- ac_cv_sizeof_long=8
- ac_cv_sizeof_short=2
- ac_cv_sizeof_int=4
- ac_cv_sizeof_long_long=8
- ac_cv_sizeof_double=8
- ac_cv_sizeof_voidp=8
-fi
-AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
-
+ AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
+ ac_cv_sizeof_long=8
+ ac_cv_sizeof_short=2
+ ac_cv_sizeof_int=4
+ ac_cv_sizeof_long_long=8
+ ac_cv_sizeof_double=8
+ ac_cv_sizeof_voidp=8
else
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(short)
diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk
index d765ca2426f6..55375687ff0e 100644
--- a/ios/CustomTarget_iOS.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -116,7 +116,7 @@ $(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC)
-project $(IOSKITPRJ) \
-target LibreOfficeKit \
-sdk $(IOS_SDK) \
- -arch $(IOS_ARCH) \
+ -arch $(CPU_NAME) \
-configuration $(if $(ENABLE_DEBUG),Debug,Release) \
build \
, $(WORKDIR)/ios/build.log \
@@ -134,7 +134,7 @@ $(INSTDIR)/$(IOSAPP): $(IOSAPPPRJ)/project.pbxproj $(IOSGEN)/$(IOSKIT)
-project $(IOSAPPPRJ) \
-target LibreOfficeLight \
-sdk $(IOS_SDK) \
- -arch $(IOS_ARCH) \
+ -arch $(CPU_NAME) \
-configuration $(if $(ENABLE_DEBUG),Debug,Release) \
build \
, $(WORKDIR)/ios/build.log \
diff --git a/ios/README b/ios/README
index d00b67e31f58..0151d72fd34c 100644
--- a/ios/README
+++ b/ios/README
@@ -23,7 +23,8 @@ Because the main work is done on the UI, where it is convenient to
switch fast between arm64 and simulator, it is advantageous to compile
the 3 configurations of LO first, and then link against those.
-Due to the multiple workdirs a distinct directory setup is needed
+Due to the multiple workdirs a separate work directories are needed as follows:
+(names/locations can be changes, they are "linked" together by running autogen.sh)
./core - libreoffice git clone (name can be changed)
./ios-arm64 - workdir for production, autogen.input:
standard +
@@ -39,7 +40,7 @@ Due to the multiple workdirs a distinct directory setup is needed
standard +
--enable-debug
--enable-ios-simulator
- --host=arm64-apple-darwin
+ #--host=arm64-apple-darwin
./ios-app - workdir for UI, NO autogen.input
-- Steps to generate
@@ -48,10 +49,15 @@ Due to the multiple workdirs a distinct directory setup is needed
Correct as per above, add your local setup (e.g. location of tarballs)
2) run ../core/autogen.sh in ios-arm64, ios-arm64-debug and ios-simulator
3) run make in ios-arm64, ios-arm64-debug and ios-simulator
- this will build LO is 3 configurations and store the LibreOfficeKit
- including generate ./*/ios/lo.xcconfig which prepares LO to be compiled
- libraries in ./ios-app/libraries as:
- ./ios-app/Library/LibreOfficeKit-arm64.a
- ./ios-app/Library/LibreOfficeKit-arm64-debug.a
- ./ios-app/Library/LibreOfficeKit-simulator.a
-4) open xcode with LibreOfficeLight and enjoy
+ this will generate ./*/ios/lo[Kit|App].xcconfig which prepares LO to be compiled
+ and build LOkit is 3 configurations and store the LibreOfficeKit
+ libraries in ./core/ios/generated as:
+ LibreOfficeKit-arm64.a
+ LibreOfficeKit-arm64-debug.a
+ LibreOfficeKit-simulator.a
+ *note* run "make build-nocheck" in ios-simulator for the time being
+4) run ../core/autogen.sh in ios-app
+5) open xcode with LibreOfficeLight add ./ios-app/ios/loApp.xconfig to the project.
+6) enjoy
+
+