Bug 1529726 [wpt PR 15414] - HTML: window.length and named access, a=testonly
[gecko.git] / mozglue / build / moz.build
blobd6372fc522ffe06e24c2be218a15d262b0ef0fe6
1 # -*- Mode: python; 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/.
7 # Build mozglue as a shared lib on Windows, OSX and Android. But not for
8 # embedders!
9 # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
10 if CONFIG['JS_STANDALONE'] and not CONFIG['MOZ_MEMORY']:
11     Library('mozglue')
12 elif CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
13     SharedLibrary('mozglue')
14 else:
15     Library('mozglue')
17 if CONFIG['OS_TARGET'] == 'Android':
18     SOURCES += [
19         'BionicGlue.cpp',
20     ]
22 if CONFIG['MOZ_ASAN']:
23     SOURCES += [
24         'AsanOptions.cpp',
25     ]
27 if CONFIG['MOZ_UBSAN']:
28     SOURCES += [
29         'UbsanOptions.cpp',
30     ]
32 if CONFIG['OS_TARGET'] == 'WINNT':
33     DEFFILE = '!mozglue.def'
34     # We'll break the DLL blocklist if we immediately load user32.dll
35     DELAYLOAD_DLLS += [
36         'user32.dll',
37     ]
38     RCINCLUDE = 'mozglue.rc'
40     if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
41         SOURCES += ['cygprofile.cpp']
42         SOURCES['cygprofile.cpp'].pgo_generate_only = True
44 if CONFIG['MOZ_WIDGET_TOOLKIT']:
46     if CONFIG['MOZ_MEMORY'] and FORCE_SHARED_LIB:
47         pass
48         # TODO: SHARED_LIBRARY_LIBS go here
49     else:
50         # Temporary, until bug 662814 lands
51         NoVisibilityFlags()
52         SOURCES += [
53             'dummy.cpp',
54         ]
56     if CONFIG['OS_TARGET'] == 'WINNT':
57         LOCAL_INCLUDES += [
58             '/memory/build',
59         ]
61         SOURCES += [
62             'Authenticode.cpp',
63             'UntrustedDllsHandler.cpp',
64             'WindowsDllBlocklist.cpp',
65         ]
67         DisableStlWrapping()
68         OS_LIBS += [
69             'crypt32',
70             'version',
71             'wintrust',
72         ]
73         DELAYLOAD_DLLS += [
74             'crypt32.dll',
75             'wintrust.dll',
76         ]
77         EXPORTS.mozilla += [
78             'Authenticode.h',
79             'WindowsDllBlocklistCommon.h',
80             'WindowsDllBlocklistDefs.h',
81         ]
82         EXPORTS.mozilla.glue += [
83             'WindowsDllServices.h',
84         ]
85         USE_LIBS += [
86             'mscom-mozglue',
87         ]
88         if CONFIG['CPU_ARCH'] == 'aarch64':
89             USE_LIBS += [
90                 'interceptor',
91             ]
93     EXPORTS.mozilla += [
94         'arm.h',
95         'mips.h',
96         'SSE.h',
97         'WindowsDllBlocklist.h',
98     ]
100     if CONFIG['CPU_ARCH'].startswith('x86'):
101         SOURCES += [
102             'SSE.cpp',
103         ]
105     if CONFIG['CPU_ARCH'] == 'arm':
106         SOURCES += [
107             'arm.cpp',
108         ]
110     if CONFIG['CPU_ARCH'].startswith('mips'):
111         SOURCES += [
112             'mips.cpp',
113         ]
115     if CONFIG['MOZ_LINKER']:
116         USE_LIBS += [
117             'zlib',
118         ]
120 USE_LIBS += [
121     'mfbt',
124 DEFINES['IMPL_MFBT'] = True
125 LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
127 if CONFIG['OS_TARGET'] == 'Darwin':
128     # On OSX 10.10.3, a dead lock happens in some cases involving dynamic
129     # symbol resolution for symbols that jemalloc itself uses. While it
130     # might be possible to find a way to avoid all such symbol resolutions,
131     # it's currently not possible because at the very least there's a call
132     # to pthread_self from tsd_init_check_recursion, which is necessary
133     # because somehow clang doesn't want to accept the __thread keyword
134     # for TLS.
135     LDFLAGS += ['-Wl,-bind_at_load']
137 if CONFIG['MOZ_LINKER'] and CONFIG['CPU_ARCH'] == 'arm':
138     LDFLAGS += ['-Wl,-version-script,%s/arm-eabi-filter' % SRCDIR]
140 DIST_INSTALL = True