summaryrefslogtreecommitdiff
path: root/build/moz.build
blob: 1f1c7474cd1f2dad878dfaeb3d370eaf01e0aa73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# This cannot be named "build" because of bug 922191.
SPHINX_TREES['buildsystem'] = 'docs'

if CONFIG['OS_ARCH'] == 'WINNT':
    DIRS += ['win32']
else:
    DIRS += ['unix']

for var in ('GRE_MILESTONE',
            'MOZ_APP_VERSION',
            'MOZ_APP_BASENAME',
            'MOZ_APP_VENDOR',
            'MOZ_APP_ID',
            'MAR_CHANNEL_ID',
            'ACCEPTED_MAR_CHANNEL_IDS',
            'MOZ_APP_REMOTINGNAME',
            'MOZ_BUILD_APP'):
    DEFINES[var] = CONFIG[var]

if CONFIG['MOZ_APP_DISPLAYNAME'] != CONFIG['MOZ_APP_BASENAME']:
    DEFINES['MOZ_APP_DISPLAYNAME'] = CONFIG['MOZ_APP_DISPLAYNAME']

if CONFIG['MOZ_PHOENIX']:
    DEFINES['MOZ_PHOENIX'] = CONFIG['MOZ_PHOENIX']
    DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True
    
if CONFIG['MC_OFFICIAL']:
    DEFINES['MC_OFFICIAL'] = CONFIG['MC_OFFICIAL']

if CONFIG['MOZ_APP_PROFILE']:
    DEFINES['MOZ_APP_PROFILE'] = CONFIG['MOZ_APP_PROFILE']

for var in ('MOZ_PROFILE_MIGRATOR',
            'MOZ_APP_STATIC_INI'):
    if CONFIG[var]:
        DEFINES[var] = True

if CONFIG['MOZ_PHOENIX']:
    PYTHON_UNIT_TESTS += [
        'compare-mozconfig/compare-mozconfigs-wrapper.py',
    ]

if CONFIG['ENABLE_TESTS']:
    FINAL_TARGET_FILES += ['/tools/rb/fix_stack_using_bpsyms.py']
    if CONFIG['OS_ARCH'] == 'Darwin':
        FINAL_TARGET_FILES += ['/tools/rb/fix_macosx_stack.py']
    if CONFIG['OS_ARCH'] == 'Linux':
        FINAL_TARGET_FILES += ['/tools/rb/fix_linux_stack.py']

# Put a useful .gdbinit in the bin directory, to be picked up automatically
# by GDB when we debug executables there.
FINAL_TARGET_FILES += ['/.gdbinit']
FINAL_TARGET_PP_FILES += ['.gdbinit_python.in']
OBJDIR_FILES += ['!/dist/bin/.gdbinit_python']

# Install the clang runtime library for ASAN next to the binaries we produce.
if CONFIG['MOZ_ASAN'] and CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']:
    FINAL_TARGET_FILES += [CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
if CONFIG['LLVM_SYMBOLIZER']:
    FINAL_TARGET_FILES += ['/' + CONFIG['LLVM_SYMBOLIZER']]

if CONFIG['MOZ_APP_BASENAME']:
    FINAL_TARGET_PP_FILES += ['application.ini']
    if CONFIG['MOZ_UPDATER']:
        FINAL_TARGET_PP_FILES += ['update-settings.ini']

    if CONFIG['MOZ_APP_STATIC_INI']:
        GENERATED_FILES += ['application.ini.h']
        appini = GENERATED_FILES['application.ini.h']
        appini.script = 'appini_header.py'
        appini.inputs = ['!/dist/bin/application.ini']

DEFINES['TOPSRCDIR'] = TOPSRCDIR
DEFINES['TOPOBJDIR'] = TOPOBJDIR

# NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir.
OBJDIR_FILES += ['/.gdbinit']

# Put a .lldbinit in the bin directory and the objdir, to be picked up
# automatically by LLDB when we debug executables using either of those two
# directories as the current working directory.  The .lldbinit file will
# load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are.
DEFINES['topsrcdir'] = TOPSRCDIR
FINAL_TARGET_PP_FILES += ['.lldbinit.in']
OBJDIR_FILES += ['!/dist/bin/.lldbinit']

# Put the .ycm_extra_conf.py file at the root of the objdir. It is used by
# the vim plugin YouCompleteMe.
OBJDIR_FILES += ['/.ycm_extra_conf.py']

if CONFIG['MOZ_VALGRIND']:
    OBJDIR_FILES._valgrind += [
        'valgrind/cross-architecture.sup',
        'valgrind/i386-redhat-linux-gnu.sup',
        'valgrind/x86_64-redhat-linux-gnu.sup',
    ]