Bug 1256988 - Move MOZ_INSTRUMENT_EVENT_LOOP to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 16:19:03 +0900
changeset 341018 88c2464fd6459f06e753131bc01c8023ac72ae26
parent 341017 470d42ad0d2c900932c50b12de6c8634991c673d
child 341019 c7b8aa7d96d8e33953968b947f1d223336e39490
push id13117
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 11:04:10 +0000
bugs1256988
milestone48.0a1
Bug 1256988 - Move MOZ_INSTRUMENT_EVENT_LOOP to moz.configure
build/moz.configure/init.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -253,16 +253,17 @@ def wanted_mozconfig_variables(help):
          'DISABLE_SHARED_JS',
          'DOXYGEN',
          'DSYMUTIL',
          'EXTERNAL_SOURCE_DIR',
          'GENISOIMAGE',
          'MOZILLABUILD',
          'MOZ_ARTIFACT_BUILDS',
          'MOZ_BUILD_APP',
+         'MOZ_INSTRUMENT_EVENT_LOOP',
          'PERL',
          'RPMBUILD',
          'TAR',
          'UNZIP',
          'WITHOUT_X',
          'XARGS',
          'ZIP',
      ])
--- a/old-configure.in
+++ b/old-configure.in
@@ -3408,30 +3408,22 @@ dnl ====================================
 MOZ_ARG_HEADER(Toolkit Options)
 
 dnl ========================================================
 dnl = Enable the toolkit as needed                         =
 dnl ========================================================
 
 case "$MOZ_WIDGET_TOOLKIT" in
 
-windows)
-    MOZ_INSTRUMENT_EVENT_LOOP=1
-    ;;
-
 gtk3)
     USE_FC_FREETYPE=1
-
-    MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 gtk2)
     USE_FC_FREETYPE=1
-
-    MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 qt)
     MOZ_ENABLE_QT=1
 
     USE_FC_FREETYPE=1
     AC_DEFINE(QT_NO_KEYWORDS)
     ;;
@@ -3441,45 +3433,35 @@ cocoa)
     # Use -Wl as a trick to avoid -framework and framework names from
     # being separated by AC_SUBST_LIST.
     TK_LIBS='-Wl,-framework,CoreLocation -Wl,-framework,QuartzCore -Wl,-framework,Carbon -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,AddressBook -Wl,-framework,OpenGL'
     TK_CFLAGS=""
     CFLAGS="$CFLAGS $TK_CFLAGS"
     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
     MOZ_USER_DIR="Mozilla"
     MOZ_FS_LAYOUT=bundle
-    MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 uikit)
     LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
     TK_CFLAGS=""
     TK_LIBS='-Wl,-framework,Foundation -Wl,-framework,CoreFoundation -Wl,-framework,CoreGraphics -Wl,-framework,CoreText -Wl,-framework,AVFoundation -Wl,-framework,AudioToolbox -Wl,-framework,CoreMedia -Wl,-framework,CoreVideo -Wl,-framework,OpenGLES -Wl,-framework,QuartzCore'
     CFLAGS="$CFLAGS $TK_CFLAGS"
     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
     MOZ_USER_DIR="Mozilla"
     MOZ_FS_LAYOUT=bundle
     ;;
 
-android)
-    MOZ_INSTRUMENT_EVENT_LOOP=1
-    ;;
-
 gonk)
     AC_DEFINE(MOZ_TOUCH)
     MOZ_TOUCH=1
-    MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 esac
 
-if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
-   AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP)
-fi
-
 dnl there are a lot of tests on MOZ_ENABLE_GTK below, that are more convenient
 dnl to keep that way than testing against MOZ_WIDGET_TOOLKIT
 case "$MOZ_WIDGET_TOOLKIT" in
 gtk*)
     MOZ_ENABLE_GTK=1
     ;;
 esac
 
@@ -8061,17 +8043,16 @@ AC_SUBST(MOZ_OMX_PLUGIN)
 AC_SUBST(MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE)
 AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
 AC_SUBST(VPX_USE_YASM)
 AC_SUBST_LIST(VPX_ASFLAGS)
 AC_SUBST(VPX_AS_CONVERSION)
 AC_SUBST(VPX_X86_ASM)
 AC_SUBST(VPX_ARM_ASM)
 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
-AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
 AC_SUBST(MOZ_CODE_COVERAGE)
 AC_SUBST(LIBJPEG_TURBO_USE_YASM)
 AC_SUBST_LIST(LIBJPEG_TURBO_ASFLAGS)
 AC_SUBST(MOZ_LIBAV_FFT)
 AC_SUBST_LIST(LIBAV_FFT_ASFLAGS)
 AC_SUBST(MOZ_DEVTOOLS)
 
 AC_SUBST(MOZ_PACKAGE_JSSHELL)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -111,8 +111,21 @@ def gl_provider(value, x11):
 
 # PDF printing
 # ==============================================================
 @depends(toolkit)
 def pdf_printing(toolkit):
     if toolkit in ('windows', 'gtk2', 'gtk3', 'qt', 'android', 'gonk'):
         set_config('MOZ_PDF_PRINTING', '1')
         set_config('PDF_SURFACE_FEATURE', '#define CAIRO_HAS_PDF_SURFACE 1')
+
+
+# Event loop instrumentation
+# ==============================================================
+option(env='MOZ_INSTRUMENT_EVENT_LOOP',
+       help='Force-enable event loop instrumentation')
+
+@depends('MOZ_INSTRUMENT_EVENT_LOOP', toolkit)
+def instrument_event_loop(value, toolkit):
+    if value or toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa', 'android',
+                            'gonk') and value.origin == 'default':
+        set_config('MOZ_INSTRUMENT_EVENT_LOOP', '1')
+        set_define('MOZ_INSTRUMENT_EVENT_LOOP', '1')