Bug 1257434 - Move MOZ_ENABLE_PROFILER_SPS to moz.configure. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 Mar 2016 16:08:53 +0900
changeset 289233 029a6dd17e97bfe5a02cd6ca92d345f839a1da15
parent 289232 b3f02ffe19e11f2b6b7e8b23c0ba66b01bdad004
child 289234 52260b41c30bd804b8d52238d81b1447eae1be95
push id73761
push usermh@glandium.org
push dateFri, 18 Mar 2016 00:08:42 +0000
treeherdermozilla-inbound@254e87129b91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1257434
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1257434 - Move MOZ_ENABLE_PROFILER_SPS to moz.configure. r=ted
old-configure.in
toolkit/moz.configure
--- a/old-configure.in
+++ b/old-configure.in
@@ -1212,51 +1212,16 @@ AC_SUBST(MOZ_VALGRIND)
 dnl ========================================================
 dnl jprof
 dnl ========================================================
 if test -n "$MOZ_JPROF"; then
     MOZ_PROFILING=1
 fi
 
 dnl ========================================================
-dnl SPS Profiler
-dnl ========================================================
-MOZ_ENABLE_PROFILER_SPS=1
-
-case "${OS_TARGET}" in
-Android)
-    case "${CPU_ARCH}" in
-    x86 | arm) ;;
-    *)
-        MOZ_ENABLE_PROFILER_SPS=
-    esac
-    ;;
-Linux)
-    case "${CPU_ARCH}" in
-    x86 | x86_64) ;;
-    *)
-        MOZ_ENABLE_PROFILER_SPS=
-    esac
-    ;;
-WINNT) ;;
-Darwin)
-    if test -n "$MOZ_IOS"; then
-        MOZ_ENABLE_PROFILER_SPS=
-    fi
-    ;;
-*)
-    MOZ_ENABLE_PROFILER_SPS=
-    ;;
-esac
-
-if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
-    AC_DEFINE(MOZ_ENABLE_PROFILER_SPS)
-fi
-
-dnl ========================================================
 dnl instruments
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(instruments,
 [  --enable-instruments    Enable instruments remote profiling. Implies --enable-profiling.],
     MOZ_INSTRUMENTS=1,
     MOZ_INSTRUMENTS= )
 if test -n "$MOZ_INSTRUMENTS"; then
     MOZ_PROFILING=1
@@ -7426,17 +7391,16 @@ AC_SUBST(FILTER)
 AC_SUBST(BIN_FLAGS)
 AC_SUBST(MOZ_AUTH_EXTENSION)
 AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST(MOZ_DEBUG)
 AC_SUBST(MOZ_DEBUG_SYMBOLS)
 AC_SUBST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
 AC_SUBST_SET(MOZ_EXTENSIONS)
-AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
 AC_SUBST(MOZ_INSTRUMENTS)
 AC_SUBST(MOZ_CALLGRIND)
 AC_SUBST(MOZ_VTUNE)
 AC_SUBST(MOZ_PROFILING)
 AC_SUBST(LIBICONV)
 AC_SUBST(MOZ_PLACES)
 AC_SUBST(MOZ_SOCIAL)
 AC_SUBST(MOZ_TOOLKIT_SEARCH)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -27,16 +27,31 @@ option('--enable-jprof', env='MOZ_JPROF'
 @depends('--enable-jprof')
 def jprof(value):
     if value:
         set_config('MOZ_JPROF', '1')
         set_define('MOZ_JPROF', '1')
         add_old_configure_assignment('MOZ_JPROF', '1')
 
 
+@depends(target)
+def sps_profiler(target):
+    if target.os == 'Android':
+        return target.cpu in ('arm', 'x86')
+    elif target.kernel == 'Linux':
+        return target.cpu in ('x86', 'x86_64')
+    return target.os in ('OSX', 'WINNT')
+
+@depends(sps_profiler)
+def sps_profiler_define(value):
+    if value:
+        set_config('MOZ_ENABLE_PROFILER_SPS', '1')
+        set_define('MOZ_ENABLE_PROFILER_SPS', '1')
+
+
 # Javascript engine
 # ==============================================================
 include('../js/moz.configure')
 
 
 # L10N
 # ==============================================================
 option('--with-l10n-base', nargs=1, env='L10NBASEDIR',