Kaydet (Commit) 7b5b3c04 authored tarafından jan Iversen's avatar jan Iversen

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
üst e409e6b0
...@@ -620,7 +620,6 @@ export WPG_CFLAGS=$(gb_SPACE)@WPG_CFLAGS@ ...@@ -620,7 +620,6 @@ export WPG_CFLAGS=$(gb_SPACE)@WPG_CFLAGS@
export WPG_LIBS=$(gb_SPACE)@WPG_LIBS@ export WPG_LIBS=$(gb_SPACE)@WPG_LIBS@
export WPS_CFLAGS=$(gb_SPACE)@WPS_CFLAGS@ export WPS_CFLAGS=$(gb_SPACE)@WPS_CFLAGS@
export WPS_LIBS=$(gb_SPACE)@WPS_LIBS@ export WPS_LIBS=$(gb_SPACE)@WPS_LIBS@
export IOS_ARCH=@IOS_ARCH@
export IOS_SDK=@IOS_SDK@ export IOS_SDK=@IOS_SDK@
export XINERAMA_LINK=@XINERAMA_LINK@ export XINERAMA_LINK=@XINERAMA_LINK@
export XMLLINT=@XMLLINT@ export XMLLINT=@XMLLINT@
......
...@@ -620,7 +620,11 @@ darwin*) # Mac OS X or iOS ...@@ -620,7 +620,11 @@ darwin*) # Mac OS X or iOS
test_freetype=no test_freetype=no
test_fontconfig=no test_fontconfig=no
test_dbus=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 _os=iOS
test_gtk=no test_gtk=no
test_cups=no test_cups=no
...@@ -635,10 +639,6 @@ darwin*) # Mac OS X or iOS ...@@ -635,10 +639,6 @@ darwin*) # Mac OS X or iOS
with_ppds=no with_ppds=no
else else
_os=Darwin _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 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
INSTROOTCONTENTSUFFIX=/Contents INSTROOTCONTENTSUFFIX=/Contents
SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
...@@ -2872,18 +2872,16 @@ if test $_os = iOS; then ...@@ -2872,18 +2872,16 @@ if test $_os = iOS; then
if test "$enable_ios_simulator" = "yes"; then if test "$enable_ios_simulator" = "yes"; then
platform=iPhoneSimulator platform=iPhoneSimulator
versionmin=-mios-simulator-version-min=10.3 versionmin=-mios-simulator-version-min=10.3
IOS_ARCH=x86_64
BITNESS=-fembed-bitcode BITNESS=-fembed-bitcode
else else
platform=iPhoneOS platform=iPhoneOS
versionmin=-miphoneos-version-min=10.3 versionmin=-miphoneos-version-min=10.3
IOS_ARCH=arm64
BITNESS=-fembed-bitcode BITNESS=-fembed-bitcode
fi fi
xcode_developer=`xcode-select -print-path` xcode_developer=`xcode-select -print-path`
current_sdk_ver=10.2 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 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
if test -d $t; then if test -d $t; then
ios_sdk=$sdkver ios_sdk=$sdkver
...@@ -2911,8 +2909,8 @@ if test $_os = iOS; then ...@@ -2911,8 +2909,8 @@ if test $_os = iOS; then
stdlib="-stdlib=libc++" stdlib="-stdlib=libc++"
CC="`xcrun -find clang` -arch $IOS_ARCH -fvisibility=hidden $BITNESS -isysroot $sysroot $lto $versionmin" CC="`xcrun -find clang` -arch $host_cpu -fvisibility=hidden $BITNESS -isysroot $sysroot $lto $versionmin"
CXX="`xcrun -find clang++` -arch $IOS_ARCH -fvisibility=hidden $stdlib $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` INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
AR=`xcrun -find ar` AR=`xcrun -find ar`
...@@ -2922,7 +2920,6 @@ if test $_os = iOS; then ...@@ -2922,7 +2920,6 @@ if test $_os = iOS; then
RANLIB=`xcrun -find ranlib` RANLIB=`xcrun -find ranlib`
fi fi
AC_SUBST(IOS_ARCH)
AC_SUBST(IOS_SDK) AC_SUBST(IOS_SDK)
AC_MSG_CHECKING([whether to treat the installation as read-only]) AC_MSG_CHECKING([whether to treat the installation as read-only])
...@@ -3079,9 +3076,7 @@ if test "$_os" = "WINNT"; then ...@@ -3079,9 +3076,7 @@ if test "$_os" = "WINNT"; then
fi fi
fi fi
if test "$_os" = "iOS"; then if test "$_os" = "iOS"; then
if test "$host_cpu" = "arm64" ; then cross_compiling="yes"
cross_compiling="yes"
fi
fi fi
if test "$cross_compiling" = "yes"; then if test "$cross_compiling" = "yes"; then
...@@ -3945,9 +3940,7 @@ darwin*) ...@@ -3945,9 +3940,7 @@ darwin*)
arm64) arm64)
OS=IOS OS=IOS
if test "$enable_ios_simulator" = "yes"; then if test "$enable_ios_simulator" = "yes"; then
CPUNAME=X86_64 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
RTL_ARCH=X86_64
PLATFORMID=macosx_x86_64
else else
CPUNAME=ARM64 CPUNAME=ARM64
RTL_ARCH=ARM_EABI RTL_ARCH=ARM_EABI
...@@ -3958,6 +3951,9 @@ darwin*) ...@@ -3958,6 +3951,9 @@ darwin*)
AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS]) AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
;; ;;
x86_64) x86_64)
if test "$enable_ios_simulator" = "yes"; then
OS=IOS
fi
CPUNAME=X86_64 CPUNAME=X86_64
RTL_ARCH=X86_64 RTL_ARCH=X86_64
PLATFORMID=macosx_x86_64 PLATFORMID=macosx_x86_64
...@@ -5571,16 +5567,13 @@ dnl =================================================================== ...@@ -5571,16 +5567,13 @@ dnl ===================================================================
if test "$_os" != "WINNT"; then if test "$_os" != "WINNT"; then
if test "$_os" == "iOS"; then if test "$_os" == "iOS"; then
if test "$host_cpu" == "arm64"; then AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
ac_cv_sizeof_long=8 ac_cv_sizeof_long=8
ac_cv_sizeof_short=2 ac_cv_sizeof_short=2
ac_cv_sizeof_int=4 ac_cv_sizeof_int=4
ac_cv_sizeof_long_long=8 ac_cv_sizeof_long_long=8
ac_cv_sizeof_double=8 ac_cv_sizeof_double=8
ac_cv_sizeof_voidp=8 ac_cv_sizeof_voidp=8
fi
AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
else else
AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(short)
......
...@@ -116,7 +116,7 @@ $(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC) ...@@ -116,7 +116,7 @@ $(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC)
-project $(IOSKITPRJ) \ -project $(IOSKITPRJ) \
-target LibreOfficeKit \ -target LibreOfficeKit \
-sdk $(IOS_SDK) \ -sdk $(IOS_SDK) \
-arch $(IOS_ARCH) \ -arch $(CPU_NAME) \
-configuration $(if $(ENABLE_DEBUG),Debug,Release) \ -configuration $(if $(ENABLE_DEBUG),Debug,Release) \
build \ build \
, $(WORKDIR)/ios/build.log \ , $(WORKDIR)/ios/build.log \
...@@ -134,7 +134,7 @@ $(INSTDIR)/$(IOSAPP): $(IOSAPPPRJ)/project.pbxproj $(IOSGEN)/$(IOSKIT) ...@@ -134,7 +134,7 @@ $(INSTDIR)/$(IOSAPP): $(IOSAPPPRJ)/project.pbxproj $(IOSGEN)/$(IOSKIT)
-project $(IOSAPPPRJ) \ -project $(IOSAPPPRJ) \
-target LibreOfficeLight \ -target LibreOfficeLight \
-sdk $(IOS_SDK) \ -sdk $(IOS_SDK) \
-arch $(IOS_ARCH) \ -arch $(CPU_NAME) \
-configuration $(if $(ENABLE_DEBUG),Debug,Release) \ -configuration $(if $(ENABLE_DEBUG),Debug,Release) \
build \ build \
, $(WORKDIR)/ios/build.log \ , $(WORKDIR)/ios/build.log \
......
...@@ -23,7 +23,8 @@ Because the main work is done on the UI, where it is convenient to ...@@ -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 switch fast between arm64 and simulator, it is advantageous to compile
the 3 configurations of LO first, and then link against those. 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) ./core - libreoffice git clone (name can be changed)
./ios-arm64 - workdir for production, autogen.input: ./ios-arm64 - workdir for production, autogen.input:
standard + standard +
...@@ -39,7 +40,7 @@ Due to the multiple workdirs a distinct directory setup is needed ...@@ -39,7 +40,7 @@ Due to the multiple workdirs a distinct directory setup is needed
standard + standard +
--enable-debug --enable-debug
--enable-ios-simulator --enable-ios-simulator
--host=arm64-apple-darwin #--host=arm64-apple-darwin
./ios-app - workdir for UI, NO autogen.input ./ios-app - workdir for UI, NO autogen.input
-- Steps to generate -- Steps to generate
...@@ -48,10 +49,15 @@ Due to the multiple workdirs a distinct directory setup is needed ...@@ -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) 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 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 3) run make in ios-arm64, ios-arm64-debug and ios-simulator
this will build LO is 3 configurations and store the LibreOfficeKit this will generate ./*/ios/lo[Kit|App].xcconfig which prepares LO to be compiled
including generate ./*/ios/lo.xcconfig which prepares LO to be compiled and build LOkit is 3 configurations and store the LibreOfficeKit
libraries in ./ios-app/libraries as: libraries in ./core/ios/generated as:
./ios-app/Library/LibreOfficeKit-arm64.a LibreOfficeKit-arm64.a
./ios-app/Library/LibreOfficeKit-arm64-debug.a LibreOfficeKit-arm64-debug.a
./ios-app/Library/LibreOfficeKit-simulator.a LibreOfficeKit-simulator.a
4) open xcode with LibreOfficeLight and enjoy *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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment