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
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']:
12 elif CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
13 SharedLibrary('mozglue')
17 if CONFIG['OS_TARGET'] == 'Android':
18 LDFLAGS += ['-Wl,--version-script,%s/mozglue.ver' % SRCDIR]
23 if CONFIG['MOZ_ASAN']:
28 if CONFIG['MOZ_UBSAN']:
33 if CONFIG['MOZ_TSAN']:
38 if CONFIG['OS_TARGET'] == 'WINNT':
39 DEFFILE = '!mozglue.def'
40 # We'll break the DLL blocklist if we immediately load user32.dll.
41 # For the same reason, we delayload winmm.dll which statically links
47 RCINCLUDE = 'mozglue.rc'
49 if CONFIG['MOZ_WIDGET_TOOLKIT']:
51 if CONFIG['MOZ_MEMORY'] and FORCE_SHARED_LIB:
53 # TODO: SHARED_LIBRARY_LIBS go here
55 # Temporary, until bug 662814 lands
61 if CONFIG['OS_TARGET'] == 'WINNT':
73 if CONFIG['CPU_ARCH'].startswith('x86'):
78 if CONFIG['CPU_ARCH'] == 'arm':
83 if CONFIG['CPU_ARCH'].startswith('mips'):
88 if CONFIG['CPU_ARCH'].startswith('ppc'):
93 if CONFIG['MOZ_LINKER']:
102 LIBRARY_DEFINES['IMPL_MFBT'] = True
103 LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
105 if CONFIG['OS_TARGET'] == 'Darwin':
106 # On OSX 10.10.3, a dead lock happens in some cases involving dynamic
107 # symbol resolution for symbols that jemalloc itself uses. While it
108 # might be possible to find a way to avoid all such symbol resolutions,
109 # it's currently not possible because at the very least there's a call
110 # to pthread_self from tsd_init_check_recursion, which is necessary
111 # because somehow clang doesn't want to accept the __thread keyword
113 LDFLAGS += ['-Wl,-bind_at_load']
115 if CONFIG['MOZ_LINKER'] and CONFIG['CPU_ARCH'] == 'arm':
116 LDFLAGS += ['-Wl,-version-script,%s/arm-eabi-filter' % SRCDIR]