bump product version to 7.6.3.2-android
[LibreOffice.git] / solenv / gbuild / platform / iOS.mk
blob15f1ce4ef4ace9f6ac4ce7f452ab59cd5873df1a
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 ifeq ($(CC),)
21 $(error You must set CC in the environment. See README.cross for example.)
22 endif
23 ifeq ($(CXX),)
24 $(error You must set CXX in the environment. See README.cross for example.)
25 endif
27 gb_COMPILEROPTFLAGS := -O2
29 include $(GBUILDDIR)/platform/com_GCC_defs.mk
31 # Use standard lldb debugger
32 gb_DEBUGINFO_FLAGS=-g
33 gb_LINKER_DEBUGINFO_FLAGS=
35 # Darwin mktemp -t expects a prefix, not a pattern
36 gb_MKTEMP := /usr/bin/mktemp -t gbuild.
38 gb_OSDEFS := \
39 -DIOS \
40 -D_PTHREADS \
41 -DUNIX \
42 -DUNX \
43 -D_REENTRANT \
44 -DNO_PTHREAD_PRIORITY \
45 $(LFS_CFLAGS) \
47 gb_CFLAGS := \
48 $(gb_CFLAGS_COMMON) \
49 -Wshadow \
50 -fno-strict-aliasing \
52 gb_CXXFLAGS := \
53 $(gb_CXXFLAGS_COMMON) \
54 -Wno-ctor-dtor-privacy \
55 -fno-strict-aliasing \
56 -fsigned-char \
57 $(CXXFLAGS_CXX11) \
59 # These are to get the compiler to switch to Objective-C++ or Objective-C mode
60 gb_OBJCXXFLAGS := -x objective-c++
61 gb_OBJCFLAGS := -x objective-c
63 gb_COMPILERDEFS += \
64 -DBOOST_DETAIL_NO_CONTAINER_FWD
66 # LinkTarget class
68 gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
69 gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
70 gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS)
71 gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS)
73 define gb_LinkTarget__get_liblinkflags
74 $(patsubst lib%.a,-l%,$(foreach lib,$(1),$(call gb_Library_get_filename,$(lib))))
75 endef
77 define gb_LinkTarget__get_layer
78 $(if $(filter Executable,$(1)),\
79 $$(call gb_Executable_get_layer,$(2)),\
80 $$(call gb_Library_get_layer,$(2)))
81 endef
83 # To not export anything: -Wl$(COMMA)-exported_symbols_list$(COMMA)/dev/null
84 # But for some reason that slows down ld significantly.
86 define gb_LinkTarget__command_dynamiclink
87 $(if $(filter Library CppunitTest,$(TARGETTYPE)),@echo No dynamic libraries should be built for iOS && exit 1, \
88 $(if $(CXXOBJECTS)$(OBJCXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \
89 $(gb_Executable_TARGETTYPEFLAGS) \
90 $(subst \d,$$,$(RPATH)) \
91 $(T_USE_LD) $(T_LDFLAGS) \
92 -dead_strip \
93 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
94 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
95 $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
96 $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \
97 $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
98 $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
99 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
100 $(foreach object,$(GENNASMOBJECTS),$(call gb_GenNasmObject_get_target,$(object))) \
101 $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
102 $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
103 $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
104 $(shell $(SRCDIR)/bin/lo-all-static-libs) \
105 $(T_LIBS) \
106 -o $(1))
107 endef
109 # parameters: 1-linktarget 2-cobjects 3-cxxobjects
110 define gb_LinkTarget__command_staticlink
111 $(call gb_Helper_abbreviate_dirs,\
112 rm -f $(1) && \
113 $(gb_AR) -rsu $(1) \
114 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
115 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
116 $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \
117 $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
118 $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
119 $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
120 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
121 $(foreach object,$(GENNASMOBJECTS),$(call gb_GenNasmObject_get_target,$(object))) \
122 $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \
123 $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null))
124 endef
126 define gb_LinkTarget__command
127 $(call gb_Output_announce,$(2),$(true),LNK,4)
128 $(call gb_Trace_StartRange,$(2),LNK)
129 $(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2)))
130 $(if $(filter CppunitTest Library StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
131 $(call gb_Trace_EndRange,$(2),LNK)
132 endef
134 define gb_LinkTarget_use_system_darwin_frameworks
135 $(call gb_LinkTarget_add_libs,$(1),$(foreach fw,$(2),-framework $(fw)))
136 $(if $(call gb_LinkTarget__is_merged,$(1)),\
137 $(call gb_LinkTarget_add_libs,$(call gb_Library_get_linktarget,merged),$(foreach fw,$(2),-framework $(fw))))
138 endef
141 # Library class
143 gb_Library_DEFS :=
144 gb_Library_SYSPRE := lib
145 gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
146 gb_Library_PLAINEXT := .a
147 gb_Library_PLAINEXT_FOR_BUILD := .dylib
148 gb_Library_DLLEXT := .a
149 gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
151 gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
152 gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
154 gb_Library_FILENAMES := \
155 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
156 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
157 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
158 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
159 $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
160 $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
161 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
162 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
163 $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \
166 gb_Library_LAYER := \
167 $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
168 $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
169 $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
170 $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
171 $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
172 $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):OOO) \
173 $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
174 $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
175 $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \
177 define gb_Library_Library_platform
178 $(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1))
180 endef
182 gb_Library__set_soversion_script_platform =
184 gb_Library_get_sdk_link_dir = $(WORKDIR)/LinkTarget/Library
186 # Executable class
188 gb_Executable_EXT :=
189 gb_Executable_TARGETTYPEFLAGS :=
191 gb_Executable_LAYER := \
192 $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
193 $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
194 $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
195 $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \
198 define gb_Executable_Executable_platform
199 $(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Executable_get_layer,$(1))
201 endef
204 # CppunitTest class
206 gb_CppunitTest_CPPTESTPRECOMMAND := :
207 gb_CppunitTest_get_filename = libtest_(1).a
208 gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename)
210 define gb_CppunitTest_CppunitTest_platform
211 $(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE
213 endef
215 # InstallModuleTarget class
217 define gb_InstallModuleTarget_InstallModuleTarget_platform
218 $(call gb_InstallModuleTarget_add_defs,$(1),\
219 $(gb_CPUDEFS) \
220 $(gb_OSDEFS) \
221 -DCOMID=gcc3 \
222 -D_gcc3 \
225 endef
227 # InstallScript class
229 gb_InstallScript_EXT := .ins
231 # CliAssemblyTarget class
233 gb_CliAssemblyTarget_POLICYEXT :=
234 gb_CliAssemblyTarget_get_dll :=
236 # Extension class
238 gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE
240 # UnpackedTarget class
242 gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
244 # UnoApiHeadersTarget class
246 ifeq ($(DISABLE_DYNLOADING),TRUE)
247 gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
248 else
249 gb_UnoApiHeadersTarget_select_variant = $(2)
250 endif
252 # UIMenubarTarget class
254 define gb_UIMenubarTarget__command
255 $(call gb_Output_announce,$(2),$(true),UIM,1)
256 $(call gb_Trace_StartRange,$(2),UIM)
257 cp $(3) $(1)
258 $(call gb_Trace_EndRange,$(2),UIM)
260 endef
262 gb_UIMenubarTarget_UIMenubarTarget_platform :=
264 # Python
265 gb_PYTHON_PRECOMMAND :=
267 include $(GBUILDDIR)/platform/com_GCC_class.mk
269 # vim: set noet sw=4: