Bug 1257434 - Move MOZ_ENABLE_PROFILER_SPS to moz.configure. r=ted draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 Mar 2016 16:08:53 +0900
changeset 341876 64fe3fe21861a0915d55c3dfbd8493dcbcc763da
parent 341875 d94d350cf638134f7bd2cdcff8d029924ff76e20
child 341877 08b11568f5c94f82aa71f4566d858fc3d48a2226
push id13315
push userbmo:mh+mozilla@glandium.org
push dateThu, 17 Mar 2016 23:55:06 +0000
reviewersted
bugs1257434
milestone48.0a1
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',