Bug 1257434 - Move --enable-systrace to moz.configure. r=ted draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 Mar 2016 15:56:23 +0900
changeset 341874 76048cca5afae1392ae0ff0c227fe6efcb59468b
parent 341873 295f890302c619161a8a8d22d77f5cf029f1ef45
child 341875 d94d350cf638134f7bd2cdcff8d029924ff76e20
push id13315
push userbmo:mh+mozilla@glandium.org
push dateThu, 17 Mar 2016 23:55:06 +0000
reviewersted
bugs1257434
milestone48.0a1
Bug 1257434 - Move --enable-systrace to moz.configure. r=ted
build/moz.configure/init.configure
build/moz.configure/old.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -256,16 +256,17 @@ def wanted_mozconfig_variables(help):
          'EXTERNAL_SOURCE_DIR',
          'GENISOIMAGE',
          'L10NBASEDIR',
          'MOZILLABUILD',
          'MOZ_ARTIFACT_BUILDS',
          'MOZ_BUILD_APP',
          'MOZ_FMP4',
          'MOZ_INSTRUMENT_EVENT_LOOP',
+         'MOZ_USE_SYSTRACE',
          'MOZTTDIR',
          'PERL',
          'RPMBUILD',
          'TAR',
          'UNZIP',
          'USE_FC_FREETYPE',
          'WITHOUT_X',
          'XARGS',
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -269,17 +269,16 @@ def old_configure_options(*options):
     '--enable-synth-pico',
     '--enable-synth-speechd',
     '--enable-system-cairo',
     '--enable-system-extension-dirs',
     '--enable-system-ffi',
     '--enable-system-hunspell',
     '--enable-system-pixman',
     '--enable-system-sqlite',
-    '--enable-systrace',
     '--enable-tasktracer',
     '--enable-tests',
     '--enable-thread-sanitizer',
     '--enable-trace-logging',
     '--enable-tree-freetype',
     '--enable-ui-locale',
     '--enable-universalchardet',
     '--enable-update-channel',
--- a/old-configure.in
+++ b/old-configure.in
@@ -1190,27 +1190,16 @@ dnl ====================================
 dnl = Use profiling compile flags
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(profiling,
 [  --enable-profiling      Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
     MOZ_PROFILING=1,
     MOZ_PROFILING= )
 
 dnl ========================================================
-dnl = Turn on systrace for android/b2g.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(systrace,
-[  --enable-systrace       Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
-    MOZ_USE_SYSTRACE=1,
-    MOZ_USE_SYSTRACE= )
-if test -n "$MOZ_USE_SYSTRACE"; then
-    AC_DEFINE(MOZ_USE_SYSTRACE)
-fi
-
-dnl ========================================================
 dnl = Use Valgrind
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(valgrind,
 [  --enable-valgrind       Enable Valgrind integration hooks (default=no)],
     MOZ_VALGRIND=1,
     MOZ_VALGRIND= )
 if test -n "$MOZ_VALGRIND"; then
     MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1,14 +1,33 @@
 # -*- 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/.
 
+
+# Profiling
+# ==============================================================
+# Some of the options here imply an option from js/moz.configure,
+# so, need to be declared before the include.
+option('--enable-systrace', env='MOZ_USE_SYSTRACE',
+       help='Turn on systrace for the Gecko profiler on android/b2g')
+
+@depends('--enable-systrace', target)
+def systrace(value, target):
+    if value and target.os != 'Android':
+        error('--enable-systrace cannot be used when targetting %s'
+              % target.os)
+    if value:
+        set_define('MOZ_USE_SYSTRACE', '1')
+
+
+# Javascript engine
+# ==============================================================
 include('../js/moz.configure')
 
 
 # L10N
 # ==============================================================
 option('--with-l10n-base', nargs=1, env='L10NBASEDIR',
        help='Path to l10n repositories')