Merge mozilla-central to autoland.
[gecko.git] / mozglue / build / moz.build
blob5ad727554d5245c2fc0281b14ecfa5a5e2c467df
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     LDFLAGS += ["-Wl,--version-script,%s/mozglue.ver" % SRCDIR]
19     SOURCES += [
20         "BionicGlue.cpp",
21     ]
23 if CONFIG["MOZ_ASAN"]:
24     SOURCES += [
25         "AsanOptions.cpp",
26     ]
28 if CONFIG["MOZ_UBSAN"]:
29     SOURCES += [
30         "UbsanOptions.cpp",
31     ]
33 if CONFIG["MOZ_TSAN"]:
34     SOURCES += [
35         "TsanOptions.cpp",
36     ]
38 if CONFIG["OS_TARGET"] == "WINNT":
39     if CONFIG["MOZ_MEMORY"]:
40         DEFFILE = "mozglue.def"
41     OS_LIBS += [
42         "advapi32",
43         "user32",
44         "winmm",
45         "uuid",
46     ]
47     # We'll break the DLL blocklist if we immediately load user32.dll.
48     # For the same reason, we delayload these other DLLs to avoid eager
49     # dependencies on user32.dll.
50     DELAYLOAD_DLLS += [
51         "advapi32.dll",
52         "dbghelp.dll",
53         "oleaut32.dll",
54         "ole32.dll",
55         "user32.dll",
56         "version.dll",
57         "winmm.dll",
58     ]
60 if CONFIG["MOZ_WIDGET_TOOLKIT"]:
61     if CONFIG["MOZ_MEMORY"] and FORCE_SHARED_LIB:
62         pass
63         # TODO: SHARED_LIBRARY_LIBS go here
64     else:
65         # Temporary, until bug 662814 lands
66         NoVisibilityFlags()
67         SOURCES += [
68             "dummy.cpp",
69         ]
71     if CONFIG["OS_TARGET"] == "WINNT":
72         LOCAL_INCLUDES += [
73             "/memory/build",
74         ]
76     EXPORTS.mozilla += [
77         "arm.h",
78         "mips.h",
79         "ppc.h",
80     ]
82     if CONFIG["CPU_ARCH"] == "arm":
83         SOURCES += [
84             "arm.cpp",
85         ]
87     if CONFIG["CPU_ARCH"].startswith("mips"):
88         SOURCES += [
89             "mips.cpp",
90         ]
92     if CONFIG["CPU_ARCH"].startswith("ppc"):
93         SOURCES += [
94             "ppc.cpp",
95         ]
97     if CONFIG["MOZ_LINKER"]:
98         USE_LIBS += [
99             "zlib",
100         ]
102 USE_LIBS += [
103     "mfbt",
106 LIBRARY_DEFINES["IMPL_MFBT"] = True
107 LIBRARY_DEFINES["MOZ_HAS_MOZGLUE"] = True
109 if CONFIG["MOZ_LINKER"] and CONFIG["CPU_ARCH"] == "arm":
110     LDFLAGS += ["-Wl,-version-script,%s/arm-eabi-filter" % SRCDIR]
112 DIST_INSTALL = True
114 include("replace_malloc.mozbuild")