Bug 941097 - Add --disable-unified-compilation configure flag; r=glandium

--HG--
extra : rebase_source : 05fe6864d3115ddfcb7d14cd3cd3ddaf13b70da3
This commit is contained in:
Gregory Szorc 2013-11-20 12:18:32 -08:00
parent 9e11e4a10e
commit 3451c65ca8
2 changed files with 27 additions and 10 deletions

View File

@ -368,6 +368,17 @@ if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then
fi
fi
dnl ========================================================
dnl Disable compiling sources in unified mode.
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(unified-compilation,
[ --disable-unified-compilation
Disable unified compilation of some C/C++ sources],
MOZ_DISABLE_UNIFIED_COMPILATION=1,
MOZ_DISABLE_UNIFIED_COMPILATION=)
AC_SUBST(MOZ_DISABLE_UNIFIED_COMPILATION)
dnl ========================================================
dnl Special win32 checks
dnl ========================================================

View File

@ -353,18 +353,24 @@ class RecursiveMakeBackend(CommonBackend):
UNIFIED_CMMSRCS='mm',
UNIFIED_CPPSRCS='cpp',
)
do_unify = not self.environment.substs.get(
'MOZ_DISABLE_UNIFIED_COMPILATION')
# Sorted so output is consistent and we don't bump mtimes.
for k, v in sorted(obj.variables.items()):
if k in unified_suffixes.keys():
self._add_unified_build_rules(backend_file, v,
backend_file.objdir,
unified_prefix='Unified_%s_%s' %
(unified_suffixes[k],
backend_file.relobjdir.replace('/', '_')),
unified_suffix=unified_suffixes[k],
unified_files_makefile_variable=k,
include_curdir_build_rules=False)
backend_file.write('%s += $(%s)\n' % (k[len('UNIFIED_'):], k))
if k in unified_suffixes:
if do_unify:
self._add_unified_build_rules(backend_file, v,
backend_file.objdir,
unified_prefix='Unified_%s_%s' % (
unified_suffixes[k],
backend_file.relobjdir.replace('/', '_')),
unified_suffix=unified_suffixes[k],
unified_files_makefile_variable=k,
include_curdir_build_rules=False)
backend_file.write('%s += $(%s)\n' % (k[len('UNIFIED_'):], k))
else:
backend_file.write('%s += %s\n' % (
k[len('UNIFIED_'):], ' '.join(sorted(v))))
elif isinstance(v, list):
for item in v:
backend_file.write('%s += %s\n' % (k, item))