Bug 1257434 - Move --enable-instruments to moz.configure. r=ted
--- 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_INSTRUMENTS',
'MOZ_JPROF',
'MOZ_USE_SYSTRACE',
'MOZTTDIR',
'PERL',
'RPMBUILD',
'TAR',
'UNZIP',
'USE_FC_FREETYPE',
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -205,17 +205,16 @@ def old_configure_options(*options):
'--enable-gczeal',
'--enable-gio',
'--enable-gnomeui',
'--enable-gold',
'--enable-gps-debug',
'--enable-hardware-aec-ns',
'--enable-icf',
'--enable-install-strip',
- '--enable-instruments',
'--enable-ion',
'--enable-ios-target',
'--enable-ipdl-tests',
'--enable-jemalloc',
'--enable-jitspew',
'--enable-libjpeg-turbo',
'--enable-libproxy',
'--enable-llvm-hacks',
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -63,8 +63,24 @@ def disable_export_js(value):
# DISABLE_EXPORT_JS=1 gets us an empty PositiveOptionValue
if value and not len(value):
suggestion = '--disable-export-js'
else:
suggestion = '--enable-export-js'
error('Setting %s is deprecated, use %s instead.'
% (value.format('DISABLE_EXPORT_JS'), suggestion))
+
+
+# Profiling
+# =======================================================
+js_option('--enable-instruments', env='MOZ_INSTRUMENTS',
+ help='Enable instruments remote profiling')
+
+@depends('--enable-instruments', target)
+def instruments(value, target):
+ if value and target.os != 'OSX':
+ error('--enable-instruments cannot be used when targeting %s'
+ % target.os)
+ if value:
+ set_config('MOZ_INSTRUMENTS', '1')
+ set_define('MOZ_INSTRUMENTS', '1')
+ add_old_configure_assignment('MOZ_INSTRUMENTS', '1')
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -2341,23 +2341,18 @@ dnl jprof
dnl ========================================================
if test -n "$MOZ_JPROF"; then
MOZ_PROFILING=1
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
- AC_DEFINE(MOZ_INSTRUMENTS)
LIBS="$LIBS -framework CoreFoundation"
fi
dnl ========================================================
dnl callgrind
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(callgrind,
[ --enable-callgrind Enable callgrind profiling. Implies --enable-profiling.],
@@ -2777,17 +2772,16 @@ AC_SUBST(MC)
AC_SUBST(WINDRES)
AC_SUBST(IMPLIB)
AC_SUBST(FILTER)
AC_SUBST(BIN_FLAGS)
AC_SUBST(MOZ_DEBUG)
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_DEBUG_LDFLAGS)
AC_SUBST(WARNINGS_AS_ERRORS)
-AC_SUBST(MOZ_INSTRUMENTS)
AC_SUBST(MOZ_CALLGRIND)
AC_SUBST(MOZ_VTUNE)
AC_SUBST(MOZ_PROFILING)
AC_SUBST(LIBICONV)
AC_SUBST(ENABLE_TESTS)
AC_SUBST(ENABLE_STRIP)
--- a/old-configure.in
+++ b/old-configure.in
@@ -1214,23 +1214,18 @@ dnl jprof
dnl ========================================================
if test -n "$MOZ_JPROF"; then
MOZ_PROFILING=1
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
- AC_DEFINE(MOZ_INSTRUMENTS)
fi
dnl ========================================================
dnl callgrind
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(callgrind,
[ --enable-callgrind Enable callgrind profiling. Implies --enable-profiling.],
MOZ_CALLGRIND=1,
@@ -7391,17 +7386,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_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)
AC_SUBST(MOZ_FEEDS)