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/.
8 BUG_COMPONENT = ('Core', 'Build Config')
10 # This cannot be named "build" because of bug 922191.
11 SPHINX_TREES['buildsystem'] = 'docs'
13 if CONFIG['OS_ARCH'] == 'WINNT':
18 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
19 DIRS += ['annotationProcessors']
21 DEFINES['ACCEPTED_MAR_CHANNEL_IDS'] = CONFIG['ACCEPTED_MAR_CHANNEL_IDS']
23 if CONFIG['MOZ_BUILD_APP'] == 'browser':
24 PYTHON_UNITTEST_MANIFESTS += [
25 'compare-mozconfig/python.ini',
28 if CONFIG['ENABLE_TESTS'] or CONFIG['MOZ_DMD']:
29 FINAL_TARGET_FILES += ['/tools/rb/fix_stack_using_bpsyms.py']
30 if CONFIG['OS_ARCH'] == 'Darwin':
31 FINAL_TARGET_FILES += ['/tools/rb/fix_macosx_stack.py']
32 if CONFIG['OS_ARCH'] == 'Linux':
33 FINAL_TARGET_FILES += ['/tools/rb/fix_linux_stack.py']
36 FINAL_TARGET_FILES += ['/memory/replace/dmd/dmd.py']
38 # Put a useful .gdbinit in the bin directory, to be picked up automatically
39 # by GDB when we debug executables there.
40 FINAL_TARGET_FILES += ['/.gdbinit']
41 FINAL_TARGET_PP_FILES += ['.gdbinit_python.in']
42 OBJDIR_FILES += ['!/dist/bin/.gdbinit_python']
44 # Install the clang-cl runtime library for ASAN next to the binaries we produce.
45 if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
46 FINAL_TARGET_FILES += ['%' + CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
48 if CONFIG['LLVM_SYMBOLIZER']:
49 FINAL_TARGET_FILES += ['/' + CONFIG['LLVM_SYMBOLIZER']]
51 if CONFIG['MOZ_APP_BASENAME']:
53 'TOPOBJDIR': TOPOBJDIR,
56 for var in ('GRE_MILESTONE', 'MOZ_APP_VERSION', 'MOZ_APP_BASENAME',
57 'MOZ_APP_VENDOR', 'MOZ_APP_ID', 'MAR_CHANNEL_ID',
58 'MOZ_APP_REMOTINGNAME'):
59 appini_defines[var] = CONFIG[var]
61 if CONFIG['MOZ_APP_DISPLAYNAME'] != CONFIG['MOZ_APP_BASENAME']:
62 appini_defines['MOZ_APP_DISPLAYNAME'] = CONFIG['MOZ_APP_DISPLAYNAME']
64 if CONFIG['MOZ_BUILD_APP'] == 'browser':
65 appini_defines['MOZ_BUILD_APP_IS_BROWSER'] = True
67 if CONFIG['MOZ_APP_PROFILE']:
68 appini_defines['MOZ_APP_PROFILE'] = CONFIG['MOZ_APP_PROFILE']
70 for var in ('MOZ_CRASHREPORTER', 'MOZ_PROFILE_MIGRATOR'):
72 appini_defines[var] = True
74 GENERATED_FILES += ['application.ini']
76 appini = GENERATED_FILES['application.ini']
77 appini.script = '../python/mozbuild/mozbuild/action/preprocessor.py:generate'
78 appini.inputs = ['application.ini.in']
79 appini.flags = ['-D%s=%s' % (k, '1' if v is True else v)
80 for k, v in appini_defines.iteritems()]
81 FINAL_TARGET_FILES += ['!application.ini']
82 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
83 FINAL_TARGET_PP_FILES += ['update-settings.ini']
85 GENERATED_FILES += ['application.ini.h']
86 appini = GENERATED_FILES['application.ini.h']
87 appini.script = 'appini_header.py'
88 appini.inputs = ['!application.ini']
90 # NOTE: Keep .gdbinit in the topsrcdir for people who run gdb from the topsrcdir.
91 OBJDIR_FILES += ['/.gdbinit']
93 # Put a .lldbinit in the bin directory and the objdir, to be picked up
94 # automatically by LLDB when we debug executables using either of those two
95 # directories as the current working directory. The .lldbinit file will
96 # load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are.
97 DEFINES['topsrcdir'] = TOPSRCDIR
98 FINAL_TARGET_PP_FILES += ['.lldbinit.in']
99 OBJDIR_FILES += ['!/dist/bin/.lldbinit']
101 # Put the .ycm_extra_conf.py file at the root of the objdir. It is used by
102 # the vim plugin YouCompleteMe.
103 OBJDIR_FILES += ['/.ycm_extra_conf.py']
105 if CONFIG['MOZ_VALGRIND']:
106 OBJDIR_FILES._valgrind += [
107 'valgrind/cross-architecture.sup',
108 'valgrind/i386-redhat-linux-gnu.sup',
109 'valgrind/x86_64-redhat-linux-gnu.sup',
112 if CONFIG['MOZ_ARTIFACT_BUILDS']:
113 # Ensure a pre-built interfaces.xpt installed to the objdir by the artifact
114 # code is included by the top-level chrome.manifest.
115 EXTRA_COMPONENTS += [
116 'prebuilt-interfaces.manifest',