Bug 1256988 - Replace tests on MOZ_WIDGET_GTK with tests on MOZ_WIDGET_TOOLKIT containing gtk draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 14:06:26 +0900
changeset 341010 3b4e744bf75908d3385013c198ee30d78a28a006
parent 341009 e4f1342e73f7bb5de70110fd47b8cf698b9063e3
child 341011 b1f6085fe811152998cdedd681217e07bb23ba5e
push id13117
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 11:04:10 +0000
bugs1256988
milestone48.0a1
Bug 1256988 - Replace tests on MOZ_WIDGET_GTK with tests on MOZ_WIDGET_TOOLKIT containing gtk But only do that for the AC_SUBST. The AC_DEFINE is still useful.
b2g/branding/branding-common.mozbuild
b2g/installer/Makefile.in
browser/app/Makefile.in
browser/branding/branding-common.mozbuild
browser/components/shell/moz.build
browser/installer/Makefile.in
gfx/cairo/cairo/src/moz.build
gfx/gl/moz.build
gfx/skia/generate_mozbuild.py
gfx/skia/moz.build
gfx/src/moz.build
gfx/thebes/moz.build
image/decoders/icon/moz.build
image/decoders/moz.build
intl/lwbrk/moz.build
ipc/chromium/moz.build
layout/generic/moz.build
old-configure.in
testing/tools/screenshot/moz.build
toolkit/library/moz.build
toolkit/mozapps/update/updater/Makefile.in
toolkit/mozapps/update/updater/updater-common.build
toolkit/xre/moz.build
xpcom/base/moz.build
xpcom/components/moz.build
--- a/b2g/branding/branding-common.mozbuild
+++ b/b2g/branding/branding-common.mozbuild
@@ -12,13 +12,12 @@ def B2GBranding():
         ]
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
         BRANDING_FILES += [
             'app.icns',
             'background.png',
             'disk.icns',
             'dsstore',
         ]
-
-    if CONFIG['MOZ_WIDGET_GTK']:
+    elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
         BRANDING_FILES += [
             'default.png',
         ]
--- a/b2g/installer/Makefile.in
+++ b/b2g/installer/Makefile.in
@@ -102,17 +102,17 @@ DEFINES += -DMOZ_ICU_VERSION=$(MOZ_ICU_V
 ifdef MOZ_SYSTEM_ICU
 DEFINES += -DMOZ_SYSTEM_ICU
 endif
 ifdef MOZ_SHARED_ICU
 DEFINES += -DMOZ_SHARED_ICU
 endif
 DEFINES += -DMOZ_ICU_DBG_SUFFIX=$(MOZ_ICU_DBG_SUFFIX)
 
-ifdef MOZ_WIDGET_GTK
+ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DMOZ_GTK=1
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
 DEFINES += -DMOZ_GTK3=1
 endif
 endif
 
 ifdef MOZ_CHROME_MULTILOCALE
 locale-manifest.in: $(GLOBAL_DEPS) FORCE
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -41,17 +41,17 @@ ifdef COMPILE_ENVIRONMENT
 libs:: 
 	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
 GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)
 
 endif
 
-ifdef MOZ_WIDGET_GTK
+ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
 libs::
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(FINAL_TARGET)/icons
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png  $(FINAL_TARGET)/chrome/icons/default
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png  $(FINAL_TARGET)/chrome/icons/default
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png  $(FINAL_TARGET)/chrome/icons/default
 endif
 
 # channel-prefs.js is handled separate from other prefs due to bug 756325
--- a/browser/branding/branding-common.mozbuild
+++ b/browser/branding/branding-common.mozbuild
@@ -31,15 +31,15 @@ def FirefoxBranding():
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
         BRANDING_FILES += [
             'background.png',
             'disk.icns',
             'document.icns',
             'dsstore',
             'firefox.icns',
         ]
-    elif CONFIG['MOZ_WIDGET_GTK']:
+    elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
         BRANDING_FILES += [
             'default16.png',
             'default32.png',
             'default48.png',
             'mozicon128.png',
         ]
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -16,32 +16,32 @@ XPIDL_SOURCES += [
 if CONFIG['OS_ARCH'] == 'WINNT':
     XPIDL_SOURCES += [
         'nsIWindowsShellService.idl',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     XPIDL_SOURCES += [
         'nsIMacShellService.idl',
     ]
-elif CONFIG['MOZ_WIDGET_GTK']:
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     XPIDL_SOURCES += [
         'nsIGNOMEShellService.idl',
     ]
 
 XPIDL_MODULE = 'shellservice'
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsWindowsShellService.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     SOURCES += [
         'nsMacShellService.cpp',
     ]
-elif CONFIG['MOZ_WIDGET_GTK']:
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     SOURCES += [
         'nsGNOMEShellService.cpp',
     ]
 
 if SOURCES:
     FINAL_LIBRARY = 'browsercomps'
 
 EXTRA_COMPONENTS += [
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -19,17 +19,17 @@ DEFINES += -DMOZ_MULET
 endif
 
 DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
 
 ifdef MOZ_DEBUG
 DEFINES += -DMOZ_DEBUG=1
 endif
 
-ifdef MOZ_WIDGET_GTK
+ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DMOZ_GTK=1
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
 DEFINES += -DMOZ_GTK3=1
 endif
 endif
 
 ifdef MOZ_SYSTEM_NSPR
 DEFINES += -DMOZ_SYSTEM_NSPR=1
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -69,17 +69,17 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] in {'c
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'beos':
     EXPORTS.cairo += [
         'cairo-beos.h',
     ]
     SOURCES += [
         'cairo-beos-surface.cpp',
     ]
-elif CONFIG['MOZ_WIDGET_GTK']:
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     EXPORTS.cairo += [
         'cairo-ps.h',
     ]
     SOURCES += [
         'cairo-ps-surface.c',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     EXPORTS.cairo += [
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -7,17 +7,17 @@
 gl_provider = 'Null'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     gl_provider = 'WGL'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     gl_provider = 'CGL'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
     gl_provider = 'EAGL'
-elif CONFIG['MOZ_WIDGET_GTK']:
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
         gl_provider = 'EGL'
     else:
         gl_provider = 'GLX'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     gl_provider = 'GLX'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     gl_provider = 'EGL'
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -57,20 +57,22 @@ LOCAL_INCLUDES += [
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
     DEFINES['SK_FONTHOST_CAIRO_STANDALONE'] = 0
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in {
     'android',
     'cocoa',
+    'gtk2',
+    'gtk3',
     'uikit',
     'gonk',
     'qt',
-  } or CONFIG['MOZ_WIDGET_GTK']:
+  }:
     DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DEFINES['UNICODE'] = True
     DEFINES['_UNICODE'] = True
 
 # We should autogenerate these SSE related flags.
 
@@ -376,17 +378,17 @@ def write_mozbuild(sources):
   write_sources(f, sources['gpu'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):\n")
   write_sources(f, sources['android'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] in {'cocoa', 'uikit'}:\n")
   write_sources(f, sources['mac'], 4)
 
-  f.write("if CONFIG['MOZ_WIDGET_GTK']:\n")
+  f.write("if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:\n")
   write_sources(f, sources['linux'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':\n")
   write_sources(f, sources['linux'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':\n")
   # Windows-specific files don't get unification because of nasty headers.
   # Luckily there are not many files in this.
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -548,17 +548,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in {'coc
         'skia/src/ports/SkTLS_pthread.cpp',
         'skia/src/utils/mac/SkCreateCGImageRef.cpp',
         'skia/src/utils/mac/SkStream_mac.cpp',
         'skia/src/utils/SkThreadUtils_pthread.cpp',
     ]
     SOURCES += [
         'skia/src/ports/SkFontHost_mac.cpp',
     ]
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     UNIFIED_SOURCES += [
         'skia/src/ports/SkDebug_stdio.cpp',
         'skia/src/ports/SkOSFile_posix.cpp',
         'skia/src/ports/SkOSLibrary_posix.cpp',
         'skia/src/ports/SkTime_Unix.cpp',
         'skia/src/ports/SkTLS_pthread.cpp',
         'skia/src/utils/SkThreadUtils_pthread.cpp',
     ]
@@ -675,20 +675,22 @@ LOCAL_INCLUDES += [
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
     DEFINES['SK_FONTHOST_CAIRO_STANDALONE'] = 0
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in {
     'android',
     'cocoa',
+    'gtk2',
+    'gtk3',
     'uikit',
     'gonk',
     'qt',
-  } or CONFIG['MOZ_WIDGET_GTK']:
+  }:
     DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DEFINES['UNICODE'] = True
     DEFINES['_UNICODE'] = True
 
 # We should autogenerate these SSE related flags.
 
--- a/gfx/src/moz.build
+++ b/gfx/src/moz.build
@@ -76,16 +76,16 @@ LOCAL_INCLUDES += [
     '/dom/ipc',  # for ContentChild.h
 ]
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -95,17 +95,17 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
     SOURCES += [
         'gfxCoreTextShaper.cpp',
         'gfxMacFont.cpp',
         'gfxPlatformMac.cpp',
         'gfxQuartzImageSurface.cpp',
         'gfxQuartzNativeDrawing.cpp',
         'gfxQuartzSurface.cpp',
     ]
-elif CONFIG['MOZ_WIDGET_GTK']:
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     EXPORTS += [
         'gfxFontconfigFonts.h',
         'gfxFT2FontBase.h',
         'gfxGdkNativeRenderer.h',
         'gfxPDFSurface.h',
         'gfxPlatformGtk.h',
         'gfxPSSurface.h',
     ]
--- a/image/decoders/icon/moz.build
+++ b/image/decoders/icon/moz.build
@@ -11,17 +11,17 @@ UNIFIED_SOURCES += [
 ]
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 platform = None
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     platform = 'gtk'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
     platform = 'qt'
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     platform = 'win'
 
--- a/image/decoders/moz.build
+++ b/image/decoders/moz.build
@@ -3,17 +3,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
 # The Icon Channel stuff really shouldn't live in decoders/icon, but we'll
 # fix that another time.
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in toolkit:
     DIRS += ['icon/gtk', 'icon']
 elif toolkit == 'qt':
     DIRS += ['icon/qt', 'icon']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['icon/win', 'icon']
 
 if toolkit == 'cocoa':
--- a/intl/lwbrk/moz.build
+++ b/intl/lwbrk/moz.build
@@ -19,20 +19,21 @@ EXPORTS += [
 ]
 
 UNIFIED_SOURCES += [
     'nsJISx4051LineBreaker.cpp',
     'nsSampleWordBreaker.cpp',
     'nsSemanticUnitScanner.cpp',
 ]
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     SOURCES += [
         'nsPangoBreaker.cpp',
     ]
+    CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     SOURCES += [
         'nsUniscribeBreaker.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
         'nsCarbonBreaker.cpp',
     ]
@@ -41,13 +42,10 @@ else:
         'nsRuleBreaker.cpp',
     ]
     SOURCES += [
         'rulebrk.c',
     ]
 
 FINAL_LIBRARY = 'xul'
 
-if CONFIG['MOZ_WIDGET_GTK']:
-    CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
-
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -146,17 +146,17 @@ if os_linux:
     if CONFIG['OS_TARGET'] == 'Android':
         UNIFIED_SOURCES += [
             'src/base/message_pump_android.cc',
         ]
         DEFINES['ANDROID'] = True
         DEFINES['_POSIX_MONOTONIC_CLOCK'] = 0
 
 if os_bsd or os_linux:
-    if CONFIG['MOZ_WIDGET_GTK']:
+    if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
         SOURCES += [
             'src/base/message_pump_glib.cc',
         ]
     if CONFIG['MOZ_ENABLE_QT']:
         SOURCES += [
             '!moc_message_pump_qt.cc',
             'src/base/message_pump_qt.cc',
         ]
--- a/layout/generic/moz.build
+++ b/layout/generic/moz.build
@@ -202,13 +202,13 @@ RESOURCE_FILES.html = [
     'folder.png',
 ]
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['MOZ_ENABLE_QT']:
     CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
--- a/old-configure.in
+++ b/old-configure.in
@@ -3416,49 +3416,45 @@ MOZ_ARG_HEADER(Toolkit Options)
 MOZ_ARG_WITHOUT_BOOL(x,
 [  --without-x              Build without X11],
     WITHOUT_X11=1)
 
 dnl ========================================================
 dnl = Enable the toolkit as needed                         =
 dnl ========================================================
 
-MOZ_WIDGET_GTK=
-
 case "$MOZ_WIDGET_TOOLKIT" in
 
 windows)
     MOZ_PDF_PRINTING=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 gtk3)
     MOZ_ENABLE_XREMOTE=1
     MOZ_GL_DEFAULT_PROVIDER=GLX
 
     AC_DEFINE(MOZ_X11)
     MOZ_X11=1
     USE_FC_FREETYPE=1
 
-    MOZ_WIDGET_GTK=3
-    AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
+    AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,3)
     MOZ_PDF_PRINTING=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 gtk2)
     MOZ_ENABLE_XREMOTE=1
     MOZ_GL_DEFAULT_PROVIDER=GLX
 
     AC_DEFINE(MOZ_X11)
     MOZ_X11=1
     USE_FC_FREETYPE=1
 
-    MOZ_WIDGET_GTK=2
-    AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
+    AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,2)
     MOZ_PDF_PRINTING=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
 qt)
     MOZ_ENABLE_QT=1
     if test -z "$WITHOUT_X11"; then
       MOZ_ENABLE_XREMOTE=1
@@ -3797,17 +3793,16 @@ AC_SUBST(GTK_CONFIG)
 AC_SUBST_LIST(TK_CFLAGS)
 AC_SUBST_LIST(TK_LIBS)
 
 AC_SUBST(MOZ_ENABLE_QT)
 AC_SUBST(MOZ_ENABLE_QTNETWORK)
 AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
 AC_SUBST(MOZ_ENABLE_XREMOTE)
-AC_SUBST(MOZ_WIDGET_GTK)
 AC_SUBST_LIST(MOZ_QT_CFLAGS)
 AC_SUBST_LIST(MOZ_QT_LIBS)
 
 AC_SUBST(MOC)
 AC_SUBST(RCC)
 
 AC_SUBST(MOZ_X11)
 
--- a/testing/tools/screenshot/moz.build
+++ b/testing/tools/screenshot/moz.build
@@ -1,15 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['MOZ_X11']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] and CONFIG['MOZ_X11']:
     Program('screentopng')
     SOURCES += [
         'gdk-screenshot.cpp',
     ]
     CXXFLAGS += CONFIG['TK_CFLAGS']
     LDFLAGS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['TK_LIBS']
     OS_LIBS += CONFIG['XSS_LIBS']
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -126,17 +126,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3
         'mozgtk_stub',
     ]
 
 if CONFIG['MOZ_JPROF']:
     USE_LIBS += [
         'jprof',
     ]
 
-if CONFIG['MOZ_WIDGET_GTK'] or CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt' or \
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt' or \
         CONFIG['MOZ_TREE_FREETYPE']:
     USE_LIBS += [
         'freetype',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
@@ -285,17 +285,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('coc
 if CONFIG['OS_ARCH'] == 'OpenBSD':
     OS_LIBS += [
         'sndio',
     ]
 
 if CONFIG['MOZ_ENABLE_DBUS']:
     OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS']
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
         OS_LIBS += [l for l in CONFIG['TK_LIBS']
             if l not in ('-lgtk-3', '-lgdk-3')]
     else:
         OS_LIBS += CONFIG['TK_LIBS']
     OS_LIBS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['XLIBS']
     OS_LIBS += CONFIG['XEXT_LIBS']
--- a/toolkit/mozapps/update/updater/Makefile.in
+++ b/toolkit/mozapps/update/updater/Makefile.in
@@ -10,17 +10,17 @@ ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef MOZ_WIDGET_GTK
+ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
 libs:: updater.png
 	$(NSINSTALL) -D $(DIST)/bin/icons
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/icons
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 libs::
 	$(NSINSTALL) -D $(DIST)/bin/updater.app
--- a/toolkit/mozapps/update/updater/updater-common.build
+++ b/toolkit/mozapps/update/updater/updater-common.build
@@ -119,11 +119,11 @@ DELAYLOAD_DLLS += [
     'wsock32.dll',
 ]
 
 if CONFIG['_MSC_VER']:
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 elif CONFIG['OS_ARCH'] == 'WINNT':
     WIN32_EXE_LDFLAGS += ['-municode']
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
     OS_LIBS += CONFIG['TK_LIBS']
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -172,15 +172,15 @@ if CONFIG['MOZ_ENABLE_XREMOTE']:
 
 if CONFIG['MOZ_B2G_LOADER']:
     DEFINES['OMNIJAR_NAME'] = CONFIG['OMNIJAR_NAME']
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 DEFINES['TOPOBJDIR'] = TOPOBJDIR
 FINAL_TARGET_PP_FILES += [
     'platform.ini'
 ]
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -150,13 +150,13 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../build',
     '/xpcom/ds',
 ]
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -49,10 +49,10 @@ LOCAL_INCLUDES += [
     '../base',
     '../build',
     '../ds',
     '../reflect/xptinfo',
     '/chrome',
     '/modules/libjar',
 ]
 
-if CONFIG['MOZ_WIDGET_GTK']:
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']