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
))
12 ifeq ($(OS
)-$(CPUNAME
),AIX-POWERPC
)
14 bridges_SELECTED_BRIDGE
:= gcc3_aix_powerpc
15 bridge_exception_objects
:= except
16 bridge_cxx_objects
:= cpp2uno uno2cpp
18 else ifeq ($(CPUNAME
),ARM
)
21 $(eval
$(call gb_Library_use_sdk_api
,gcc3_uno
))
22 bridges_SELECTED_BRIDGE
:= gcc3_ios_arm
23 bridge_asm_objects
:= helper
24 bridge_exception_objects
:= cpp2uno cpp2uno-arm cpp2uno-arm64 cpp2uno-i386 except uno2cpp uno2cpp-arm uno2cpp-arm64 uno2cpp-i386
25 $(eval
$(call gb_Library_use_custom_headers
,gcc3_uno
,\
26 bridges
/source
/cpp_uno
/gcc3_ios_arm \
28 else ifneq ($(filter LINUX ANDROID
,$(OS
)),)
29 bridges_SELECTED_BRIDGE
:= gcc3_linux_arm
30 bridge_noopt_objects
:= cpp2uno except uno2cpp
32 $(call gb_LinkTarget_get_target
,$(call gb_Library_get_linktarget
,gcc3_uno
)) : \
33 $(call gb_CustomTarget_get_workdir
,bridges
/source
/cpp_uno
/gcc3_linux_arm
)/armhelper.objectlist
34 $(call gb_LinkTarget_get_target
,$(call gb_Library_get_linktarget
,gcc3_uno
)) : \
35 EXTRAOBJECTLISTS
+= $(call gb_CustomTarget_get_workdir
,bridges
/source
/cpp_uno
/gcc3_linux_arm
)/armhelper.objectlist
38 else ifneq (,$(filter ANDROID-AARCH64 LINUX-AARCH64
,$(OS
)-$(CPUNAME
)))
40 bridges_SELECTED_BRIDGE
:= gcc3_linux_aarch64
41 bridge_exception_objects
:= abi callvirtualfunction uno2cpp
43 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
, \
44 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/cpp2uno
, \
45 $(subst -fstack-protector-strong
,-fstack-protector
, \
46 $(gb_LinkTarget_EXCEPTIONFLAGS
) \
47 $(call gb_LinkTarget__get_cxxflags
,$(gb_CPPU_ENV
)_uno
)) \
50 else ifeq ($(OS
)-$(CPUNAME
),LINUX-AXP
)
52 bridges_SELECTED_BRIDGE
:= gcc3_linux_alpha
53 bridge_exception_objects
:= cpp2uno except uno2cpp
55 else ifeq ($(OS
)-$(CPUNAME
),LINUX-HPPA
)
57 bridges_SELECTED_BRIDGE
:= gcc3_linux_hppa
58 bridge_noopt_objects
:= call cpp2uno except uno2cpp
60 else ifeq ($(OS
)-$(CPUNAME
),LINUX-IA64
)
62 bridges_SELECTED_BRIDGE
:= gcc3_linux_ia64
63 bridge_asm_objects
:= call
64 bridge_exception_objects
:= except
65 bridge_noopt_objects
:= cpp2uno uno2cpp
67 else ifeq ($(CPUNAME
),INTEL
)
69 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
70 bridges_SELECTED_BRIDGE
:= gcc3_linux_intel
71 bridge_asm_objects
:= call
72 bridge_exception_objects
:= cpp2uno except uno2cpp
73 bridge_noncallexception_objects
:= callvirtualmethod
74 else ifeq ($(OS
),SOLARIS
)
75 bridges_SELECTED_BRIDGE
:= gcc3_solaris_intel
76 bridge_exception_objects
:= cpp2uno except uno2cpp
77 bridge_noncallexception_objects
:= callvirtualmethod
78 else ifeq ($(COM
),MSC
)
79 bridges_SELECTED_BRIDGE
:= msvc_win32_intel
80 bridge_exception_objects
:= cpp2uno dllinit uno2cpp
81 bridge_noopt_objects
:= except
82 else ifeq ($(OS
)$(COM
),WNTGCC
)
83 bridges_SELECTED_BRIDGE
:= mingw_intel
84 bridge_asm_objects
:= call
85 bridge_noopt_objects
:= uno2cpp
86 bridge_exception_objects
:= callvirtualmethod cpp2uno dllinit except smallstruct
89 else ifeq ($(OS
)-$(CPUNAME
),LINUX-M68K
)
91 bridges_SELECTED_BRIDGE
:= gcc3_linux_m68k
92 bridge_noopt_objects
:= cpp2uno except uno2cpp
94 else ifeq ($(CPUNAME
),GODSON
)
96 ifneq ($(filter ANDROID LINUX
,$(OS
)),)
97 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips
98 bridge_noopt_objects
:= cpp2uno uno2cpp
99 bridge_exception_objects
:= except
102 else ifeq ($(OS
)-$(CPUNAME
),LINUX-POWERPC
)
104 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc
105 bridge_noopt_objects
:= uno2cpp
106 bridge_exception_objects
:= cpp2uno except
108 else ifeq ($(OS
)-$(CPUNAME
),LINUX-POWERPC64
)
110 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc64
111 bridge_noopt_objects
:= cpp2uno uno2cpp
112 bridge_exception_objects
:= except
114 else ifeq ($(OS
)-$(CPUNAME
),LINUX-S390
)
116 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390
117 bridge_exception_objects
:= cpp2uno except uno2cpp
119 else ifeq ($(OS
)-$(CPUNAME
),LINUX-S390X
)
121 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390x
122 bridge_exception_objects
:= cpp2uno except uno2cpp
124 else ifeq ($(OS
)-$(CPUNAME
),LINUX-SPARC
)
126 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc
127 bridge_asm_objects
:= call
128 bridge_noopt_objects
:= except
129 bridge_exception_objects
:= cpp2uno uno2cpp
131 else ifeq ($(CPUNAME
),X86_64
)
133 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
134 bridges_SELECTED_BRIDGE
:= gcc3_linux_x86-64
135 bridge_asm_objects
:= call
136 bridge_noncallexception_noopt_objects
:= callvirtualmethod
137 bridge_exception_objects
:= abi cpp2uno except rtti uno2cpp
138 else ifeq ($(OS
),MACOSX
)
139 bridges_SELECTED_BRIDGE
:= gcc3_macosx_x86-64
140 bridge_exception_objects
:= abi call cpp2uno except uno2cpp
141 bridge_noncallexception_noopt_objects
:= callvirtualmethod
142 else ifeq ($(COM
),MSC
)
143 bridges_SELECTED_BRIDGE
:= msvc_win32_x86-64
144 bridge_exception_objects
:= cpp2uno dllinit uno2cpp
145 bridge_noopt_objects
:= except
146 bridge_asm_objects
:= call
147 else ifeq ($(OS
)$(COM
),WNTGCC
)
148 bridges_SELECTED_BRIDGE
:= mingw_x86-64
149 bridge_asm_objects
:= call
150 bridge_noncallexception_noopt_objects
:= callvirtualmethod
151 bridge_exception_objects
:= abi cpp2uno except uno2cpp
154 else ifeq ($(OS
)-$(CPUNAME
),SOLARIS-SPARC
)
156 bridges_SELECTED_BRIDGE
:= gcc3_solaris_sparc
157 bridge_noopt_objects
:= cpp2uno uno2cpp
158 bridge_exception_objects
:= except
162 $(eval
$(call gb_Library_use_external
,$(gb_CPPU_ENV
)_uno
,boost_headers
))
164 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(gb_CPPU_ENV
)_uno
,\
168 $(eval
$(call gb_Library_set_include
,$(gb_CPPU_ENV
)_uno
,\
169 -I
$(SRCDIR
)/bridges
/inc \
173 ifeq ($(HAVE_POSIX_FALLOCATE
),YES
)
174 $(eval
$(call gb_Library_add_defs
,$(gb_CPPU_ENV
)_uno
,\
175 -DHAVE_POSIX_FALLOCATE \
179 $(eval
$(call gb_Library_add_defs
,$(gb_CPPU_ENV
)_uno
,\
180 $(if
$(filter GCC
,$(COM
)),\
181 $(if
$(filter sjlj
,$(EXCEPTIONS
)),\
184 $(if
$(cppu_no_leak
)$(bndchk
),,\
190 # In case someone enabled the non-standard -fomit-frame-pointer which does not
191 # work with the .cxx sources of this library.
192 # LTO causes crashes when enabled for this library
193 # In case the compiler supports AVX this code segfaults so specifically turn
196 $(eval
$(call gb_Library_add_cxxflags
,gcc3_uno
,\
197 -fno-omit-frame-pointer \
198 -fno-strict-aliasing \
199 $(if
$(filter TRUE
,$(ENABLE_LTO
)),-fno-lto
) \
200 $(if
$(filter TRUE
,$(HAVE_GCC_AVX
)),-mno-avx
) \
203 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX
,$(OS
)),)
204 $(eval
$(call gb_Library_add_libs
,gcc3_uno
,\
211 ifneq ($(COM_GCC_IS_CLANG
),TRUE
)
212 bridges_NON_CALL_EXCEPTIONS_FLAGS
:= -fnon-call-exceptions
216 $(eval
$(call gb_Library_use_libraries
,$(gb_CPPU_ENV
)_uno
,\
221 $(foreach obj
,$(bridge_exception_objects
),\
222 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
223 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
225 $(foreach obj
,$(bridge_noncallexception_objects
),\
226 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
227 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
228 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) $(gb_LinkTarget_EXCEPTIONFLAGS
))) \
230 $(foreach obj
,$(bridge_noopt_objects
),\
231 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
232 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
233 , $(gb_COMPILERNOOPTFLAGS
) $(if
$(filter MSC
,$(COM
)),$(gb_DEBUG_CFLAGS
)) $(gb_LinkTarget_EXCEPTIONFLAGS
))) \
235 $(foreach obj
,$(bridge_noncallexception_noopt_objects
),\
236 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
237 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
238 , $(gb_COMPILERNOOPTFLAGS
) $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) $(gb_LinkTarget_EXCEPTIONFLAGS
))) \
240 $(foreach obj
,$(bridge_cxx_objects
),\
241 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
242 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
244 $(foreach obj
,$(bridge_asm_objects
),\
245 $(eval
$(call gb_Library_add_asmobjects
,$(gb_CPPU_ENV
)_uno
,\
246 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
249 $(eval
$(call gb_Library_add_exception_objects
,$(gb_CPPU_ENV
)_uno
,\
250 bridges
/source
/cpp_uno
/shared
/bridge \
251 bridges
/source
/cpp_uno
/shared
/component \
252 bridges
/source
/cpp_uno
/shared
/types \
253 bridges
/source
/cpp_uno
/shared
/unointerfaceproxy \
254 bridges
/source
/cpp_uno
/shared
/vtablefactory \
255 bridges
/source
/cpp_uno
/shared
/vtables \
258 $(eval
$(call gb_Library_add_cxxobjects
,$(gb_CPPU_ENV
)_uno
,\
259 bridges
/source
/cpp_uno
/shared
/cppinterfaceproxy \
260 , $(gb_COMPILERNOOPTFLAGS
) $(gb_LinkTarget_EXCEPTIONFLAGS
) \
263 # vim: set noet sw=4 ts=4: