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/.
10 $(eval
$(call gb_Library_Library
,$(gb_CPPU_ENV
)_uno
))
14 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
15 bridges_SELECTED_BRIDGE
:= gcc3_linux_arm
16 bridge_noopt_objects
:= cpp2uno except uno2cpp
18 $(call gb_LinkTarget_get_target
,$(call gb_Library_get_linktarget
,gcc3_uno
)) : \
19 $(call gb_CustomTarget_get_workdir
,bridges
/source
/cpp_uno
/gcc3_linux_arm
)/armhelper.objectlist
20 $(call gb_LinkTarget_get_target
,$(call gb_Library_get_linktarget
,gcc3_uno
)) : \
21 EXTRAOBJECTLISTS
+= $(call gb_CustomTarget_get_workdir
,bridges
/source
/cpp_uno
/gcc3_linux_arm
)/armhelper.objectlist
24 else ifeq ($(CPUNAME
),ARM64
)
26 bridges_SELECTED_BRIDGE
:= msvc_win32_arm64
27 bridge_exception_objects
:= cpp2uno uno2cpp abi
28 bridge_noopt_objects
:= except
29 bridge_asm_objects
:= callvirtualfunction vtableslotcall
31 else ifeq ($(CPUNAME
),AARCH64
)
33 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX MACOSX NETBSD OPENBSD
,$(OS
)),)
34 bridges_SELECTED_BRIDGE
:= gcc3_linux_aarch64
35 bridge_asm_objects
:= vtableslotcall
36 bridge_exception_objects
:= abi cpp2uno uno2cpp
38 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
, \
39 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/callvirtualfunction
, \
40 $(if
$(HAVE_GCC_STACK_CLASH_PROTECTION
),-fno-stack-clash-protection
) \
41 $(if
$(COM_IS_CLANG
),-fasynchronous-unwind-tables
) \
45 bridges_SELECTED_BRIDGE
:= gcc3_ios
46 bridge_noopt_objects
:= cpp2uno except uno2cpp
47 bridge_asm_objects
:= ios64_helper
51 else ifeq ($(CPUNAME
),AXP
)
53 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
54 bridges_SELECTED_BRIDGE
:= gcc3_linux_alpha
55 bridge_exception_objects
:= cpp2uno except uno2cpp
58 else ifeq ($(CPUNAME
),HPPA
)
60 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
61 bridges_SELECTED_BRIDGE
:= gcc3_linux_hppa
62 bridge_noopt_objects
:= call cpp2uno except uno2cpp
65 else ifeq ($(CPUNAME
),IA64
)
67 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
68 bridges_SELECTED_BRIDGE
:= gcc3_linux_ia64
69 bridge_asm_objects
:= call
70 bridge_exception_objects
:= except
71 bridge_noopt_objects
:= cpp2uno uno2cpp
74 else ifeq ($(CPUNAME
),INTEL
)
76 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU
,$(OS
)),)
77 bridges_SELECTED_BRIDGE
:= gcc3_linux_intel
78 bridge_asm_objects
:= call
79 bridge_exception_objects
:= cpp2uno except uno2cpp
80 bridge_noncallexception_objects
:= callvirtualmethod
81 else ifeq ($(OS
),SOLARIS
)
82 bridges_SELECTED_BRIDGE
:= gcc3_solaris_intel
83 bridge_exception_objects
:= cpp2uno except uno2cpp
84 bridge_noncallexception_objects
:= callvirtualmethod
85 else ifeq ($(COM
),MSC
)
86 bridges_SELECTED_BRIDGE
:= msvc_win32_intel
87 bridge_exception_objects
:= cpp2uno uno2cpp
88 bridge_noopt_objects
:= except
91 else ifeq ($(CPUNAME
),M68K
)
93 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
94 bridges_SELECTED_BRIDGE
:= gcc3_linux_m68k
95 bridge_noopt_objects
:= cpp2uno except uno2cpp
98 else ifeq ($(CPUNAME
),GODSON
)
100 ifneq ($(filter LINUX
,$(OS
)),)
101 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips
102 bridge_noopt_objects
:= cpp2uno uno2cpp
103 bridge_exception_objects
:= except
106 else ifeq ($(CPUNAME
),GODSON64
)
108 ifneq ($(filter LINUX
,$(OS
)),)
109 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips64
110 bridge_asm_objects
:= call
111 bridge_noopt_objects
:= cpp2uno uno2cpp
112 bridge_exception_objects
:= except
115 else ifeq ($(CPUNAME
),POWERPC
)
117 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
118 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc
119 bridge_noopt_objects
:= uno2cpp
120 bridge_exception_objects
:= cpp2uno except
121 else ifeq ($(OS
),AIX
)
122 bridges_SELECTED_BRIDGE
:= gcc3_aix_powerpc
123 bridge_exception_objects
:= except
124 bridge_cxx_objects
:= cpp2uno uno2cpp
127 else ifeq ($(CPUNAME
),POWERPC64
)
129 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
130 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc64
131 bridge_noopt_objects
:= cpp2uno uno2cpp
132 bridge_exception_objects
:= except
135 else ifeq ($(CPUNAME
),S390
)
137 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
138 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390
139 bridge_exception_objects
:= cpp2uno except uno2cpp
142 else ifeq ($(CPUNAME
),S390X
)
144 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
145 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390x
146 bridge_exception_objects
:= cpp2uno except uno2cpp
149 else ifeq ($(CPUNAME
),SPARC
)
151 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
152 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc
153 bridge_asm_objects
:= call
154 bridge_noopt_objects
:= except
155 bridge_exception_objects
:= cpp2uno uno2cpp
156 else ifeq ($(OS
),SOLARIS
)
157 bridges_SELECTED_BRIDGE
:= gcc3_solaris_sparc
158 bridge_noopt_objects
:= cpp2uno uno2cpp
159 bridge_exception_objects
:= except
162 else ifeq ($(OS
)-$(CPUNAME
),LINUX-SPARC64
)
164 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc64
165 bridge_asm_objects
:= call
166 bridge_noopt_objects
:= cpp2uno uno2cpp
167 bridge_exception_objects
:= except
169 else ifeq ($(CPUNAME
),X86_64
)
171 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU
,$(OS
)),)
172 bridges_SELECTED_BRIDGE
:= gcc3_linux_x86-64
173 bridge_asm_objects
:= call
174 bridge_noncallexception_noopt_objects
:= callvirtualmethod
175 bridge_exception_objects
:= abi cpp2uno except rtti uno2cpp
176 else ifneq ($(filter MACOSX iOS
,$(OS
)),)
177 bridges_SELECTED_BRIDGE
:= gcc3_macosx_x86-64
178 bridge_exception_objects
:= abi call cpp2uno except uno2cpp
179 bridge_noncallexception_noopt_objects
:= callvirtualmethod
180 else ifeq ($(COM
),MSC
)
181 bridges_SELECTED_BRIDGE
:= msvc_win32_x86-64
182 bridge_exception_objects
:= cpp2uno uno2cpp
183 bridge_noopt_objects
:= except
184 bridge_asm_objects
:= call
189 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(gb_CPPU_ENV
)_uno
,\
194 ifeq ($(CPUNAME
),AARCH64
)
195 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(gb_CPPU_ENV
)_uno
,\
201 $(eval
$(call gb_Library_set_include
,$(gb_CPPU_ENV
)_uno
,\
202 -I
$(SRCDIR
)/bridges
/inc \
206 ifeq ($(HAVE_POSIX_FALLOCATE
),YES
)
207 $(eval
$(call gb_Library_add_defs
,$(gb_CPPU_ENV
)_uno
,\
208 -DHAVE_POSIX_FALLOCATE \
212 # In case someone enabled the non-standard -fomit-frame-pointer which does not
213 # work with the .cxx sources of this library.
214 # LTO causes crashes when enabled for this library
215 # In case the compiler supports AVX this code segfaults so specifically turn
218 $(eval
$(call gb_Library_add_cxxflags
,gcc3_uno
,\
219 $(if
$(filter armeabi-v7a
,$(ANDROID_APP_ABI
)),-I
$(ANDROID_BINUTILS_PREBUILT_ROOT
)/lib
/gcc
/arm-linux-androideabi
/4.9.x
/include) \
220 -fno-omit-frame-pointer \
221 -fno-strict-aliasing \
223 $(if
$(filter TRUE
,$(HAVE_GCC_AVX
)),-mno-avx
) \
226 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX iOS HAIKU
,$(OS
)),)
227 $(eval
$(call gb_Library_add_libs
,gcc3_uno
,\
234 ifneq ($(COM_IS_CLANG
),TRUE
)
235 bridges_NON_CALL_EXCEPTIONS_FLAGS
:= -fnon-call-exceptions
239 $(eval
$(call gb_Library_use_libraries
,$(gb_CPPU_ENV
)_uno
,\
244 $(foreach obj
,$(bridge_exception_objects
),\
245 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
246 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
248 $(foreach obj
,$(bridge_noncallexception_objects
),\
249 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
250 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
251 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) )) \
253 $(foreach obj
,$(bridge_noopt_objects
),\
254 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
255 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
256 , $(gb_COMPILERNOOPTFLAGS
))) \
258 $(foreach obj
,$(bridge_noncallexception_noopt_objects
),\
259 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
260 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
261 , $(gb_COMPILERNOOPTFLAGS
) $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) )) \
263 $(foreach obj
,$(bridge_cxx_objects
),\
264 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
265 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
267 $(foreach obj
,$(bridge_asm_objects
),\
268 $(eval
$(call gb_Library_add_asmobjects
,$(gb_CPPU_ENV
)_uno
,\
269 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
272 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
273 bridges
/source
/cpp_uno
/shared
/bridge \
274 bridges
/source
/cpp_uno
/shared
/component \
275 bridges
/source
/cpp_uno
/shared
/types \
276 bridges
/source
/cpp_uno
/shared
/unointerfaceproxy \
277 bridges
/source
/cpp_uno
/shared
/vtablefactory \
278 bridges
/source
/cpp_uno
/shared
/vtables \
282 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
283 bridges
/source
/cpp_uno
/msvc_shared
/cpp2uno \
284 bridges
/source
/cpp_uno
/msvc_shared
/except \
288 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
289 bridges
/source
/cpp_uno
/shared
/cppinterfaceproxy \
290 , $(gb_COMPILERNOOPTFLAGS
) $(gb_LinkTarget_EXCEPTIONFLAGS
) \
293 # vim: set noet sw=4 ts=4: