memory/jemalloc/moz.build
author Mike Hommey <mh+mozilla@glandium.org>
Fri, 08 Jul 2016 08:43:17 +0900
changeset 346288 764dfcab17e9354843c9f4668c9f3617eb8e9a96
parent 328054 e83eb1ba4b838f8f8b8de3d1875421f4daec1613
child 348206 3ec6380fca8207fa199693206a3ca24975bf9833
permissions -rw-r--r--
Bug 1283052 - Remove some of the magic around mozconfig detection. r=gps The mozconfig detection logic has bitten us on many occasions in the past. The following changes are made to tentatively improve the situation: - The API is modified such that autodetection of the mozconfig has to be a conscious decision made by the caller, and not triggered any time there is no mozconfig given, which could be a conscious decision of the opposite. - mozinfo.json now stores the actual mozconfig (or lack thereof) used during configure.

# -*- 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/.

UNIFIED_SOURCES += [
    'src/src/arena.c',
    'src/src/atomic.c',
    'src/src/base.c',
    'src/src/bitmap.c',
    'src/src/chunk.c',
    'src/src/chunk_dss.c',
    'src/src/chunk_mmap.c',
    'src/src/ckh.c',
    'src/src/extent.c',
    'src/src/hash.c',
    'src/src/huge.c',
    'src/src/jemalloc.c',
    'src/src/mb.c',
    'src/src/mutex.c',
    'src/src/nstime.c',
    'src/src/pages.c',
    'src/src/prng.c',
    'src/src/prof.c',
    'src/src/quarantine.c',
    'src/src/rtree.c',
    'src/src/stats.c',
    'src/src/tcache.c',
    'src/src/ticker.c',
    'src/src/tsd.c',
    'src/src/util.c',
    # FIXME do we ever want valgrind.c?
    # 'src/src/valgrind.c',
]

SOURCES += [
    # This file cannot be built in unified mode because of symbol clash on arena_purge.
    'src/src/ctl.c',
]

# Only OSX needs the zone allocation implementation,
# but only if replace-malloc is not enabled.
if CONFIG['OS_TARGET'] == 'Darwin' and not CONFIG['MOZ_REPLACE_MALLOC']:
    UNIFIED_SOURCES += [
        'src/src/zone.c',
    ]

Library('jemalloc')

FORCE_STATIC_LIB = True

if CONFIG['MOZ_GLUE_IN_PROGRAM']:
    SDK_LIBRARY = True
    DIST_INSTALL = True

if CONFIG['_MSC_VER']:
    DEFINES['DLLEXPORT'] = True
    LOCAL_INCLUDES += ['src/include/msvc_compat']
    if not CONFIG['HAVE_INTTYPES_H']:
        LOCAL_INCLUDES += ['src/include/msvc_compat/C99']

if CONFIG['OS_TARGET'] == 'Linux':
    # For mremap
    DEFINES['_GNU_SOURCE'] = True

if CONFIG['MOZ_NUWA_PROCESS'] and CONFIG['MOZ_JEMALLOC4']:
    DEFINES['pthread_mutex_lock'] = '__real_pthread_mutex_lock'

if CONFIG['GNU_CC']:
    CFLAGS += ['-std=gnu99']

DEFINES['abort'] = 'moz_abort'

LOCAL_INCLUDES += [
    '!src/include',
    'src/include',
]

# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True

OS_LIBS += CONFIG['REALTIME_LIBS']