ios/CustomTarget_iOS_link.mk | 71 +++++++++++++++++------------------------- ios/CustomTarget_iOS_setup.mk | 55 ++++++++++++++++++-------------- ios/Module_ios.mk | 5 +- ios/StaticLibrary_iOSkit.mk | 28 ---------------- 4 files changed, 64 insertions(+), 95 deletions(-)
New commits: commit bf0117cce987dd92f6e658de0e186a282677b17f Author: jan Iversen <j...@libreoffice.org> Date: Thu Jan 25 15:14:36 2018 +0100 iOS, simplified dylib build Change-Id: Icea9a5e4796dda288fafcd478a769fa7087baab2 diff --git a/ios/CustomTarget_iOS_prelink.mk b/ios/CustomTarget_iOS_link.mk similarity index 52% rename from ios/CustomTarget_iOS_prelink.mk rename to ios/CustomTarget_iOS_link.mk index 0534264d416c..ab5ad721d8d7 100644 --- a/ios/CustomTarget_iOS_prelink.mk +++ b/ios/CustomTarget_iOS_link.mk @@ -5,60 +5,50 @@ # This Source Code Form is subject to the terms of the Mozilla Public # 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/. + + #- Env ------------------------------------------------------------------------ -IOSLIB = '' -IOSLD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -IOSCLANG = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -IOSOBJ = $(WORKDIR)/CObject/ios/Kit.o +IOSGEN = $(SRCDIR)/ios/generated +IOSLIBS := $(shell \ + (export INSTDIR=$(INSTDIR);export OS=$(OS); \ + export WORKDIR=$(WORKDIR);export LIBO_LIB_FOLDER=$(LIBO_LIB_FOLDER); \ + $(SRCDIR)/bin/lo-all-static-libs)) +IOSOBJ = $(WORKDIR)/ios/Kit.o +IOSSRC = $(SRCDIR)/ios/source/LibreOfficeKit.c ifeq ($(ENABLE_DEBUG),TRUE) ifeq ($(CPUNAME),X86_64) -IOSKIT = $(IOSGEN)/simulator/libKit +IOSKIT = $(IOSGEN)/simulator/libKit.dylib else -IOSKIT = $(IOSGEN)/debug/libKit +IOSKIT = $(IOSGEN)/debug/libKit.dylib endif else ifeq ($(CPUNAME),ARM64) -IOSKIT = $(IOSGEN)/release/libKit +IOSKIT = $(IOSGEN)/release/libKit.dylib endif endif #- Top level ----------------------------------------------------------------- -$(eval $(call gb_CustomTarget_CustomTarget,ios/iOS_prelink)) - -$(call gb_CustomTarget_get_target,ios/iOS_prelink): $(IOSKIT).dylib +$(eval $(call gb_CustomTarget_CustomTarget,ios/iOS_link)) +$(call gb_CustomTarget_get_target,ios/iOS_link): $(IOSKIT) #- build --------------------------------------------------------------------- -.PHONY: FORCE -FORCE: - - -IOSPREBUILD: FORCE - $(eval IOSLIBS = `$(SRCDIR)/bin/lo-all-static-libs`) - - - -$(IOSKIT).a: IOSPREBUILD $(WORKDIR)/ios $(call gb_StaticLibrary_get_target,iOS_kitBridge) \ - $(IOSLIBS) - $(call gb_Output_announce,iOS prelink object,$(true),LNK,2) - $(IOSLD) -r -ios_version_min $(IOS_DEPLOYMENT_VERSION) \ - -syslibroot $(MACOSX_SDK_PATH) \ - -arch `echo $(CPUNAME) | tr '[:upper:]' '[:lower:]'` \ - -o $(IOSOBJ) \ - $(WORKDIR)/CObject/ios/source/LibreOfficeKit.o \ - $(IOSLIBS) - $(AR) -r $(IOSKIT).a $(IOSOBJ) - - -$(IOSKIT).dylib: $(IOSKIT).a +$(IOSOBJ): $(IOSSRC) $(call gb_CustomTarget_get_target,ios/iOS_setup) + $(call gb_Output_announce,iOS compile interface,$(true),C,2) + $(gb_CC) $(gb_COMPILERDEFS) $(gb_OSDEFS) $(gb_CFLAGS) \ + -DDISABLE_DYNLOADING -DLIBO_INTERNAL_ONLY \ + -fvisibility=hidden -Werror -O0 -fstrict-overflow \ + $(if $(ENABLE_DEBUG),$(gb_DEBUG_CFLAGS) -g) \ + -c $(IOSSRC) -o $(IOSOBJ) \ + -I$(SRCDIR)/include -I$(BUILDDIR)/config_host \ + +$(IOSKIT): $(IOSOBJ) $(IOSLIBS) $(call gb_Output_announce,iOS dylib,$(true),LNK,2) - $(IOSCLANG) -dynamiclib -mios-simulator-version-min=$(IOS_DEPLOYMENT_VERSION) \ - -arch `echo $(CPUNAME) | tr '[:upper:]' '[:lower:]'` \ - -isysroot $(MACOSX_SDK_PATH) \ + $(gb_CC) -dynamiclib \ -Xlinker -rpath -Xlinker @executable_path/Frameworks \ -Xlinker -rpath -Xlinker @loader_path/Frameworks \ -dead_strip \ @@ -76,22 +66,21 @@ $(IOSKIT).dylib: $(IOSKIT).a -single_module \ -compatibility_version 1 \ -current_version 1 \ + $(IOSLIBS) \ $(IOSOBJ) \ - -o $(IOSKIT).dylib + -o $(IOSKIT) ifeq ($(origin IOS_CODEID),undefined) @echo "please define environment variable IOS_CODEID as\n" \ "export IOS_CODEID=<your apple code identifier>" @exit -1 else - codesign -s "$(IOS_CODEID)" $(IOSKIT).dylib + codesign -s "$(IOS_CODEID)" $(IOSKIT) endif - - #- clean ios ----------------------------------------------------------------- -$(call gb_CustomTarget_get_clean_target,ios/iOS_prelink): - rm -f $(IOSKIT).a $(IOSKIT).dylib +$(call gb_CustomTarget_get_clean_target,ios/iOS_link): + rm -f $(IOSKIT).dylib diff --git a/ios/Module_ios.mk b/ios/Module_ios.mk index c280713cc198..111391b31bee 100644 --- a/ios/Module_ios.mk +++ b/ios/Module_ios.mk @@ -12,11 +12,12 @@ ifeq ($(OS),IOS) $(eval $(call gb_Module_add_targets,ios,\ CustomTarget_iOS_setup \ - StaticLibrary_iOSkit \ - CustomTarget_iOS_prelink \ + CustomTarget_iOS_link \ )) + + endif # vim: set noet sw=4 ts=4: diff --git a/ios/StaticLibrary_iOSkit.mk b/ios/StaticLibrary_iOSkit.mk deleted file mode 100644 index a543e494a344..000000000000 --- a/ios/StaticLibrary_iOSkit.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_StaticLibrary_StaticLibrary,iOS_kitBridge)) - -$(eval $(call gb_StaticLibrary_add_cobjects,iOS_kitBridge,\ - ios/source/LibreOfficeKit \ -)) - -$(call gb_StaticLibrary_get_target,ios/iOS_kitBridge): $(call gb_CustomTarget_get_target,ios/iOS_setup) - -# vim: set noet sw=4 ts=4: commit 376ba90ee29bb6da5c3c079575333577aea4fee0 Author: jan Iversen <j...@libreoffice.org> Date: Wed Jan 24 09:00:42 2018 +0100 iOS, corrected directory creation. the setup mk did not always create the needed directories. and corrected typo Change-Id: I58a40a67d91101504b7802a1fc73105df68a4ca4 diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk index 6242354eeebe..b3e7843abba3 100644 --- a/ios/CustomTarget_iOS_setup.mk +++ b/ios/CustomTarget_iOS_setup.mk @@ -5,42 +5,54 @@ # This Source Code Form is subject to the terms of the Mozilla Public # 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/. +# + + #- Env ------------------------------------------------------------------------ -IOSGEN := $(SRCDIR)/ios/generated -IOSRES := $(IOSGEN)/resources +IOSGEN = $(SRCDIR)/ios/generated +IOSRES = $(IOSGEN)/resources +IOSDIRS = $(IOSGEN) \ + $(IOSGEN)/simulator \ + $(IOSGEN)/debug \ + $(IOSGEN)/release \ + $(IOSRES) \ + $(IOSRES)/services \ + $(IOSRES)/program \ + $(IOSRES)/share \ + $(IOSRES)/share/config \ + $(IOSRES)/share/filter \ + $(WORKDIR)/ios #- Top level ----------------------------------------------------------------- $(eval $(call gb_CustomTarget_CustomTarget,ios/iOS_setup)) - - $(call gb_CustomTarget_get_target,ios/iOS_setup): $(IOSGEN)/native-code.h - -#- Generate dynamic files --------------------------------------------------- -$(IOSGEN) $(WORKDIR)/ios: - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),EN1,2) - mkdir -p $(IOSGEN) $(IOSRES) $(IOSRES)/services \ - $(IOSRES)/share/config $(IOSRES)/share/filter $(IOSRES)/program \ - $(IOSGEN)/simulator \ - $(IOSGEN)/debug \ - $(IOSGEN)/release \ - $(WORKDIR)/ios; - +#- create directories -------------------------------------------------------- +$(IOSDIRS): + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MKD,2) + mkdir -p $(IOSDIRS) +#- Generate resources -------------------------------------------------------- $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \ $(SRCDIR)/ios/CustomTarget_iOS_setup.mk \ $(SRCDIR)/solenv/bin/native-code.py \ - $(IOSGEN) $(WORKDIR)/ios + $(IOSGEN) $(WORKDIR)/ios \ + $(IOSDIRS) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),EN2,2) + + # Secure LibreOffice.c get build if there are changes + rm -rf $(WORKDIR)/ios/* + + # generate native-code.h (used by LibreOffice.c) $(SRCDIR)/solenv/bin/native-code.py \ -C -g core -g writer -g calc -g draw -g edit \ > $(IOSGEN)/native-code.h - # generate resource files used to start/run LibreOffice + # copy resource files used to start/run LibreOffice cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt60l.dat $(IOSRES)/icudt60l.dat cp $(INSTDIR)/program/types.rdb $(IOSRES)/udkapi.rdb cp $(INSTDIR)/program/types/offapi.rdb $(IOSRES) @@ -54,13 +66,12 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \ cp $(INSTDIR)/share/filter/vml-shape-types $(IOSRES)/share/filter cp -R $(INSTDIR)/share/registry $(IOSRES)/share - # Set up rc, the "inifile". See getIniFileName_Impl(). + # Set up rc (the "inifile", fundamentalrc, unorc, bootstraprc and versionrc. (echo '[Bootstrap]' \ && echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' \ && echo 'HOME=$$SYSUSERHOME' \ ) > $(IOSRES)/rc - # Set up fundamentalrc, unorc, bootstraprc and versionrc. (echo '[Bootstrap]' \ && echo 'BRAND_BASE_DIR=file://$$APP_DATA_DIR' \ && echo 'BRAND_INI_DIR=file:://$$APP_DATA_DIR' \ @@ -92,12 +103,10 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \ ) > $(IOSRES)/program/versionrc - #- clean ios ----------------------------------------------------------------- $(call gb_CustomTarget_get_clean_target,ios/iOS_setup): $(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),ENV,2) - echo $(call gb_StaticLibrary_get_target,iOS_kitBridge) - rm -rf $(IOSRES) $(IOSGEN)/native-code.h $(IOSGEN)/build + rm -rf $(IOSRES)/* $(IOSGEN)/native-code.h $(IOSGEN)/build rm -rf $(WORKDIR)/ios ifeq ($(ENABLE_DEBUG),TRUE) ifeq ($(CPUNAME),X86_64) @@ -111,6 +120,4 @@ ifeq ($(CPUNAME),ARM64) endif endif - - # vim: set noet sw=4 ts=4: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits