|
1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- |
|
2 # vim: set filetype=python: |
|
3 # This Source Code Form is subject to the terms of the Mozilla Public |
|
4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
6 |
|
7 if CONFIG['OS_ARCH'] == 'Darwin': |
|
8 SOURCES += [ |
|
9 'xptcinvoke_darwin.cpp', |
|
10 'xptcstubs_darwin.cpp', |
|
11 ] |
|
12 if CONFIG['OS_TEST'] == 'powerpc': |
|
13 SOURCES += [ |
|
14 'xptcinvoke_asm_ppc_rhapsody.s', |
|
15 ] |
|
16 GENERATED_SOURCES += [ |
|
17 'xptcstubs_asm_ppc_darwin.s', |
|
18 ] |
|
19 if '86' in CONFIG['OS_TEST'] and CONFIG['OS_TEST'] != 'x86_64': |
|
20 DEFINES['MOZ_NEED_LEADING_UNDERSCORE'] = True |
|
21 |
|
22 if CONFIG['OS_ARCH'] in ('NetBSD', 'OpenBSD', 'GNU'): |
|
23 if CONFIG['CPU_ARCH'] == 'x86': |
|
24 SOURCES += [ |
|
25 'xptcinvoke_gcc_x86_unix.cpp', |
|
26 'xptcstubs_gcc_x86_unix.cpp' |
|
27 ] |
|
28 |
|
29 if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD') or \ |
|
30 CONFIG['OS_ARCH'].startswith('GNU_'): |
|
31 if CONFIG['OS_TEST'] == 'x86_64': |
|
32 SOURCES += [ |
|
33 'xptcinvoke_x86_64_unix.cpp', |
|
34 'xptcstubs_x86_64_linux.cpp', |
|
35 ] |
|
36 elif CONFIG['OS_TEST'].find('86') != -1: |
|
37 SOURCES += [ |
|
38 'xptcinvoke_gcc_x86_unix.cpp', |
|
39 'xptcstubs_gcc_x86_unix.cpp' |
|
40 ] |
|
41 |
|
42 if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'): |
|
43 if CONFIG['OS_TEST'].find('ia64') != -1: |
|
44 SOURCES += [ |
|
45 'xptcinvoke_asm_ipf64.s', |
|
46 'xptcinvoke_ipf64.cpp', |
|
47 'xptcstubs_asm_ipf64.s', |
|
48 'xptcstubs_ipf64.cpp' |
|
49 ] |
|
50 |
|
51 if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'x86_64': |
|
52 SOURCES += [ |
|
53 'xptcinvoke_amd64_openbsd.cpp', |
|
54 'xptcstubs_amd64_openbsd.cpp' |
|
55 ] |
|
56 |
|
57 if CONFIG['OS_ARCH'] == 'SunOS': |
|
58 if CONFIG['OS_TEST'] == 'x86_64': |
|
59 if CONFIG['GNU_CC']: |
|
60 SOURCES += [ |
|
61 'xptcinvoke_x86_64_unix.cpp', |
|
62 'xptcstubs_x86_64_linux.cpp' |
|
63 ] |
|
64 else: |
|
65 SOURCES += [ |
|
66 'xptcinvoke_x86_64_solaris.cpp', |
|
67 'xptcstubs_asm_x86_64_solaris_SUNW.s', |
|
68 'xptcstubs_x86_64_solaris.cpp', |
|
69 ] |
|
70 elif CONFIG['OS_TEST'].find('86') != -1: |
|
71 if CONFIG['GNU_CC']: |
|
72 SOURCES += [ |
|
73 'xptcinvoke_gcc_x86_unix.cpp', |
|
74 'xptcstubs_gcc_x86_unix.cpp' |
|
75 ] |
|
76 else: |
|
77 SOURCES += [ |
|
78 'xptcinvoke_asm_x86_solaris_SUNW.s', |
|
79 'xptcinvoke_x86_solaris.cpp', |
|
80 'xptcstubs_asm_x86_solaris_SUNW.s', |
|
81 'xptcstubs_x86_solaris.cpp' |
|
82 ] |
|
83 |
|
84 if CONFIG['OS_TEST'] == 'alpha': |
|
85 if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD'): |
|
86 SOURCES += [ |
|
87 'xptcinvoke_linux_alpha.cpp', |
|
88 'xptcstubs_linux_alpha.cpp', |
|
89 ] |
|
90 elif CONFIG['OS_ARCH'] == 'OpenBSD': |
|
91 SOURCES += [ |
|
92 'xptcinvoke_alpha_openbsd.cpp', |
|
93 'xptcstubs_alpha_openbsd.cpp', |
|
94 ] |
|
95 |
|
96 if CONFIG['CPU_ARCH'] == 'arm' or CONFIG['OS_TEST'] == 'sa110': |
|
97 if CONFIG['OS_ARCH'] == 'Linux': |
|
98 SOURCES += [ |
|
99 'xptcinvoke_arm.cpp', |
|
100 'xptcstubs_arm.cpp' |
|
101 ] |
|
102 CXXFLAGS += ['-O2'] |
|
103 elif CONFIG['OS_ARCH'] == 'NetBSD': |
|
104 SOURCES += [ |
|
105 'xptcinvoke_arm_netbsd.cpp', |
|
106 'xptcstubs_arm_netbsd.cpp', |
|
107 ] |
|
108 |
|
109 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['OS_ARCH'] == 'OpenBSD': |
|
110 SOURCES += [ |
|
111 'xptcinvoke_arm_openbsd.cpp', |
|
112 'xptcstubs_arm_openbsd.cpp', |
|
113 ] |
|
114 |
|
115 if CONFIG['OS_ARCH'] == 'HP-UX': |
|
116 if CONFIG['CC'] != 'gcc': |
|
117 if CONFIG['OS_TEST'] == 'ia64': |
|
118 SOURCES += [ |
|
119 'xptcinvoke_asm_ipf32.s', |
|
120 'xptcinvoke_ipf32.cpp', |
|
121 'xptcstubs_asm_ipf32.s', |
|
122 'xptcstubs_ipf32.cpp', |
|
123 ] |
|
124 else: |
|
125 SOURCES += [ |
|
126 'xptcinvoke_asm_pa32.s', |
|
127 'xptcinvoke_pa32.cpp', |
|
128 'xptcstubs_asm_pa32.s', |
|
129 'xptcstubs_pa32.cpp' |
|
130 ] |
|
131 |
|
132 if CONFIG['OS_ARCH'] == 'Linux': |
|
133 if CONFIG['OS_TEST'] in ('hppa', 'hppa2.0', 'hppa1.1'): |
|
134 if CONFIG['GNU_CXX']: |
|
135 SOURCES += [ |
|
136 'xptcinvoke_asm_parisc_linux.s', |
|
137 'xptcinvoke_pa32.cpp', |
|
138 'xptcstubs_asm_parisc_linux.s', |
|
139 'xptcstubs_pa32.cpp', |
|
140 ] |
|
141 elif CONFIG['COMPILE_ENVIRONMENT']: |
|
142 error('Unknown C++ compiler, xptcall assembly will probably be incorrect.') |
|
143 |
|
144 if CONFIG['OS_ARCH'] == 'NetBSD': |
|
145 if CONFIG['OS_TEST'] in ('amiga', 'atari', 'hp300', 'mac68k', 'mvme68k', |
|
146 'next68k', 'sun3', 'sun3x', 'x68k'): |
|
147 SOURCES += [ |
|
148 'xptcinvoke_netbsd_m68k.cpp', |
|
149 'xptcstubs_netbsd_m68k.cpp' |
|
150 ] |
|
151 |
|
152 if CONFIG['OS_ARCH'] == 'Linux': |
|
153 if CONFIG['OS_TEST'] == 'aarch64': |
|
154 SOURCES += [ |
|
155 'xptcinvoke_aarch64.cpp', |
|
156 'xptcinvoke_asm_aarch64.s', |
|
157 'xptcstubs_aarch64.cpp', |
|
158 'xptcstubs_asm_aarch64.s', |
|
159 ] |
|
160 if CONFIG['OS_TEST'] == 'm68k': |
|
161 SOURCES += [ |
|
162 'xptcinvoke_linux_m68k.cpp', |
|
163 'xptcstubs_linux_m68k.cpp', |
|
164 ] |
|
165 if CONFIG['OS_TEST'].find('mips') != -1: |
|
166 if CONFIG['OS_TEST'].find('mips64') != -1: |
|
167 SOURCES += [ |
|
168 'xptcinvoke_asm_mips64.S', |
|
169 'xptcinvoke_mips64.cpp', |
|
170 'xptcstubs_asm_mips64.S', |
|
171 'xptcstubs_mips64.cpp', |
|
172 ] |
|
173 else: |
|
174 SOURCES += [ |
|
175 'xptcinvoke_asm_mips.S', |
|
176 'xptcinvoke_mips.cpp', |
|
177 'xptcstubs_asm_mips.S', |
|
178 'xptcstubs_mips.cpp', |
|
179 ] |
|
180 |
|
181 if CONFIG['OS_ARCH'] == 'AIX': |
|
182 if CONFIG['HAVE_64BIT_OS']: |
|
183 SOURCES += [ |
|
184 'xptcinvoke_asm_ppc_aix64.s', |
|
185 'xptcinvoke_ppc_aix64.cpp', |
|
186 'xptcstubs_ppc_aix64.cpp', |
|
187 ] |
|
188 GENERATED_SOURCES += [ |
|
189 'xptcstubs_asm_ppc_aix64.s', |
|
190 ] |
|
191 else: |
|
192 SOURCES += [ |
|
193 'xptcinvoke_ppc_aix.cpp', |
|
194 'xptcstubs_ppc_aix.cpp', |
|
195 ] |
|
196 if CONFIG['AIX_OBJMODEL'] == 'ibm': |
|
197 SOURCES += [ |
|
198 'xptcinvoke_asm_ppc_ibmobj_aix.s', |
|
199 ] |
|
200 else: |
|
201 SOURCES += [ |
|
202 'xptcinvoke_asm_ppc_aix.s', |
|
203 ] |
|
204 GENERATED_SOURCES += [ |
|
205 'xptcstubs_asm_ppc_aix.s', |
|
206 ] |
|
207 |
|
208 if CONFIG['OS_TEST'] == 'powerpc': |
|
209 if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'): |
|
210 SOURCES += [ |
|
211 'xptcinvoke_asm_ppc_linux.S', |
|
212 'xptcinvoke_ppc_linux.cpp', |
|
213 'xptcstubs_asm_ppc_linux.S', |
|
214 'xptcstubs_ppc_linux.cpp', |
|
215 ] |
|
216 |
|
217 if CONFIG['OS_TEST'] in ('powerpc64', 'powerpc64le'): |
|
218 if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'): |
|
219 SOURCES += [ |
|
220 'xptcinvoke_asm_ppc64_linux.S', |
|
221 'xptcinvoke_ppc64_linux.cpp', |
|
222 'xptcstubs_asm_ppc64_linux.S', |
|
223 'xptcstubs_ppc64_linux.cpp', |
|
224 ] |
|
225 |
|
226 if CONFIG['OS_TEST'] in ('macppc', 'bebox', 'ofppc', 'prep', 'amigappc'): |
|
227 if CONFIG['OS_ARCH'] == 'NetBSD': |
|
228 SOURCES += [ |
|
229 'xptcinvoke_asm_ppc_netbsd.s', |
|
230 'xptcinvoke_ppc_netbsd.cpp', |
|
231 'xptcstubs_asm_ppc_netbsd.s', |
|
232 'xptcstubs_ppc_netbsd.cpp', |
|
233 ] |
|
234 |
|
235 if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'powerpc': |
|
236 SOURCES += [ |
|
237 'xptcinvoke_asm_ppc_openbsd.S', |
|
238 'xptcinvoke_ppc_openbsd.cpp', |
|
239 'xptcstubs_asm_ppc_openbsd.S', |
|
240 'xptcstubs_ppc_openbsd.cpp', |
|
241 ] |
|
242 |
|
243 if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TEST'].find('sparc') != -1: |
|
244 SOURCES += [ |
|
245 'xptcinvoke_asm_sparc_linux_GCC3.s', |
|
246 'xptcinvoke_sparc_solaris.cpp', |
|
247 'xptcstubs_asm_sparc_solaris.s', |
|
248 'xptcstubs_sparc_solaris.cpp', |
|
249 ] |
|
250 |
|
251 if CONFIG['OS_ARCH'] == 'NetBSD' and CONFIG['OS_TEST'] == 'sparc': |
|
252 SOURCES += [ |
|
253 'xptcinvoke_asm_sparc_netbsd.s', |
|
254 'xptcinvoke_sparc_netbsd.cpp', |
|
255 'xptcstubs_asm_sparc_netbsd.s', |
|
256 'xptcstubs_sparc_netbsd.cpp', |
|
257 ] |
|
258 |
|
259 if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'sparc': |
|
260 SOURCES += [ |
|
261 'xptcinvoke_asm_sparc_openbsd.s', |
|
262 'xptcinvoke_sparc_openbsd.cpp', |
|
263 'xptcstubs_asm_sparc_openbsd.s', |
|
264 'xptcstubs_sparc_openbsd.cpp', |
|
265 ] |
|
266 |
|
267 if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD') and CONFIG['OS_TEST'] == 'sparc64': |
|
268 SOURCES += [ |
|
269 'xptcinvoke_asm_sparc64_openbsd.s', |
|
270 'xptcinvoke_sparc64_openbsd.cpp', |
|
271 'xptcstubs_asm_sparc64_openbsd.s', |
|
272 'xptcstubs_sparc64_openbsd.cpp', |
|
273 ] |
|
274 |
|
275 if CONFIG['OS_ARCH'] == 'SunOS' and CONFIG['OS_TEST'].find('86') == -1: |
|
276 GENERATED_FILES = [ |
|
277 'xptcstubsdef_asm.solx86', |
|
278 ] |
|
279 if CONFIG['HAVE_64BIT_OS']: |
|
280 SOURCES += [ |
|
281 'xptcinvoke_sparcv9_solaris.cpp', |
|
282 'xptcstubs_sparcv9_solaris.cpp', |
|
283 ] |
|
284 else: |
|
285 SOURCES += [ |
|
286 'xptcinvoke_sparc_solaris.cpp', |
|
287 'xptcstubs_sparc_solaris.cpp', |
|
288 ] |
|
289 if CONFIG['GNU_CC']: |
|
290 SOURCES += [ |
|
291 'xptcinvoke_asm_sparc_solaris_GCC3.s', |
|
292 'xptcstubs_asm_sparc_solaris.s', |
|
293 ] |
|
294 else: |
|
295 if CONFIG['HAVE_64BIT_OS']: |
|
296 SOURCES += [ |
|
297 'xptcinvoke_asm_sparcv9_solaris_SUNW.s', |
|
298 'xptcstubs_asm_sparcv9_solaris.s', |
|
299 ] |
|
300 else: |
|
301 SOURCES += [ |
|
302 'xptcinvoke_asm_sparc_solaris_SUNW.s', |
|
303 'xptcstubs_asm_sparc_solaris.s', |
|
304 ] |
|
305 |
|
306 if CONFIG['OS_ARCH'] == 'Linux': |
|
307 if CONFIG['OS_TEST'] == 's390': |
|
308 SOURCES += [ |
|
309 'xptcinvoke_linux_s390.cpp', |
|
310 'xptcstubs_linux_s390.cpp', |
|
311 ] |
|
312 CXXFLAGS += [ |
|
313 '-fno-strict-aliasing', |
|
314 '-fno-inline', |
|
315 '-fomit-frame-pointer', |
|
316 '-mbackchain', |
|
317 ] |
|
318 elif CONFIG['OS_TEST'] == 's390x': |
|
319 SOURCES += [ |
|
320 'xptcinvoke_linux_s390x.cpp', |
|
321 'xptcstubs_linux_s390x.cpp', |
|
322 ] |
|
323 CXXFLAGS += [ |
|
324 '-fno-strict-aliasing', |
|
325 '-fno-inline', |
|
326 '-fomit-frame-pointer', |
|
327 '-mbackchain', |
|
328 ] |
|
329 |
|
330 FINAL_LIBRARY = 'xpcom_core' |
|
331 |
|
332 LOCAL_INCLUDES += [ |
|
333 '../..', |
|
334 '../../../../xptinfo/src', |
|
335 ] |
|
336 |
|
337 NO_PGO = True |