[Libreoffice-commits] core.git: 2 commits - ios/CustomTarget_iOS.mk ios/LibreOfficeKit ios/loApp.xcconfig.in solenv/bin

jan Iversen jani at libreoffice.org
Mon Oct 16 17:14:54 UTC 2017


 ios/CustomTarget_iOS.mk                                     |   11 +++---
 ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj |   20 ++++++------
 ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c          |   19 ++++++++---
 ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h          |    8 ++++
 ios/loApp.xcconfig.in                                       |    7 +---
 solenv/bin/native-code.py                                   |    3 -
 6 files changed, 42 insertions(+), 26 deletions(-)

New commits:
commit 7636558b4549a519694b4263bffee1b1f1cc2672
Author: jan Iversen <jani at libreoffice.org>
Date:   Mon Oct 16 19:12:38 2017 +0200

    iOS, update to make app use prelink
    
    Change-Id: I2af55a199106ae7ccc9ebe748b4295fd9f83e205

diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk
index 9f19f279a964..b07c6cbf99e8 100644
--- a/ios/CustomTarget_iOS.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -29,7 +29,7 @@ $(call gb_CustomTarget_get_target,ios/ios): $(IOSGEN)/$(IOSKIT)
 
 
 #- Generate xcconfig files  ---------------------------------------------------
-$(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS.mk 
+$(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS.mk
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
 	@mkdir -p $(IOSGEN) $(WORKDIR)/ios;
 	sed -e "s'@BUILDDIR@'$(BUILDDIR)'g" \
@@ -48,7 +48,6 @@ $(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_i
 	    -e "s'@CFLAGS@'$(gb_GLOBALDEFS)'g" \
 	    -e "s'@CPLUSPLUSFLAGS@'$(gb_GLOBALDEFS)'g" \
 	    -e "s'@SYMROOT@'$(WORKDIR)/ios/build'g" \
-	    -e "s'@LDLIBS@'`$(SRCDIR)/bin/lo-all-static-libs`'g" \
 	    $(SRCDIR)/ios/loApp.xcconfig.in > $(WORKDIR)/ios/loApp.xcconfig
 
 ifeq ("$(wildcard $(IOSRES))","")
diff --git a/ios/loApp.xcconfig.in b/ios/loApp.xcconfig.in
index 56cb23a9337f..fb3426dd4df8 100644
--- a/ios/loApp.xcconfig.in
+++ b/ios/loApp.xcconfig.in
@@ -13,16 +13,15 @@ LO_WORKDIR = @WORKDIR@
 OTHER_CFLAGS = @CFLAGS@
 OTHER_CPLUSPLUSFLAGS = @CPLUSPLUSFLAGS@
 SYMROOT = @SYMROOT@
-LINK_LDFLAGS= @LDLIBS@ 
 
 //:configuration = Debug
-//LINK_LDFLAGS= $(LO_SRCDIR)/ios/generated/libLibreOfficeKit_ARM64_debug.a
+LINK_LDFLAGS= $(LO_SRCDIR)/ios/generated/libLibreOfficeKit_ARM64_debug.a
 
 //:configuration = Release
-//LINK_LDFLAGS= $(LO_SRCDIR)/ios/generated/libLibreOfficeKit_ARM64.a
+LINK_LDFLAGS= $(LO_SRCDIR)/ios/generated/libLibreOfficeKit_ARM64.a
 
 //:configuration = Simulator
-//LINK_LDFLAGS= $(LO_SRCDIR)/ios/generated/libLibreOfficeKit_X86_64_debug.a
+LINK_LDFLAGS= $(LO_SRCDIR)/ios/generated/libLibreOfficeKit_X86_64_debug.a
 
 //:completeSettings = some
 
commit 7e7329873b263917ff963b38dfd804727d0914d0
Author: jan Iversen <jani at libreoffice.org>
Date:   Mon Oct 16 14:14:30 2017 +0200

    iOS, change prelink lib to pure C.
    
    Removed object C and replaced with C to make lib pure.
    
    Change-Id: Ie0f49f7e2f4577195dadfa0fdec70212af7c698a

diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk
index 7effabcaa769..9f19f279a964 100644
--- a/ios/CustomTarget_iOS.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -10,6 +10,8 @@ IOSGEN := $(SRCDIR)/ios/generated
 IOSRES := $(IOSGEN)/resources
 IOSKITXC := $(WORKDIR)/ios/loKit.xcconfig
 IOSAPPXC := $(WORKDIR)/ios/loApp.xcconfig
+IOSKITSRC := $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit
+IOSAPPSRC := $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight
 IOSKITPRJ := $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj
 IOSAPPPRJ := $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj
 IOSAPP := $(INSTDIR)/LibreOfficeLight.app
@@ -58,7 +60,7 @@ ifeq ("$(wildcard $(IOSRES))","")
 	# generate file with call declarations
 	$(SRCDIR)/solenv/bin/native-code.py \
 	    -g core -g writer -g calc -g draw -g edit \
-	    > $(IOSGEN)/native-code.mm
+	    > $(IOSGEN)/native-code.h
 
 	# generate resource files used to start/run LibreOffice
 	cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt59l.dat $(IOSRES)/icudt59l.dat
@@ -108,7 +110,7 @@ endif
 
 
 #- build  ---------------------------------------------------------------------
-$(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC)
+$(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC) $(IOSKITSRC)/LibreOfficeKit.h $(IOSKITSRC)/LibreOfficeKit.c
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
 	CC=; \
 	$(call gb_Helper_print_on_error, \
@@ -145,7 +147,7 @@ $(INSTDIR)/$(IOSAPP): $(IOSAPPPRJ)/project.pbxproj $(IOSGEN)/$(IOSKIT)
 #- clean ios  -----------------------------------------------------------------
 $(call gb_CustomTarget_get_clean_target,ios/ios):
 	$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),ENV,2)
-	rm $(IOSGEN)/$(IOSKIT)
+	rm -f $(IOSGEN)/$(IOSKIT)
 	rm -rf $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.xcworkspace
 	rm -rf $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/xcuserdata
 	rm -rf $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.xcworkspace
diff --git a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
index 99a6a26ca0f7..69faf4fb80a9 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
@@ -7,27 +7,25 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		39B5D21A1F78130F008FB162 /* LibreOfficeKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */; };
-		39B5D21B1F78130F008FB162 /* LibreOfficeKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */; };
+		39503A731F94CBA000F19C78 /* LibreOfficeKit.c in Sources */ = {isa = PBXBuildFile; fileRef = 39503A721F94CBA000F19C78 /* LibreOfficeKit.c */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
 		39B5D2131F78130F008FB162 /* CopyFiles */ = {
 			isa = PBXCopyFilesBuildPhase;
 			buildActionMask = 2147483647;
-			dstPath = "include/$(PRODUCT_NAME)";
-			dstSubfolderSpec = 16;
+			dstPath = "$(SRCDIR)/ios/generated";
+			dstSubfolderSpec = 0;
 			files = (
-				39B5D21B1F78130F008FB162 /* LibreOfficeKit.h in CopyFiles */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+		39503A6E1F94C3B700F19C78 /* LibreOfficeKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibreOfficeKit.h; sourceTree = "<group>"; };
+		39503A721F94CBA000F19C78 /* LibreOfficeKit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LibreOfficeKit.c; sourceTree = "<group>"; };
 		39B5D2151F78130F008FB162 /* libLibreOfficeKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLibreOfficeKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		39B5D2181F78130F008FB162 /* LibreOfficeKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LibreOfficeKit.h; sourceTree = "<group>"; };
-		39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LibreOfficeKit.mm; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -68,8 +66,8 @@
 		39B5D2171F78130F008FB162 /* LibreOfficeKit */ = {
 			isa = PBXGroup;
 			children = (
-				39B5D2181F78130F008FB162 /* LibreOfficeKit.h */,
-				39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */,
+				39503A721F94CBA000F19C78 /* LibreOfficeKit.c */,
+				39503A6E1F94C3B700F19C78 /* LibreOfficeKit.h */,
 			);
 			path = LibreOfficeKit;
 			sourceTree = "<group>";
@@ -131,7 +129,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				39B5D21A1F78130F008FB162 /* LibreOfficeKit.mm in Sources */,
+				39503A731F94CBA000F19C78 /* LibreOfficeKit.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -276,6 +274,7 @@
 		39B5D21F1F78130F008FB162 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				MACH_O_TYPE = staticlib;
 				OTHER_LDFLAGS = "";
 				PRELINK_FLAGS = "-ios_version_min 10.3";
 				PRELINK_LIBS = "";
@@ -287,6 +286,7 @@
 		39B5D2201F78130F008FB162 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				MACH_O_TYPE = staticlib;
 				OTHER_LDFLAGS = "";
 				PRELINK_FLAGS = "-ios_version_min 10.3";
 				PRELINK_LIBS = "";
diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
similarity index 76%
rename from ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm
rename to ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
index 677386ce196b..b3c41c3a5d4b 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
@@ -5,6 +5,7 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 //
+#include "LibreOfficeKit.h"
 #include <stdio.h>
 #include <TargetConditionals.h>
 #define LOK_USE_UNSTABLE_API
@@ -16,11 +17,11 @@
 #include <unicode/ucnv.h>
 
 // generated by solenv/bin/native-code.py:
-#include "native-code.mm"
+#include "native-code.h"
 
 
 // Force reference to libreofficekit_hook
-extern "C" __attribute__((used)) void *libreofficekit_hook(const char *);
+extern __attribute__((used)) void *libreofficekit_hook(const char *);
 static __attribute__((used)) void *(*foop)(const char *) = libreofficekit_hook;
 
 // pointers to our instance
@@ -31,7 +32,7 @@ static LibreOfficeKitDocument* document;
 
 
 // Bridge functions to LibreOfficeKit
-extern "C" int BridgeLOkit_Init(const char *path)
+int BridgeLOkit_Init(const char *path)
 {
     char bufUserPath[200];
     strcpy(bufUserPath, path);
@@ -43,10 +44,18 @@ extern "C" int BridgeLOkit_Init(const char *path)
     return 0;
 }
 
-int LOkit_open(char *file)
+
+
+int BridgeLOkit_open(const char *path)
 {
-    document = kit->pClass->documentLoad(kit, file);
+    document = kit->pClass->documentLoad(kit, path);
     document->pClass->initializeForRendering(document, "");
     return 0;
 }
 
+
+
+int BridgeLOkit_ClientCommand(const char *input)
+{
+  return 0;
+}
diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
index 3d4366495382..b86156211893 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
@@ -6,3 +6,11 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 //
 
+// Bridge functions between LibreOfficeKit library and swift application.
+// Only functions mentioned here can be used from the application
+// The swift compiler uses this header to generate a needed interface
+// The functions (LibreOfficeKit.mm) calls functions directly in LibreOffice
+
+int BridgeLOkit_Init(const char *path);
+int BridgeLOkit_open(const char *path);
+int BridgeLOkit_ClientCommand(const char *input);
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 21adb83ac769..886c70a9cbfd 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -446,7 +446,6 @@ print ("""/*
 #include <config_features.h>
 #include <osl/detail/component-mapping.h>
 
-extern "C" {
 """)
 
 for entry in sorted(full_factory_map.keys()):
@@ -520,6 +519,6 @@ print ("""
     return map;
 }
 
-}""")
+""")
 
 # vim:set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list