1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
gb_CPUDEFS := -DARM32
ifeq ($(CC),)
$(error You must set CC in the environment. See README.cross for example.)
endif
ifeq ($(CXX),)
$(error You must set CXX in the environment. See README.cross for example.)
endif
include $(GBUILDDIR)/platform/com_GCC_defs.mk
# Darwin mktemp -t expects a prefix, not a pattern
gb_MKTEMP := /usr/bin/mktemp -t gbuild.
gb_OSDEFS := \
-D$(OS) \
-D_PTHREADS \
-DUNIX \
-DUNX \
-D_REENTRANT \
-DNO_PTHREAD_PRIORITY \
$(EXTRA_CDEFS) \
gb_CFLAGS := \
$(gb_CFLAGS_COMMON) \
-Wshadow \
-fno-strict-aliasing \
# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev@openoffice.org from
# Feb 1, 2006:
gb_CXXFLAGS := \
$(gb_CXXFLAGS_COMMON) \
-Wno-ctor-dtor-privacy \
-Wno-non-virtual-dtor \
-fno-strict-aliasing \
-fsigned-char
# No idea if -malign-natural is needed, but macosx.mk uses it...
# Why it isn't used in gb_CFLAGS I have no idea.
# Anyway, Clang doesn't have this option.
ifneq ($(COM_GCC_IS_CLANG),TRUE)
gb_CXXFLAGS += \
-malign-natural
endif
# these are to get gcc to switch to Objective-C++ or Objective-C mode
gb_OBJC_OBJCXX_COMMON_FLAGS := -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300
gb_OBJCXXFLAGS := -x objective-c++ $(gb_OBJC_OBJCXX_COMMON_FLAGS)
gb_OBJCFLAGS := -x objective-c $(gb_OBJC_OBJCXX_COMMON_FLAGS)
gb_COMPILERDEFS += \
-DBOOST_DETAIL_NO_CONTAINER_FWD
gb_LinkTarget_LDFLAGS := \
$(subst -L../lib , ,$(SOLARLIB)) \
#man ld says: obsolete -Wl,-multiply_defined,suppress \
gb_DEBUG_CFLAGS := -g -fno-inline
# ObjCxxObject class
define gb_ObjCxxObject__command
$(call gb_Output_announce,$(2).mm,$(true),OCX,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
$(gb_CXX) \
$(DEFS) \
$(T_OBJCXXFLAGS) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
-c $(3) \
-o $(1) \
-MMD -MT $(1) \
-MP -MF $(4) \
-I$(dir $(3)) \
$(INCLUDE))
endef
# ObjCObject class
define gb_ObjCObject__command
$(call gb_Output_announce,$(2).m,$(true),OCC,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
mkdir -p $(dir $(call gb_ObjCObject_get_dep_target,$(2))) && \
$(gb_CC) \
$(DEFS) $(OBJCFLAGS) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
-c $(3) \
-o $(1) \
-MMD -MT $(call gb_ObjCObject_get_target,$(2)) \
-MP -MF $(call gb_ObjCObject_get_dep_target,$(2)) \
-I$(dir $(3)) \
$(INCLUDE))
endef
# LinkTarget class
gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS)
gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS)
ifeq ($(gb_SYMBOL),$(true))
gb_LinkTarget_CFLAGS += $(gb_DEBUG_CFLAGS)
gb_LinkTarget_CXXFLAGS += $(gb_DEBUG_CFLAGS)
gb_LinkTarget_OBJCXXFLAGS += $(gb_DEBUG_CFLAGS)
gb_LinkTarget_OBJCFLAGS += $(gb_DEBUG_CFLAGS)
endif
define gb_LinkTarget__get_liblinkflags
$(patsubst lib%.a,-l%,$(foreach lib,$(filter-out $(gb_Library_UNOLIBS_OOO),$(1)),$(call gb_Library_get_filename,$(lib)))) \
$(foreach lib,$(filter $(gb_Library_UNOLIBS_OOO),$(1)),$(SOLARVER)/$(INPATH)/lib/$(lib)$(gb_Library_UNOEXT))
endef
define gb_LinkTarget__get_layer
$(if $(filter Executable,$(1)),\
$$(call gb_Executable_get_layer,$(2)),\
$$(call gb_Library_get_layer,$(2)))
endef
define gb_LinkTarget__command_dynamiclink
$(if $(filter Library CppunitTest,$(TARGETTYPE)),@echo No dynamic libraries should be built for iOS && exit 1, \
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
$(gb_Executable_TARGETTYPEFLAGS) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \
$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
$(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
$(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
$(LIBS) \
-o $(1))
endef
# parameters: 1-linktarget 2-cobjects 3-cxxobjects
define gb_LinkTarget__command_staticlink
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
rm -f $(1) && \
$(gb_AR) -rsu $(1) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \
$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \
$(if $(findstring s,$(MAKEFLAGS)),2> /dev/null))
endef
define gb_LinkTarget__command
$(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_LinkTarget__command_staticlink,$(1))
endef
define gb_LinkTarget_use_system_darwin_frameworks
$(call gb_LinkTarget_add_libs,$(1),$(foreach fw,$(2),-framework $(fw)))
endef
# Library class
gb_Library_DEFS :=
gb_Library_SYSPRE := lib
gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
gb_Library_PLAINEXT := .a
gb_Library_DLLEXT := .a
gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \
gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
$(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \
define gb_Library_Library_platform
$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1))
endef
# StaticLibrary class
gb_StaticLibrary_SYSPRE := lib
gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_FILENAMES := \
$(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
gb_StaticLibrary_StaticLibrary_platform =
# Executable class
gb_Executable_EXT := .a
gb_Executable_TARGETTYPEFLAGS :=
gb_Executable_LAYER := \
$(foreach exe,$(gb_Executable_UREBIN),$(exe):OOO) \
$(foreach exe,$(gb_Executable_SDK),$(exe):OOO) \
$(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
$(foreach exe,$(gb_Executable_NONE),$(exe):OOO) \
define gb_Executable_Executable_platform
$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Executable_get_layer,$(1))
endef
# CppunitTest class
gb_CppunitTest_CPPTESTPRECOMMAND := :
gb_CppunitTest_SYSPRE := libtest_
gb_CppunitTest_EXT := .a
gb_CppunitTest_LIBDIR := $(gb_Helper_OUTDIRLIBDIR)
gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT)
gb_CppunitTest_get_libfilename = $(gb_CppunitTest_get_filename)
define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE
endef
# InstallModuleTarget class
define gb_InstallModuleTarget_InstallModuleTarget_platform
$(call gb_InstallModuleTarget_add_defs,$(1),\
$(gb_CPUDEFS) \
$(gb_OSDEFS) \
-DCOMID=gcc3 \
-DCOMNAME=gcc3 \
-D_gcc3 \
$(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \
)
endef
# ScpConvertTarget class
gb_ScpConvertTarget_ScpConvertTarget_platform :=
# InstallScript class
gb_InstallScript_EXT := .ins
# CliAssemblyTarget class
gb_CliAssemblyTarget_POLICYEXT :=
gb_CliAssemblyTarget_get_dll :=
# ExtensionTarget class
gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE
# UnpackedTarget class
gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION)
# UnoApiHeadersTarget class
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
else
gb_UnoApiHeadersTarget_select_variant = $(2)
endif
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
include $(GBUILDDIR)/platform/com_GCC_class.mk
# vim: set noet sw=4:
|