2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 00:47:17 +04:00
|
|
|
# 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/.
|
|
|
|
|
2015-08-12 10:04:53 +03:00
|
|
|
# When built with --enable-debug, jemalloc4 makes headers define functions that
|
|
|
|
# are normally inlined, and that prevents unified sources from working.
|
|
|
|
if CONFIG['MOZ_DEBUG']:
|
|
|
|
maybe_unified_sources = SOURCES
|
|
|
|
else:
|
|
|
|
maybe_unified_sources = UNIFIED_SOURCES
|
|
|
|
|
|
|
|
maybe_unified_sources += [
|
2013-10-05 14:18:36 +04:00
|
|
|
'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',
|
2016-12-23 05:54:59 +03:00
|
|
|
'src/src/ctl.c',
|
2013-10-05 14:18:36 +04:00
|
|
|
'src/src/extent.c',
|
|
|
|
'src/src/hash.c',
|
|
|
|
'src/src/huge.c',
|
|
|
|
'src/src/jemalloc.c',
|
|
|
|
'src/src/mb.c',
|
|
|
|
'src/src/mutex.c',
|
2016-02-22 17:20:15 +03:00
|
|
|
'src/src/nstime.c',
|
2015-08-12 09:21:38 +03:00
|
|
|
'src/src/pages.c',
|
2016-02-22 17:20:15 +03:00
|
|
|
'src/src/prng.c',
|
2013-10-05 14:18:36 +04:00
|
|
|
'src/src/prof.c',
|
|
|
|
'src/src/quarantine.c',
|
|
|
|
'src/src/rtree.c',
|
2016-07-12 17:37:04 +03:00
|
|
|
'src/src/spin.c',
|
2013-10-05 14:18:36 +04:00
|
|
|
'src/src/stats.c',
|
|
|
|
'src/src/tcache.c',
|
2016-02-22 17:20:15 +03:00
|
|
|
'src/src/ticker.c',
|
2013-10-05 14:18:36 +04:00
|
|
|
'src/src/tsd.c',
|
|
|
|
'src/src/util.c',
|
2016-07-12 17:37:04 +03:00
|
|
|
'src/src/witness.c',
|
2013-06-04 19:08:44 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
# 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']:
|
2015-08-12 10:04:53 +03:00
|
|
|
maybe_unified_sources += [
|
2013-10-05 14:18:36 +04:00
|
|
|
'src/src/zone.c',
|
2013-06-04 19:08:44 +04:00
|
|
|
]
|
2013-06-17 23:21:01 +04:00
|
|
|
|
2016-11-10 14:57:00 +03:00
|
|
|
if CONFIG['MOZ_JEMALLOC4']:
|
|
|
|
FINAL_LIBRARY = 'memory'
|
|
|
|
else:
|
|
|
|
FINAL_LIBRARY = 'replace_jemalloc'
|
2013-11-27 17:55:07 +04:00
|
|
|
|
2014-10-30 07:06:12 +03:00
|
|
|
if CONFIG['MOZ_GLUE_IN_PROGRAM']:
|
2015-05-09 02:37:22 +03:00
|
|
|
DIST_INSTALL = True
|
2014-07-23 08:29:09 +04:00
|
|
|
|
2013-11-27 17:55:07 +04:00
|
|
|
if CONFIG['_MSC_VER']:
|
|
|
|
DEFINES['DLLEXPORT'] = True
|
2014-02-18 10:05:51 +04:00
|
|
|
LOCAL_INCLUDES += ['src/include/msvc_compat']
|
2014-05-31 04:54:23 +04:00
|
|
|
if not CONFIG['HAVE_INTTYPES_H']:
|
|
|
|
LOCAL_INCLUDES += ['src/include/msvc_compat/C99']
|
2013-11-27 17:55:07 +04:00
|
|
|
|
|
|
|
if CONFIG['OS_TARGET'] == 'Linux':
|
|
|
|
# For mremap
|
|
|
|
DEFINES['_GNU_SOURCE'] = True
|
|
|
|
|
2015-08-07 00:22:56 +03:00
|
|
|
if CONFIG['GNU_CC']:
|
|
|
|
CFLAGS += ['-std=gnu99']
|
2014-06-25 06:44:58 +04:00
|
|
|
|
2013-11-27 17:55:07 +04:00
|
|
|
DEFINES['abort'] = 'moz_abort'
|
2017-01-11 06:50:36 +03:00
|
|
|
DEFINES['JEMALLOC_ALLOC_JUNK'] = '((uint8_t)0xe4)'
|
|
|
|
DEFINES['JEMALLOC_FREE_JUNK'] = '((uint8_t)0xe5)'
|
2014-02-18 10:05:51 +04:00
|
|
|
|
2015-11-04 08:20:20 +03:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'!src/include',
|
|
|
|
'src/include',
|
|
|
|
]
|
2015-08-28 06:44:53 +03:00
|
|
|
|
2015-10-20 04:05:20 +03:00
|
|
|
# We allow warnings for third-party code that can be updated from upstream.
|
2015-08-28 06:44:53 +03:00
|
|
|
ALLOW_COMPILER_WARNINGS = True
|
2016-02-22 17:20:15 +03:00
|
|
|
|
|
|
|
OS_LIBS += CONFIG['REALTIME_LIBS']
|