build/moz.build
author Mike Hommey <mh+mozilla@glandium.org>
Tue, 09 Feb 2016 14:36:07 +0900
changeset 284054 02840dfc6310ad181aa7c3b49ef51c3dd1d71e95
parent 275413 03b626d4e9a2b2078203955c1bcbe67ffa43df1c
child 288791 97f8dcf6582ce95698ad38ea94326831d5552b64
permissions -rw-r--r--
Bug 1246881 - Generate a header defining MOZ_BUILDID. r=mshal

# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.

with Files('**'):
    BUG_COMPONENT = ('Core', 'Build Config')

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

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

if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_ANDROID_CXX_STL'] == 'mozstlport':
    DIRS += ['stlport']
    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android' and CONFIG['ENABLE_INTL_API']:
        DIRS += ['gabi++']

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
    DIRS += ['annotationProcessors']
    TEST_DIRS += [
        'mobile/sutagent/android',
        'mobile/sutagent/android/watcher',
        'mobile/sutagent/android/ffxcp',
        'mobile/sutagent/android/fencp',
    ]

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'):
    DEFINES[var] = CONFIG[var]

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

if CONFIG['MOZ_BUILD_APP'] == 'browser':
    DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True

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

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

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

if CONFIG['ENABLE_TESTS'] or CONFIG['MOZ_DMD']:
    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']

if CONFIG['MOZ_DMD']:
    FINAL_TARGET_FILES += ['/memory/replace/dmd/dmd.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']

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

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

DEFINES['TOPOBJDIR'] = TOPOBJDIR