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
),AARCH64
)
26 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX MACOSX NETBSD OPENBSD
,$(OS
)),)
27 bridges_SELECTED_BRIDGE
:= gcc3_linux_aarch64
28 bridge_asm_objects
:= vtableslotcall
29 bridge_exception_objects
:= abi cpp2uno uno2cpp
31 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
, \
32 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/callvirtualfunction
, \
33 $(if
$(HAVE_GCC_STACK_CLASH_PROTECTION
),-fno-stack-clash-protection
) \
37 bridges_SELECTED_BRIDGE
:= gcc3_ios
38 bridge_noopt_objects
:= cpp2uno except uno2cpp
39 bridge_asm_objects
:= ios64_helper
43 else ifeq ($(CPUNAME
),AXP
)
45 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
46 bridges_SELECTED_BRIDGE
:= gcc3_linux_alpha
47 bridge_exception_objects
:= cpp2uno except uno2cpp
50 else ifeq ($(CPUNAME
),HPPA
)
52 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
53 bridges_SELECTED_BRIDGE
:= gcc3_linux_hppa
54 bridge_noopt_objects
:= call cpp2uno except uno2cpp
57 else ifeq ($(CPUNAME
),IA64
)
59 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
60 bridges_SELECTED_BRIDGE
:= gcc3_linux_ia64
61 bridge_asm_objects
:= call
62 bridge_exception_objects
:= except
63 bridge_noopt_objects
:= cpp2uno uno2cpp
66 else ifeq ($(CPUNAME
),INTEL
)
68 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU
,$(OS
)),)
69 bridges_SELECTED_BRIDGE
:= gcc3_linux_intel
70 bridge_asm_objects
:= call
71 bridge_exception_objects
:= cpp2uno except uno2cpp
72 bridge_noncallexception_objects
:= callvirtualmethod
73 else ifeq ($(OS
),SOLARIS
)
74 bridges_SELECTED_BRIDGE
:= gcc3_solaris_intel
75 bridge_exception_objects
:= cpp2uno except uno2cpp
76 bridge_noncallexception_objects
:= callvirtualmethod
77 else ifeq ($(COM
),MSC
)
78 bridges_SELECTED_BRIDGE
:= msvc_win32_intel
79 bridge_exception_objects
:= cpp2uno dllinit uno2cpp
80 bridge_noopt_objects
:= except
83 else ifeq ($(CPUNAME
),M68K
)
85 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
86 bridges_SELECTED_BRIDGE
:= gcc3_linux_m68k
87 bridge_noopt_objects
:= cpp2uno except uno2cpp
90 else ifeq ($(CPUNAME
),GODSON
)
92 ifneq ($(filter LINUX
,$(OS
)),)
93 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips
94 bridge_noopt_objects
:= cpp2uno uno2cpp
95 bridge_exception_objects
:= except
98 else ifeq ($(CPUNAME
),GODSON64
)
100 ifneq ($(filter LINUX
,$(OS
)),)
101 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips64
102 bridge_asm_objects
:= call
103 bridge_noopt_objects
:= cpp2uno uno2cpp
104 bridge_exception_objects
:= except
107 else ifeq ($(CPUNAME
),POWERPC
)
109 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
110 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc
111 bridge_noopt_objects
:= uno2cpp
112 bridge_exception_objects
:= cpp2uno except
113 else ifeq ($(OS
),AIX
)
114 bridges_SELECTED_BRIDGE
:= gcc3_aix_powerpc
115 bridge_exception_objects
:= except
116 bridge_cxx_objects
:= cpp2uno uno2cpp
119 else ifeq ($(CPUNAME
),POWERPC64
)
121 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
122 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc64
123 bridge_noopt_objects
:= cpp2uno uno2cpp
124 bridge_exception_objects
:= except
127 else ifeq ($(CPUNAME
),S390
)
129 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
130 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390
131 bridge_exception_objects
:= cpp2uno except uno2cpp
134 else ifeq ($(CPUNAME
),S390X
)
136 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
137 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390x
138 bridge_exception_objects
:= cpp2uno except uno2cpp
141 else ifeq ($(CPUNAME
),SPARC
)
143 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
144 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc
145 bridge_asm_objects
:= call
146 bridge_noopt_objects
:= except
147 bridge_exception_objects
:= cpp2uno uno2cpp
148 else ifeq ($(OS
),SOLARIS
)
149 bridges_SELECTED_BRIDGE
:= gcc3_solaris_sparc
150 bridge_noopt_objects
:= cpp2uno uno2cpp
151 bridge_exception_objects
:= except
154 else ifeq ($(OS
)-$(CPUNAME
),LINUX-SPARC64
)
156 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc64
157 bridge_asm_objects
:= call
158 bridge_noopt_objects
:= cpp2uno uno2cpp
159 bridge_exception_objects
:= except
161 else ifeq ($(CPUNAME
),X86_64
)
163 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU
,$(OS
)),)
164 bridges_SELECTED_BRIDGE
:= gcc3_linux_x86-64
165 bridge_asm_objects
:= call
166 bridge_noncallexception_noopt_objects
:= callvirtualmethod
167 bridge_exception_objects
:= abi cpp2uno except rtti uno2cpp
168 else ifneq ($(filter MACOSX iOS
,$(OS
)),)
169 bridges_SELECTED_BRIDGE
:= gcc3_macosx_x86-64
170 bridge_exception_objects
:= abi call cpp2uno except uno2cpp
171 bridge_noncallexception_noopt_objects
:= callvirtualmethod
172 else ifeq ($(COM
),MSC
)
173 bridges_SELECTED_BRIDGE
:= msvc_win32_x86-64
174 bridge_exception_objects
:= cpp2uno dllinit uno2cpp
175 bridge_noopt_objects
:= except
176 bridge_asm_objects
:= call
181 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(gb_CPPU_ENV
)_uno
,\
186 ifeq ($(CPUNAME
),AARCH64
)
187 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(gb_CPPU_ENV
)_uno
,\
193 $(eval
$(call gb_Library_set_include
,$(gb_CPPU_ENV
)_uno
,\
194 -I
$(SRCDIR
)/bridges
/inc \
198 ifeq ($(HAVE_POSIX_FALLOCATE
),YES
)
199 $(eval
$(call gb_Library_add_defs
,$(gb_CPPU_ENV
)_uno
,\
200 -DHAVE_POSIX_FALLOCATE \
204 # In case someone enabled the non-standard -fomit-frame-pointer which does not
205 # work with the .cxx sources of this library.
206 # LTO causes crashes when enabled for this library
207 # In case the compiler supports AVX this code segfaults so specifically turn
210 $(eval
$(call gb_Library_add_cxxflags
,gcc3_uno
,\
211 $(if
$(filter armeabi-v7a
,$(ANDROID_APP_ABI
)),-I
$(ANDROID_BINUTILS_PREBUILT_ROOT
)/lib
/gcc
/arm-linux-androideabi
/4.9.x
/include) \
212 -fno-omit-frame-pointer \
213 -fno-strict-aliasing \
214 $(if
$(filter TRUE
,$(ENABLE_LTO
)),-fno-lto
) \
215 $(if
$(filter TRUE
,$(HAVE_GCC_AVX
)),-mno-avx
) \
218 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX iOS HAIKU
,$(OS
)),)
219 $(eval
$(call gb_Library_add_libs
,gcc3_uno
,\
226 ifneq ($(COM_IS_CLANG
),TRUE
)
227 bridges_NON_CALL_EXCEPTIONS_FLAGS
:= -fnon-call-exceptions
231 $(eval
$(call gb_Library_use_libraries
,$(gb_CPPU_ENV
)_uno
,\
236 $(foreach obj
,$(bridge_exception_objects
),\
237 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
238 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
240 $(foreach obj
,$(bridge_noncallexception_objects
),\
241 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
242 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
243 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) )) \
245 $(foreach obj
,$(bridge_noopt_objects
),\
246 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
247 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
248 , $(gb_COMPILERNOOPTFLAGS
))) \
250 $(foreach obj
,$(bridge_noncallexception_noopt_objects
),\
251 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
252 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
253 , $(gb_COMPILERNOOPTFLAGS
) $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) )) \
255 $(foreach obj
,$(bridge_cxx_objects
),\
256 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
257 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
259 $(foreach obj
,$(bridge_asm_objects
),\
260 $(eval
$(call gb_Library_add_asmobjects
,$(gb_CPPU_ENV
)_uno
,\
261 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
264 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
265 bridges
/source
/cpp_uno
/shared
/bridge \
266 bridges
/source
/cpp_uno
/shared
/component \
267 bridges
/source
/cpp_uno
/shared
/types \
268 bridges
/source
/cpp_uno
/shared
/unointerfaceproxy \
269 bridges
/source
/cpp_uno
/shared
/vtablefactory \
270 bridges
/source
/cpp_uno
/shared
/vtables \
273 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
274 bridges
/source
/cpp_uno
/shared
/cppinterfaceproxy \
275 , $(gb_COMPILERNOOPTFLAGS
) $(gb_LinkTarget_EXCEPTIONFLAGS
) \
278 # vim: set noet sw=4 ts=4: