Bug 1257434 - Move MOZ_ENABLE_PROFILER_SPS to moz.configure. r=ted
--- 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',