Bug 1357323 - Remove support for gonk in the build system. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 18 Apr 2017 16:56:09 +0900
changeset 353804 cd9ef901306228b25a79b6e4f2d0d1046e829cbc
parent 353803 cc4fc5f57503e0048ad6d6c217b1f764db7c492b
child 353805 38282f1273bbc623dfde5391de002d0c397756fd
push id31680
push userkwierso@gmail.com
push dateWed, 19 Apr 2017 23:57:00 +0000
treeherdermozilla-central@e9a5d4f62461 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1357323, 1357326
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1357323 - Remove support for gonk in the build system. r=gps Everything depending on the widget being gonk can go away, as well as everything depending on MOZ_AUDIO_CHANNEL_MANAGER, which was only defined on gonk builds under b2g/ (which goes away in bug 1357326).
addon-sdk/moz.build
build/gyp.mozbuild
build/gyp_base.mozbuild
dom/base/moz.build
dom/bindings/moz.build
dom/events/moz.build
dom/geolocation/moz.build
dom/ipc/moz.build
dom/media/encoder/moz.build
dom/media/platforms/omx/moz.build
dom/media/systemservices/moz.build
dom/network/interfaces/moz.build
dom/network/moz.build
dom/secureelement/moz.build
dom/system/moz.build
dom/webidl/moz.build
hal/moz.build
ipc/app/moz.build
ipc/chromium/moz.build
ipc/moz.build
layout/build/moz.build
media/libcubeb/src/moz.build
media/mtransport/test/moz.build
media/omx-plugin/lib/ics/libstagefright/moz.build
media/omx-plugin/lib/ics/libutils/moz.build
media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build
media/omx-plugin/moz.build
mozglue/build/moz.build
netwerk/base/moz.build
netwerk/dns/mdns/libmdns/moz.build
netwerk/wifi/moz.build
python/mozbuild/mozbuild/backend/cpp_eclipse.py
python/mozbuild/mozbuild/base.py
python/mozbuild/mozbuild/mozinfo.py
python/mozbuild/mozbuild/test/test_testing.py
security/sandbox/linux/broker/moz.build
testing/marionette/harness/marionette_harness/tests/webapi-tests.ini
toolkit/crashreporter/breakpad-client/linux/moz.build
toolkit/library/moz.build
toolkit/moz.configure
tools/profiler/moz.build
uriloader/exthandler/moz.build
widget/moz.build
xpcom/threads/moz.build
--- a/addon-sdk/moz.build
+++ b/addon-sdk/moz.build
@@ -68,118 +68,117 @@ TEST_HARNESS_FILES.testing.mochitest['je
 EXTRA_JS_MODULES.sdk += [
     'source/app-extension/bootstrap.js',
 ]
 
 EXTRA_JS_MODULES.sdk.system += [
     'source/modules/system/Startup.js',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != "gonk":
-    EXTRA_JS_MODULES.commonjs.method.test += [
-        'source/lib/method/test/browser.js',
-        'source/lib/method/test/common.js',
-    ]
+EXTRA_JS_MODULES.commonjs.method.test += [
+    'source/lib/method/test/browser.js',
+    'source/lib/method/test/common.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.deprecated += [
-        'source/lib/sdk/deprecated/api-utils.js',
-        'source/lib/sdk/deprecated/sync-worker.js',
-        'source/lib/sdk/deprecated/unit-test-finder.js',
-        'source/lib/sdk/deprecated/unit-test.js',
-        'source/lib/sdk/deprecated/window-utils.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.deprecated += [
+    'source/lib/sdk/deprecated/api-utils.js',
+    'source/lib/sdk/deprecated/sync-worker.js',
+    'source/lib/sdk/deprecated/unit-test-finder.js',
+    'source/lib/sdk/deprecated/unit-test.js',
+    'source/lib/sdk/deprecated/window-utils.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.frame += [
-        'source/lib/sdk/frame/hidden-frame.js',
-        'source/lib/sdk/frame/utils.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.frame += [
+    'source/lib/sdk/frame/hidden-frame.js',
+    'source/lib/sdk/frame/utils.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.panel += [
-        'source/lib/sdk/panel/events.js',
-        'source/lib/sdk/panel/utils.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.panel += [
+    'source/lib/sdk/panel/events.js',
+    'source/lib/sdk/panel/utils.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.places += [
-        'source/lib/sdk/places/bookmarks.js',
-        'source/lib/sdk/places/contract.js',
-        'source/lib/sdk/places/events.js',
-        'source/lib/sdk/places/favicon.js',
-        'source/lib/sdk/places/history.js',
-        'source/lib/sdk/places/utils.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.places += [
+    'source/lib/sdk/places/bookmarks.js',
+    'source/lib/sdk/places/contract.js',
+    'source/lib/sdk/places/events.js',
+    'source/lib/sdk/places/favicon.js',
+    'source/lib/sdk/places/history.js',
+    'source/lib/sdk/places/utils.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.places.host += [
-        'source/lib/sdk/places/host/host-bookmarks.js',
-        'source/lib/sdk/places/host/host-query.js',
-        'source/lib/sdk/places/host/host-tags.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.places.host += [
+    'source/lib/sdk/places/host/host-bookmarks.js',
+    'source/lib/sdk/places/host/host-query.js',
+    'source/lib/sdk/places/host/host-tags.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.tabs += [
-        'source/lib/sdk/tabs/common.js',
-        'source/lib/sdk/tabs/events.js',
-        'source/lib/sdk/tabs/helpers.js',
-        'source/lib/sdk/tabs/namespace.js',
-        'source/lib/sdk/tabs/observer.js',
-        'source/lib/sdk/tabs/tab-fennec.js',
-        'source/lib/sdk/tabs/tab-firefox.js',
-        'source/lib/sdk/tabs/tab.js',
-        'source/lib/sdk/tabs/tabs-firefox.js',
-        'source/lib/sdk/tabs/utils.js',
-        'source/lib/sdk/tabs/worker.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.tabs += [
+    'source/lib/sdk/tabs/common.js',
+    'source/lib/sdk/tabs/events.js',
+    'source/lib/sdk/tabs/helpers.js',
+    'source/lib/sdk/tabs/namespace.js',
+    'source/lib/sdk/tabs/observer.js',
+    'source/lib/sdk/tabs/tab-fennec.js',
+    'source/lib/sdk/tabs/tab-firefox.js',
+    'source/lib/sdk/tabs/tab.js',
+    'source/lib/sdk/tabs/tabs-firefox.js',
+    'source/lib/sdk/tabs/utils.js',
+    'source/lib/sdk/tabs/worker.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.test += [
-        'source/lib/sdk/test/assert.js',
-        'source/lib/sdk/test/harness.js',
-        'source/lib/sdk/test/httpd.js',
-        'source/lib/sdk/test/loader.js',
-        'source/lib/sdk/test/memory.js',
-        'source/lib/sdk/test/options.js',
-        'source/lib/sdk/test/runner.js',
-        'source/lib/sdk/test/utils.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.test += [
+    'source/lib/sdk/test/assert.js',
+    'source/lib/sdk/test/harness.js',
+    'source/lib/sdk/test/httpd.js',
+    'source/lib/sdk/test/loader.js',
+    'source/lib/sdk/test/memory.js',
+    'source/lib/sdk/test/options.js',
+    'source/lib/sdk/test/runner.js',
+    'source/lib/sdk/test/utils.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.ui += [
-        'source/lib/sdk/ui/component.js',
-        'source/lib/sdk/ui/frame.js',
-        'source/lib/sdk/ui/id.js',
-        'source/lib/sdk/ui/sidebar.js',
-        'source/lib/sdk/ui/state.js',
-        'source/lib/sdk/ui/toolbar.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.ui += [
+    'source/lib/sdk/ui/component.js',
+    'source/lib/sdk/ui/frame.js',
+    'source/lib/sdk/ui/id.js',
+    'source/lib/sdk/ui/sidebar.js',
+    'source/lib/sdk/ui/state.js',
+    'source/lib/sdk/ui/toolbar.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.ui.button += [
-        'source/lib/sdk/ui/button/action.js',
-        'source/lib/sdk/ui/button/contract.js',
-        'source/lib/sdk/ui/button/toggle.js',
-        'source/lib/sdk/ui/button/view.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.ui.button += [
+    'source/lib/sdk/ui/button/action.js',
+    'source/lib/sdk/ui/button/contract.js',
+    'source/lib/sdk/ui/button/toggle.js',
+    'source/lib/sdk/ui/button/view.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.ui.sidebar += [
-        'source/lib/sdk/ui/sidebar/actions.js',
-        'source/lib/sdk/ui/sidebar/contract.js',
-        'source/lib/sdk/ui/sidebar/namespace.js',
-        'source/lib/sdk/ui/sidebar/utils.js',
-        'source/lib/sdk/ui/sidebar/view.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.ui.sidebar += [
+    'source/lib/sdk/ui/sidebar/actions.js',
+    'source/lib/sdk/ui/sidebar/contract.js',
+    'source/lib/sdk/ui/sidebar/namespace.js',
+    'source/lib/sdk/ui/sidebar/utils.js',
+    'source/lib/sdk/ui/sidebar/view.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.window += [
-        'source/lib/sdk/window/browser.js',
-        'source/lib/sdk/window/events.js',
-        'source/lib/sdk/window/helpers.js',
-        'source/lib/sdk/window/namespace.js',
-        'source/lib/sdk/window/utils.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.window += [
+    'source/lib/sdk/window/browser.js',
+    'source/lib/sdk/window/events.js',
+    'source/lib/sdk/window/helpers.js',
+    'source/lib/sdk/window/namespace.js',
+    'source/lib/sdk/window/utils.js',
+]
 
-    EXTRA_JS_MODULES.commonjs.sdk.windows += [
-        'source/lib/sdk/windows/fennec.js',
-        'source/lib/sdk/windows/firefox.js',
-        'source/lib/sdk/windows/observer.js',
-        'source/lib/sdk/windows/tabs-fennec.js',
-    ]
+EXTRA_JS_MODULES.commonjs.sdk.windows += [
+    'source/lib/sdk/windows/fennec.js',
+    'source/lib/sdk/windows/firefox.js',
+    'source/lib/sdk/windows/observer.js',
+    'source/lib/sdk/windows/tabs-fennec.js',
+]
 
 EXTRA_JS_MODULES.commonjs += [
     'source/lib/index.js',
     'source/lib/test.js',
 ]
 
 EXTRA_JS_MODULES.commonjs.sdk += [
     'source/lib/sdk/webextension.js',
@@ -537,9 +536,9 @@ EXTRA_JS_MODULES.commonjs.sdk.zip += [
 ]
 
 EXTRA_JS_MODULES.commonjs.toolkit += [
     'source/lib/toolkit/loader.js',
     'source/lib/toolkit/require.js',
 ]
 
 with Files("**"):
-    BUG_COMPONENT = ("Add-on SDK", "General")
\ No newline at end of file
+    BUG_COMPONENT = ("Add-on SDK", "General")
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -72,28 +72,21 @@ gyp_vars.update({
     'include_ilbc': 0,
     # We turn on ISAC because the AGC uses parts of it, and depend on the
     # linker to throw away uneeded bits.
     'include_isac': 1,
     'include_pcm16b': 1,
 })
 
 if os == 'Android':
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-        gyp_vars['build_with_gonk'] = 1
-        gyp_vars['moz_widget_toolkit_gonk'] = 1
-        gyp_vars['opus_complexity'] = 1
-        if int(CONFIG['ANDROID_VERSION']) >= 18:
-          gyp_vars['moz_webrtc_omx'] = 1
-    else:
-        gyp_vars.update(
-            gtest_target_type='executable',
-            moz_webrtc_mediacodec=1,
-            android_toolchain=CONFIG.get('ANDROID_TOOLCHAIN', ''),
-        )
+    gyp_vars.update(
+        gtest_target_type='executable',
+        moz_webrtc_mediacodec=1,
+        android_toolchain=CONFIG.get('ANDROID_TOOLCHAIN', ''),
+    )
 
 if CONFIG['ARM_ARCH']:
     if int(CONFIG['ARM_ARCH']) < 7:
         gyp_vars['armv7'] = 0
         gyp_vars['arm_neon_optional'] = 0
     elif os == 'Android':
         gyp_vars['armv7'] = 1
     else:
--- a/build/gyp_base.mozbuild
+++ b/build/gyp_base.mozbuild
@@ -11,17 +11,17 @@ os = CONFIG['OS_TARGET']
 if os == 'WINNT':
     gyp_vars.update(
         MSVS_VERSION=CONFIG['_MSVS_VERSION'],
         MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
     )
 
 flavors = {
     'WINNT': 'win',
-    'Android': 'linux' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' else 'android',
+    'Android': 'android',
     'Linux': 'linux',
     'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
     'SunOS': 'solaris',
     'GNU/kFreeBSD': 'freebsd',
     'DragonFly': 'dragonfly',
     'FreeBSD': 'freebsd',
     'NetBSD': 'netbsd',
     'OpenBSD': 'openbsd',
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -454,21 +454,16 @@ LOCAL_INCLUDES += [
     '/layout/svg',
     '/layout/xul',
     '/netwerk/base',
     '/security/manager/ssl',
     '/widget',
     '/xpcom/ds',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    LOCAL_INCLUDES += [
-        '../system/gonk',
-    ]
-
 if CONFIG['MOZ_WEBRTC']:
     LOCAL_INCLUDES += [
         '/netwerk/sctp/datachannel',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -135,21 +135,16 @@ if CONFIG['MOZ_DEBUG']:
         "test/TestInterfaceMaplike.cpp",
         "test/TestInterfaceMaplikeObject.cpp",
         "test/TestInterfaceSetlike.cpp",
         "test/TestInterfaceSetlikeNode.cpp",
         ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
-if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
-    LOCAL_INCLUDES += [
-        '/dom/system/gonk',
-    ]
-
 FINAL_LIBRARY = 'xul'
 
 SPHINX_TREES['webidl'] = 'docs'
 SPHINX_PYTHON_PACKAGE_DIRS += ['mozwebidlcodegen']
 
 if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
     # This is needed for Window.webidl
     DEFINES['HAVE_SIDEBAR'] = True
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -148,15 +148,10 @@ LOCAL_INCLUDES += [
     '/dom/xml',
     '/dom/xul',
     '/js/xpconnect/wrappers',
     '/layout/generic',
     '/layout/xul',
     '/layout/xul/tree/',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    LOCAL_INCLUDES += [
-        '/dom/wifi',
-    ]
-
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-error=shadow']
--- a/dom/geolocation/moz.build
+++ b/dom/geolocation/moz.build
@@ -28,20 +28,16 @@ LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/ipc',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     LOCAL_INCLUDES += [
         '/dom/system/android',
     ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    LOCAL_INCLUDES += [
-        '/dom/system/gonk',
-    ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '/dom/system/mac',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/dom/system/windows',
     ]
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -152,17 +152,17 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_
 
 if CONFIG['OS_ARCH'] != 'WINNT':
     LOCAL_INCLUDES += [
         '/modules/libjar',
     ]
 
 DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2'):
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
 if CONFIG['MOZ_TOOLKIT_SEARCH']:
     DEFINES['MOZ_TOOLKIT_SEARCH'] = True
 
 JAR_MANIFESTS += ['jar.mn']
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
--- a/dom/media/encoder/moz.build
+++ b/dom/media/encoder/moz.build
@@ -2,19 +2,16 @@
 # 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/.
 
 with Files('*'):
     BUG_COMPONENT = ('Core', 'Audio/Video: Recording')
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    DIRS += ['fmp4_muxer']
-
 EXPORTS += [
     'ContainerWriter.h',
     'EncodedFrameContainer.h',
     'MediaEncoder.h',
     'OpusTrackEncoder.h',
     'TrackEncoder.h',
     'TrackMetadataBase.h',
 ]
@@ -32,25 +29,15 @@ if CONFIG['MOZ_WEBM_ENCODER']:
     ]
     LOCAL_INCLUDES += ['/media/libyuv/libyuv/include']
 
 FINAL_LIBRARY = 'xul'
 
 # These includes are from Android JB, for use of MediaCodec.
 LOCAL_INCLUDES += ['/ipc/chromium/src']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] > '15':
-    LOCAL_INCLUDES += [
-        '%' + '%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
-            'frameworks/av/include/media',
-            'frameworks/native/include',
-            'frameworks/native/opengl/include',
-        ]
-
-    ]
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
 # Suppress some GCC warnings being treated as errors:
 #  - about attributes on forward declarations for types that are already
 #    defined, which complains about an important MOZ_EXPORT for android::AString
 if CONFIG['GNU_CC']:
   CXXFLAGS += ['-Wno-error=attributes']
--- a/dom/media/platforms/omx/moz.build
+++ b/dom/media/platforms/omx/moz.build
@@ -16,39 +16,16 @@ UNIFIED_SOURCES += [
 ]
 
 LOCAL_INCLUDES += [
     '/media/openmax_il/il112',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and (CONFIG['ANDROID_VERSION'] == '19' or CONFIG['ANDROID_VERSION'] == '20'):
-    # Suppress some GCC/clang warnings being treated as errors:
-    #  - about attributes on forward declarations for types that are already
-    #    defined, which complains about an important MOZ_EXPORT for android::AString
-    #  - about multi-character constants which are used in codec-related code
-    if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
-        CXXFLAGS += [
-          '-Wno-error=attributes',
-          '-Wno-error=multichar'
-        ]
-    CXXFLAGS += [
-        '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
-            'frameworks/base/include/binder',
-            'frameworks/base/include/utils',
-        ]
-    ]
-    UNIFIED_SOURCES += [
-        'GonkOmxPlatformLayer.cpp',
-    ]
-    EXTRA_DSO_LDOPTS += [
-        '-libbinder',
-    ]
-
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-error=shadow']
 
 if CONFIG['_MSC_VER']:
     # Avoid warnings from third-party code that we can not modify.
     if CONFIG['CLANG_CL']:
--- a/dom/media/systemservices/moz.build
+++ b/dom/media/systemservices/moz.build
@@ -44,26 +44,16 @@ if CONFIG['OS_TARGET'] == 'Android':
     UNIFIED_SOURCES += [
         'OpenSLESProvider.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
   UNIFIED_SOURCES += ['OSXRunLoopSingleton.cpp']
   EXPORTS += ['OSXRunLoopSingleton.h']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    if CONFIG['ANDROID_VERSION'] >= '17':
-        LOCAL_INCLUDES += [
-            '%' + '%s/frameworks/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
-        ]
-    else:
-        LOCAL_INCLUDES += [
-            '%' + '%s/system/media/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
-        ]
-
 if CONFIG['_MSC_VER']:
     DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
 
     # This is intended as a temporary workaround to enable building with VS2015.
     # media\webrtc\trunk\webrtc/base/criticalsection.h(59): warning C4312:
     # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     CXXFLAGS += ['-wd4312']
 
--- a/dom/network/interfaces/moz.build
+++ b/dom/network/interfaces/moz.build
@@ -5,14 +5,9 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
     'nsIMozNavigatorNetwork.idl',
     'nsITCPSocketCallback.idl',
     'nsIUDPSocketChild.idl',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    XPIDL_SOURCES += [
-        'nsIEthernetManager.idl',
-    ]
-
 XPIDL_MODULE = 'dom_network'
--- a/dom/network/moz.build
+++ b/dom/network/moz.build
@@ -40,28 +40,16 @@ UNIFIED_SOURCES += [
     'TCPSocket.cpp',
     'TCPSocketChild.cpp',
     'TCPSocketParent.cpp',
     'UDPSocket.cpp',
     'UDPSocketChild.cpp',
     'UDPSocketParent.cpp',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    EXTRA_COMPONENTS += [
-        'EthernetManager.js',
-        'EthernetManager.manifest',
-    ]
-    EXPORTS.mozilla.dom.network += [
-        'NetUtils.h',
-    ]
-    UNIFIED_SOURCES += [
-        'NetUtils.cpp',
-    ]
-
 IPDL_SOURCES += [
     'PTCPServerSocket.ipdl',
     'PTCPSocket.ipdl',
     'PUDPSocket.ipdl',
 ]
 
 LOCAL_INCLUDES += [
     '../workers',
--- a/dom/secureelement/moz.build
+++ b/dom/secureelement/moz.build
@@ -9,36 +9,8 @@
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM: Device Interfaces")
 
 if CONFIG['MOZ_SECUREELEMENT']:
     EXTRA_COMPONENTS += [
         'DOMSecureElement.js',
         'DOMSecureElement.manifest',
     ]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_SECUREELEMENT']:
-    EXTRA_COMPONENTS += [
-        'gonk/ACEService.js',
-        'gonk/ACEService.manifest',
-        'gonk/GPAccessRulesManager.js',
-        'gonk/GPAccessRulesManager.manifest',
-        'gonk/SecureElement.js',
-        'gonk/SecureElement.manifest',
-    ]
-    XPIDL_MODULE = 'dom_secureelement'
-    XPIDL_SOURCES += [
-        'gonk/nsIAccessControlEnforcer.idl',
-        'gonk/nsIAccessRulesManager.idl',
-        'gonk/nsISecureElementConnector.idl',
-    ]
-    EXTRA_JS_MODULES += [
-        'gonk/gp_consts.js',
-        'gonk/se_consts.js',
-        'SEUtils.jsm'
-    ]
-    XPCSHELL_TESTS_MANIFESTS += [
-        'tests/unit/xpcshell.ini'
-    ]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
--- a/dom/system/moz.build
+++ b/dom/system/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; 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/.
 
 # This picks up *hapticfeedback* which is graveyard
-# This picks up gonk/* which is also not supported?
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM")
 
 with Files("*OSFile*"):
     BUG_COMPONENT = ("Toolkit", "OS.File")
 
 with Files("*ocationProvider*"):
     BUG_COMPONENT = ("Core", "Geolocation")
@@ -42,18 +41,16 @@ with Files("tests/*1197901*"):
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
 if toolkit == 'windows':
     DIRS += ['windows']
 elif toolkit == 'cocoa':
     DIRS += ['mac']
 elif toolkit == 'android':
     DIRS += ['android']
-elif toolkit == 'gonk':
-    DIRS += ['gonk']
 elif toolkit in ('gtk2', 'gtk3'):
     DIRS += ['linux']
 
 XPIDL_SOURCES += [
     'nsIOSFileConstantsService.idl',
 ]
 
 XPIDL_MODULE = 'dom_system'
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -1043,20 +1043,19 @@ if CONFIG['MOZ_DEBUG']:
                      'TestInterfaceJSMaplikeSetlikeIterable.webidl']
 
 if CONFIG['MOZ_SECUREELEMENT']:
     WEBIDL_FILES += [
          'SecureElement.webidl',
          'SecureElementManager.webidl',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-    WEBIDL_FILES += [
-        'InstallTrigger.webidl',
-    ]
+WEBIDL_FILES += [
+    'InstallTrigger.webidl',
+]
 
 if CONFIG['FUZZING']:
     WEBIDL_FILES += [
         'FuzzingFunctions.webidl',
     ]
 
 GENERATED_EVENTS_WEBIDL_FILES = [
     'AddonEvent.webidl',
--- a/hal/moz.build
+++ b/hal/moz.build
@@ -46,34 +46,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
         'android/AndroidSensor.cpp',
         'fallback/FallbackPower.cpp',
         'linux/LinuxMemory.cpp',
     ]
     # AndroidHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
     SOURCES += [
         'android/AndroidHal.cpp',
     ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    UNIFIED_SOURCES += [
-        'gonk/GonkDiskSpaceWatcher.cpp',
-        'gonk/GonkSensor.cpp',
-        'gonk/GonkSensorsHelpers.cpp',
-        'gonk/GonkSensorsInterface.cpp',
-        'gonk/GonkSensorsPollInterface.cpp',
-        'gonk/GonkSensorsRegistryInterface.cpp',
-        'gonk/GonkSwitch.cpp',
-        'gonk/SystemService.cpp',
-        'gonk/UeventPoller.cpp',
-        'linux/LinuxMemory.cpp',
-        'linux/LinuxPower.cpp',
-    ]
-    # GonkHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
-    SOURCES += [
-        'gonk/GonkHal.cpp',
-    ]
 elif CONFIG['OS_TARGET'] == 'Linux':
     UNIFIED_SOURCES += [
         'fallback/FallbackScreenConfiguration.cpp',
         'fallback/FallbackSensor.cpp',
         'fallback/FallbackVibration.cpp',
         'linux/LinuxMemory.cpp',
         'linux/LinuxPower.cpp',
     ]
@@ -127,28 +109,27 @@ else:
         'fallback/FallbackMemory.cpp',
         'fallback/FallbackPower.cpp',
         'fallback/FallbackScreenConfiguration.cpp',
         'fallback/FallbackSensor.cpp',
         'fallback/FallbackVibration.cpp',
     ]
 
 # Fallbacks for backends implemented on Gonk only.
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-    UNIFIED_SOURCES += [
-        'fallback/FallbackDiskSpaceWatcher.cpp',
-        'fallback/FallbackFactoryReset.cpp',
-        'fallback/FallbackProcessPriority.cpp',
-        'fallback/FallbackScreenPower.cpp',
-        'fallback/FallbackSwitch.cpp',
-        'fallback/FallbackSystemService.cpp',
-        'fallback/FallbackThreadPriority.cpp',
-        'fallback/FallbackTime.cpp',
-        'fallback/FallbackWakeLocks.cpp',
-    ]
+UNIFIED_SOURCES += [
+    'fallback/FallbackDiskSpaceWatcher.cpp',
+    'fallback/FallbackFactoryReset.cpp',
+    'fallback/FallbackProcessPriority.cpp',
+    'fallback/FallbackScreenPower.cpp',
+    'fallback/FallbackSwitch.cpp',
+    'fallback/FallbackSystemService.cpp',
+    'fallback/FallbackThreadPriority.cpp',
+    'fallback/FallbackTime.cpp',
+    'fallback/FallbackWakeLocks.cpp',
+]
 
 # Fallbacks for backends implemented on Android only.
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     UNIFIED_SOURCES += [
         'fallback/FallbackNetwork.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
@@ -164,22 +145,12 @@ IPDL_SOURCES = [
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    # So that we can call nsScreenManagerGonk::GetConfiguration().
-    LOCAL_INCLUDES += [
-        '/widget',
-        '/widget/gonk',
-    ]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    LOCAL_INCLUDES += ['%' + '%s/hardware/libhardware_legacy/include' % CONFIG['ANDROID_SOURCE']]
-
 CFLAGS += CONFIG['GLIB_CFLAGS']
 CFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 CXXFLAGS += CONFIG['GLIB_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -76,21 +76,15 @@ if CONFIG['_MSC_VER']:
 #
 # The default heap size is 1MB on Win32.
 # The heap will grow if need be.
 #
 # Set it to 256k.  See bug 127069.
 if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
     LDFLAGS += ['/HEAP:0x40000']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    OS_LIBS += [
-        'binder',
-        'utils',
-    ]
-
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
 
 DEFINES['MOZ_PLUGIN_CONTAINER'] = 1;
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM: Content Processes")
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -130,18 +130,16 @@ if os_linux:
         'src/base/time_posix.cc',
     ]
     if CONFIG['OS_TARGET'] == 'Android':
         UNIFIED_SOURCES += [
             'src/base/message_pump_android.cc',
         ]
         DEFINES['ANDROID'] = True
         DEFINES['_POSIX_MONOTONIC_CLOCK'] = 0
-        if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-            DEFINES['HAVE_ANDROID_OS'] = True
 
 if os_bsd or os_linux:
     if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
         SOURCES += [
             'src/base/message_pump_glib.cc',
         ]
 
 ost = CONFIG['OS_TEST']
--- a/ipc/moz.build
+++ b/ipc/moz.build
@@ -9,24 +9,18 @@ DIRS += [
     'glue',
     'ipdl',
     'testshell',
 ]
 
 if CONFIG['MOZ_ENABLE_DBUS']:
     DIRS += ['dbus']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    DIRS += ['unixfd', 'unixsocket']
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    DIRS += ['hal', 'netd']
-
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     DIRS += ['contentproc']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['mscom']
 
 DIRS += ['app']
 
-with Files("**"):
-    BUG_COMPONENT = ("Core", "IPC")
+with Files("**"):
+    BUG_COMPONENT = ("Core", "IPC")
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
@@ -69,20 +69,16 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
     LOCAL_INCLUDES += [
         '/dom/system/mac',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     LOCAL_INCLUDES += [
         '/dom/system',
         '/dom/system/android',
     ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    LOCAL_INCLUDES += [
-        '/dom/system/gonk',
-    ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     LOCAL_INCLUDES += [
         '/dom/media/webspeech/recognition',
         '/dom/media/webspeech/synth',
     ]
 
 if CONFIG['MOZ_WEBSPEECH_POCKETSPHINX']:
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -26,18 +26,16 @@ if CONFIG['MOZ_PULSEAUDIO'] or CONFIG['M
         'cubeb_resampler.cpp',
     ]
 
 if CONFIG['MOZ_PULSEAUDIO']:
     SOURCES += [
         'cubeb_pulse.c',
     ]
     DEFINES['USE_PULSE'] = True
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-        DEFINES['DISABLE_LIBPULSE_DLOPEN'] = True
 
 if CONFIG['MOZ_JACK']:
     SOURCES += [
         'cubeb_jack.cpp',
     ]
     USE_LIBS += [
         'speex',
     ]
@@ -73,31 +71,20 @@ if CONFIG['OS_TARGET'] == 'WINNT':
     ]
     if CONFIG['_MSC_VER']:
         CXXFLAGS += ['-wd4005'] # C4005: '_USE_MATH_DEFINES' : macro redefinition
 
 if CONFIG['OS_TARGET'] == 'Android':
     SOURCES += ['cubeb_opensl.c']
     SOURCES += ['cubeb_resampler.cpp']
     DEFINES['USE_OPENSL'] = True
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-        SOURCES += [
-            'cubeb_audiotrack.c',
-        ]
-        DEFINES['USE_AUDIOTRACK'] = True
+    SOURCES += [
+        'cubeb_audiotrack.c',
+    ]
+    DEFINES['USE_AUDIOTRACK'] = True
 
 FINAL_LIBRARY = 'gkmedias'
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    if CONFIG['ANDROID_VERSION'] >= '17':
-        LOCAL_INCLUDES += [
-            '%' + '%s/frameworks/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
-        ]
-    else:
-        LOCAL_INCLUDES += [
-            '%' + '%s/system/media/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
-        ]
-
 CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
 CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
 
 # We allow warnings for third-party code that can be updated from upstream.
 ALLOW_COMPILER_WARNINGS = True
--- a/media/mtransport/test/moz.build
+++ b/media/mtransport/test/moz.build
@@ -1,15 +1,15 @@
 # -*- Mode: python; 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['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
+if CONFIG['OS_TARGET'] != 'WINNT':
     SOURCES += [
         'buffered_stun_socket_unittest.cpp',
         'ice_unittest.cpp',
         'multi_tcp_socket_unittest.cpp',
         'nrappkit_unittest.cpp',
         'proxy_tunnel_socket_unittest.cpp',
         'rlogconnector_unittest.cpp',
         'runnable_utils_unittest.cpp',
--- a/media/omx-plugin/lib/ics/libstagefright/moz.build
+++ b/media/omx-plugin/lib/ics/libstagefright/moz.build
@@ -1,23 +1,22 @@
 # -*- Mode: python; 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/.
 DIST_INSTALL = False
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-    SOURCES += [
-        'libstagefright.cpp',
-    ]
-    # Some codec-related code uses multi-character constants; allow this.
-    # XXX: could instead use the FOURCC macro to define these constants.
-    if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
-        SOURCES['libstagefright.cpp'].flags += ['-Wno-error=multichar']
+SOURCES += [
+    'libstagefright.cpp',
+]
+# Some codec-related code uses multi-character constants; allow this.
+# XXX: could instead use the FOURCC macro to define these constants.
+if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
+    SOURCES['libstagefright.cpp'].flags += ['-Wno-error=multichar']
 
 SharedLibrary('stagefright')
 
 LOCAL_INCLUDES += [
     '/media/omx-plugin/include/ics',
     '/media/omx-plugin/include/ics/media/stagefright/openmax',
 ]
 
--- a/media/omx-plugin/lib/ics/libutils/moz.build
+++ b/media/omx-plugin/lib/ics/libutils/moz.build
@@ -1,19 +1,18 @@
 # -*- Mode: python; 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/.
 DIST_INSTALL = False
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-    SOURCES += [
-        'libutils.cpp',
-    ]
+SOURCES += [
+    'libutils.cpp',
+]
 
 SharedLibrary('utils')
 
 LOCAL_INCLUDES += [
     '/media/omx-plugin/include/ics',
     '/media/omx-plugin/include/ics/media/stagefright/openmax',
 ]
 
--- a/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build
+++ b/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build
@@ -1,19 +1,18 @@
 # -*- Mode: python; 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/.
 DIST_INSTALL = False
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-    SOURCES += [
-        'libvideoeditorplayer.cpp',
-    ]
+SOURCES += [
+    'libvideoeditorplayer.cpp',
+]
 
 SharedLibrary('videoeditorplayer')
 
 # Don't use STL wrappers; this isn't Gecko code
 DISABLE_STL_WRAPPING = True
 NO_VISIBILITY_FLAGS = True
 
 LOCAL_INCLUDES += [
--- a/media/omx-plugin/moz.build
+++ b/media/omx-plugin/moz.build
@@ -18,44 +18,29 @@ with Files("**"):
     BUG_COMPONENT = ("Core", "Audio/Video: Playback")
 
 SOURCES += [
     'OmxPlugin.cpp',
 ]
 
 SharedLibrary('omxplugin')
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    pass
-else:
-    LOCAL_INCLUDES += [
-        'include/ics',
-        'include/ics/media/stagefright/openmax',
-    ]
+LOCAL_INCLUDES += [
+    'include/ics',
+    'include/ics/media/stagefright/openmax',
+]
 
 if CONFIG['GNU_CXX']:
     # Stagefright header files define many multichar constants.
     CXXFLAGS += [
         '-Wno-multichar',
         '-Wno-shadow',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    EXTRA_DSO_LDOPTS += [
-        '-lutils',
-        '-lstagefright',
-        '-lmedia',
-        '-lstagefright_omx',
-        '-lbinder',
-        '-lui',
-        '-lhardware',
-        '-lcutils',
-    ]
-else:
-    USE_LIBS += [
-        '/media/omx-plugin/lib/ics/libstagefright/stagefright',
-        '/media/omx-plugin/lib/ics/libutils/utils',
-        'videoeditorplayer',
-    ]
+USE_LIBS += [
+    '/media/omx-plugin/lib/ics/libstagefright/stagefright',
+    '/media/omx-plugin/lib/ics/libutils/utils',
+    'videoeditorplayer',
+]
 
 # Don't use STL wrappers; this isn't Gecko code
 DISABLE_STL_WRAPPING = True
 NO_VISIBILITY_FLAGS = True
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -74,21 +74,16 @@ if not CONFIG['JS_STANDALONE']:
             'mips.cpp',
         ]
 
     if CONFIG['MOZ_LINKER']:
         USE_LIBS += [
             'zlib',
         ]
 
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-        SOURCES += [
-            'cpuacct.c',
-        ]
-
 USE_LIBS += [
     'mfbt',
 ]
 
 DEFINES['IMPL_MFBT'] = True
 LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
 
 LDFLAGS += CONFIG['MOZ_GLUE_WRAP_LDFLAGS']
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -175,21 +175,16 @@ EXPORTS.mozilla.net += [
     'ChannelDiverterParent.h',
     'Dashboard.h',
     'DashboardTypes.h',
     'MemoryDownloader.h',
     'Predictor.h',
     'ReferrerPolicy.h',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    EXPORTS += [
-        'NetStatistics.h',
-    ]
-
 UNIFIED_SOURCES += [
     'ArrayBufferInputStream.cpp',
     'BackgroundFileSaver.cpp',
     'CaptivePortalService.cpp',
     'ChannelDiverterChild.cpp',
     'ChannelDiverterParent.cpp',
     'Dashboard.cpp',
     'EventTokenBucket.cpp',
--- a/netwerk/dns/mdns/libmdns/moz.build
+++ b/netwerk/dns/mdns/libmdns/moz.build
@@ -1,33 +1,25 @@
 # -*- Mode: python; 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_TOOLKIT'] == 'cocoa' or \
-        (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] >= '16'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
         'MDNSResponderOperator.cpp',
         'MDNSResponderReply.cpp',
         'nsDNSServiceDiscovery.cpp',
     ]
 
     LOCAL_INCLUDES += [
       '/netwerk/base',
     ]
 
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-        LOCAL_INCLUDES += [
-            '%' + '%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
-                'external/mdnsresponder/mDNSShared',
-            ]
-        ]
-
 else:
     EXTRA_COMPONENTS += [
         'nsDNSServiceDiscovery.js',
         'nsDNSServiceDiscovery.manifest',
     ]
 
     EXTRA_JS_MODULES += [
         'fallback/DataReader.jsm',
--- a/netwerk/wifi/moz.build
+++ b/netwerk/wifi/moz.build
@@ -9,27 +9,19 @@ XPIDL_SOURCES += [
     'nsIWifiListener.idl',
     'nsIWifiMonitor.idl',
 ]
 
 XPIDL_MODULE = 'necko_wifi'
 
 UNIFIED_SOURCES += [
     'nsWifiAccessPoint.cpp',
+    'nsWifiMonitor.cpp',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    UNIFIED_SOURCES += [
-        'nsWifiMonitorGonk.cpp',
-    ]
-else:
-    UNIFIED_SOURCES += [
-        'nsWifiMonitor.cpp',
-    ]
-
 if CONFIG['OS_ARCH'] == 'Darwin':
     UNIFIED_SOURCES += [
         'nsWifiScannerMac.cpp',
     ]
     SOURCES += [
         'osx_corewlan.mm',
     ]
     # osx_corewlan.mm has warnings about scanForNetworksWithParameters,
--- a/python/mozbuild/mozbuild/backend/cpp_eclipse.py
+++ b/python/mozbuild/mozbuild/backend/cpp_eclipse.py
@@ -178,35 +178,22 @@ class CppEclipseBackend(CommonBackend):
         # TODO Improve binary detection
         if self._macbundle:
             exe_path = os.path.join(bin_dir, self._macbundle, 'Contents/MacOS')
         else:
             exe_path = os.path.join(bin_dir, 'bin')
 
         exe_path = os.path.join(exe_path, self._appname + self._bin_suffix)
 
-        if self.environment.substs['MOZ_WIDGET_TOOLKIT'] != 'gonk':
-            main_gecko_launch = os.path.join(launch_dir, 'gecko.launch')
-            with open(main_gecko_launch, 'wb') as fh:
-                launch = GECKO_LAUNCH_CONFIG_TEMPLATE
-                launch = launch.replace('@LAUNCH_PROGRAM@', exe_path)
-                launch = launch.replace('@LAUNCH_ARGS@', '-P -no-remote')
-                fh.write(launch)
-
-        if self.environment.substs['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-            b2g_flash = os.path.join(launch_dir, 'b2g-flash.launch')
-            with open(b2g_flash, 'wb') as fh:
-                # We assume that the srcdir is inside the b2g tree.
-                # If that's not the case the user can always adjust the path
-                # from the eclipse IDE.
-                fastxul_path = os.path.join(self.environment.topsrcdir, '..', 'scripts', 'fastxul.sh')
-                launch = B2GFLASH_LAUNCH_CONFIG_TEMPLATE
-                launch = launch.replace('@LAUNCH_PROGRAM@', fastxul_path)
-                launch = launch.replace('@OBJDIR@', self.environment.topobjdir)
-                fh.write(launch)
+        main_gecko_launch = os.path.join(launch_dir, 'gecko.launch')
+        with open(main_gecko_launch, 'wb') as fh:
+            launch = GECKO_LAUNCH_CONFIG_TEMPLATE
+            launch = launch.replace('@LAUNCH_PROGRAM@', exe_path)
+            launch = launch.replace('@LAUNCH_ARGS@', '-P -no-remote')
+            fh.write(launch)
 
         #TODO Add more launch configs (and delegate calls to mach)
 
     def _write_project(self, fh):
         project = PROJECT_TEMPLATE;
 
         project = project.replace('@PROJECT_NAME@', self._project_name)
         project = project.replace('@PROJECT_TOPSRCDIR@', self.environment.topsrcdir)
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -730,23 +730,16 @@ class MachCommandConditions(object):
     @staticmethod
     def is_firefox(cls):
         """Must have a Firefox build."""
         if hasattr(cls, 'substs'):
             return cls.substs.get('MOZ_BUILD_APP') == 'browser'
         return False
 
     @staticmethod
-    def is_b2g(cls):
-        """Must have a B2G build."""
-        if hasattr(cls, 'substs'):
-            return cls.substs.get('MOZ_WIDGET_TOOLKIT') == 'gonk'
-        return False
-
-    @staticmethod
     def is_android(cls):
         """Must have an Android build."""
         if hasattr(cls, 'substs'):
             return cls.substs.get('MOZ_WIDGET_TOOLKIT') == 'android'
         return False
 
     @staticmethod
     def is_hg(cls):
--- a/python/mozbuild/mozbuild/mozinfo.py
+++ b/python/mozbuild/mozbuild/mozinfo.py
@@ -32,17 +32,17 @@ def build_dict(config, env=os.environ):
     if config.mozconfig:
         d['mozconfig'] = config.mozconfig
 
     # os
     o = substs["OS_TARGET"]
     known_os = {"Linux": "linux",
                 "WINNT": "win",
                 "Darwin": "mac",
-                "Android": "b2g" if substs.get("MOZ_WIDGET_TOOLKIT") == "gonk" else "android"}
+                "Android": "android"}
     if o in known_os:
         d["os"] = known_os[o]
     else:
         # Allow unknown values, just lowercase them.
         d["os"] = o.lower()
 
     # Widget toolkit, just pass the value directly through.
     d["toolkit"] = substs.get("MOZ_WIDGET_TOOLKIT")
--- a/python/mozbuild/mozbuild/test/test_testing.py
+++ b/python/mozbuild/mozbuild/test/test_testing.py
@@ -73,32 +73,32 @@ ALL_TESTS = {
             "head": "head_update.js",
             "here": "/Users/gps/src/firefox/toolkit/mozapps/update/test/unit",
             "manifest": "/Users/gps/src/firefox/toolkit/mozapps/update/test/unit/xpcshell_updater.ini",
             "name": "test_0201_app_launch_apply_update.js",
             "path": "/Users/gps/src/firefox/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js",
             "reason": "bug 820380",
             "relpath": "test_0201_app_launch_apply_update.js",
             "run-sequentially": "Launches application.",
-            "skip-if": "toolkit == 'gonk' || os == 'android'",
+            "skip-if": "os == 'android'",
         },
         {
             "dir_relpath": "toolkit/mozapps/update/test/unit",
             "file_relpath": "toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js",
             "flavor": "xpcshell",
             "generated-files": "head_update.js",
             "head": "head_update.js head2.js",
             "here": "/Users/gps/src/firefox/toolkit/mozapps/update/test/unit",
             "manifest": "/Users/gps/src/firefox/toolkit/mozapps/update/test/unit/xpcshell_updater.ini",
             "name": "test_0201_app_launch_apply_update.js",
             "path": "/Users/gps/src/firefox/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js",
             "reason": "bug 820380",
             "relpath": "test_0201_app_launch_apply_update.js",
             "run-sequentially": "Launches application.",
-            "skip-if": "toolkit == 'gonk' || os == 'android'",
+            "skip-if": "os == 'android'",
         }
     ],
     "mobile/android/tests/background/junit3/src/common/TestAndroidLogWriters.java": [
         {
             "dir_relpath": "mobile/android/tests/background/junit3/src/common",
             "file_relpath": "mobile/android/tests/background/junit3/src/common/TestAndroidLogWriters.java",
             "flavor": "instrumentation",
             "here": "/Users/nalexander/Mozilla/gecko-dev/mobile/android/tests/background/junit3",
--- a/security/sandbox/linux/broker/moz.build
+++ b/security/sandbox/linux/broker/moz.build
@@ -11,20 +11,16 @@ EXPORTS.mozilla += [
 ]
 
 SOURCES += [
     'SandboxBroker.cpp',
     'SandboxBrokerCommon.cpp',
     'SandboxBrokerPolicyFactory.cpp',
 ]
 
-if CONFIG['OS_TARGET'] == 'Android':
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-        DEFINES['HAVE_ANDROID_OS'] = True
-
 if CONFIG['MOZ_ALSA']:
     DEFINES['MOZ_ALSA'] = True
 
 LOCAL_INCLUDES += [
     '/security/sandbox/linux', # SandboxLogging.h, SandboxInfo.h
 ]
 
 # Need this for mozilla::ipc::FileDescriptor etc.
--- a/testing/marionette/harness/marionette_harness/tests/webapi-tests.ini
+++ b/testing/marionette/harness/marionette_harness/tests/webapi-tests.ini
@@ -1,4 +1,3 @@
-[include:../../../../../dom/system/gonk/tests/marionette/manifest.ini]
 [include:../../../../../dom/events/test/marionette/manifest.ini]
 skip-if = android_version > '15' # Bug 1203075
 [include:../../../../../dom/network/tests/marionette/manifest.ini]
--- a/toolkit/crashreporter/breakpad-client/linux/moz.build
+++ b/toolkit/crashreporter/breakpad-client/linux/moz.build
@@ -32,12 +32,9 @@ if CONFIG['OS_TARGET'] == 'Android':
 ALLOW_COMPILER_WARNINGS = True
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['OS_TARGET'] == 'Android' and CONFIG['CPU_ARCH'] == 'x86':
     # The NDK's user.h defines this struct with a different name.
     DEFINES['user_fpxregs_struct'] = 'user_fxsr_struct'
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    DEFINES['getcontext'] = 'breakpad_getcontext'
-
 include('/toolkit/crashreporter/crashreporter.mozbuild')
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -194,21 +194,16 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'crypt32',
         'shell32',
         'ole32',
         'version',
         'winspool',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    OS_LIBS += [
-        'dbus',
-    ]
-
 if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
     OS_LIBS += [
         'rt',
     ]
 
 OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
 
@@ -237,45 +232,16 @@ if not CONFIG['MOZ_TREE_PIXMAN']:
     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
 
 if CONFIG['MOZ_ALSA']:
     OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
 
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
     OS_LIBS += CONFIG['REALTIME_LIBS']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    OS_LIBS += [
-        'ui',
-        'media',
-        'hardware_legacy',
-        'hardware',
-        'utils',
-        'cutils',
-        'sysutils',
-        'camera_client',
-        'sensorservice',
-        'stagefright',
-        'stagefright_foundation',
-        'stagefright_omx',
-        'binder',
-        'gui',
-        'mtp',
-    ]
-
-    if int(CONFIG['ANDROID_VERSION']) >= 17:
-        OS_LIBS += [
-            'sync',
-        ]
-
-    if CONFIG['ANDROID_VERSION'] >= '16':
-        OS_LIBS += [
-            'mdnssd',
-        ]
-
 if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
     OS_LIBS += [
         'stagefright_foundation',
     ]
 
 OS_LIBS += CONFIG['ICONV_LIBS']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -113,17 +113,17 @@ set_config('L10NBASEDIR', l10n_base)
 # ==============================================================
 # Normally, we'd want to use the `default` field on the option, but that
 # requires --target to be resolved at --help time, which requires to run
 # config.guess, which we want to avoid. Even better, we could actually set
 # `choices` depending on the target, but that doesn't pan out for the same
 # reason.
 option('--enable-default-toolkit', nargs=1,
        choices=('cairo-windows', 'cairo-gtk3', 'cairo-gtk3-wayland',
-                'cairo-cocoa', 'cairo-uikit', 'cairo-android', 'cairo-gonk'),
+                'cairo-cocoa', 'cairo-uikit', 'cairo-android'),
        help='Select default toolkit')
 
 @depends('--enable-default-toolkit', target, '--help')
 def toolkit(value, target, _):
     # Define possible choices for each platform. The default is the first one
     # listed when there are several.
     os = target.os
     if target.os == 'WINNT':
@@ -245,17 +245,17 @@ def gl_provider_define(provider):
 
 set_define(gl_provider_define, True)
 
 
 # PDF printing
 # ==============================================================
 @depends(toolkit)
 def pdf_printing(toolkit):
-    if toolkit in ('windows', 'gtk2', 'gtk3', 'android', 'gonk'):
+    if toolkit in ('windows', 'gtk2', 'gtk3', 'android'):
         return True
 
 @depends(pdf_printing)
 def pdf_surface_feature(pdf_printing):
     if pdf_printing:
         return '#define CAIRO_HAS_PDF_SURFACE 1'
     else:
         # CONFIGURE_SUBST_FILES need explicit empty values.
@@ -267,18 +267,18 @@ set_config('PDF_SURFACE_FEATURE', pdf_su
 
 # 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'):
+    if value or (toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa', 'android') and
+                 value.origin == 'default'):
         return True
 
 set_config('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
 set_define('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
 
 
 # Fontconfig Freetype
 # ==============================================================
@@ -1000,34 +1000,31 @@ set_config('MOZ_MORTAR', True, when='--e
 
 # Marionette is a Web Driver / Selenium comamnd server and client automation
 # driver for Mozilla's Gecko engine.  For more, see
 # https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette.
 #
 # Marionette isn't really a toolkit feature, it's a Gecko engine feature, but
 # it's enabled based on the toolkit (and target), so here it lives.
 
-@depends(target, toolkit)
-def marionette_default(target, toolkit):
-    # By default, enable Marionette if not Android and not gonk.
+@depends(target)
+def marionette_default(target):
+    # By default, enable Marionette if not Android.
     #
     # None means "don't set anything", which allows to override with
     # --enable-marionette.  False means --disable-marionette, which
     # cannot be overridden with --enable-marionette.  We want to allow
     # overrides.
     if target.os == 'Android':
         return None
 
-    if toolkit == 'gonk':
-        return None
-
     return True
 
 imply_option('--enable-marionette', marionette_default,
-             reason='not Android and not gonk')
+             reason='not Android')
 
 option('--enable-marionette',
        help='Enable internal Marionette command server')
 
 @depends('--enable-marionette')
 def marionette(value):
     if value:
         return True
--- a/tools/profiler/moz.build
+++ b/tools/profiler/moz.build
@@ -101,19 +101,16 @@ if CONFIG['MOZ_GECKO_PROFILER']:
         SOURCES += ['/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext.S']
 
     if CONFIG['ANDROID_CPU_ARCH'] == 'armeabi':
         DEFINES['ARCH_ARMV6'] = True
 
     if CONFIG['ENABLE_TESTS']:
         DIRS += ['tests/gtest']
 
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and (CONFIG['ANDROID_VERSION'] <= '17' or CONFIG['ANDROID_VERSION'] >= '21'):
-        DEFINES['ELFSIZE'] = 32
-
     FINAL_LIBRARY = 'xul'
 
 IPDL_SOURCES += [
     'gecko/ProfilerTypes.ipdlh',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -19,17 +19,17 @@ XPIDL_SOURCES += [
 
 XPIDL_MODULE = 'exthandler'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     osdir = 'win'
     LOCAL_INCLUDES += ['win']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     osdir = 'mac'
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk', 'uikit'):
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'uikit'):
     osdir = CONFIG['MOZ_WIDGET_TOOLKIT']
 else:
     osdir = 'unix'
 
 EXPORTS += [
     osdir + '/nsOSHelperAppService.h'
 ]
 
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -25,19 +25,19 @@ with Files("reftests/*fallback*"):
 with Files("*CompositorWidget*"):
     BUG_COMPONENT = ("Core", "Graphics")
 
 with Files("*FontRange*"):
     BUG_COMPONENT = ("Core", "Widget: Cocoa")
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
-if toolkit in ('cocoa', 'android', 'gonk', 'uikit'):
+if toolkit in ('cocoa', 'android', 'uikit'):
     DIRS += [toolkit]
-if toolkit in ('android', 'cocoa', 'gonk', 'gtk2', 'gtk3'):
+if toolkit in ('android', 'cocoa', 'gtk2', 'gtk3'):
     EXPORTS += ['nsIPrintDialogService.h']
 
 if toolkit == 'windows':
     DIRS += ['windows']
 
     XPIDL_SOURCES += [
         'nsIJumpListBuilder.idl',
         'nsIJumpListItem.idl',
@@ -250,17 +250,17 @@ if toolkit == 'windows':
     ]
 
 if toolkit in ('cocoa', 'windows'):
     UNIFIED_SOURCES += [
         'nsBaseClipboard.cpp',
     ]
 
 if toolkit in {'gtk2', 'gtk3', 'cocoa', 'windows',
-               'android', 'gonk', 'uikit'}:
+               'android', 'uikit'}:
     UNIFIED_SOURCES += [
         'nsBaseFilePicker.cpp',
     ]
 
 if toolkit in ('gtk2', 'gtk3', 'windows', 'cocoa'):
     UNIFIED_SOURCES += [
         'nsNativeTheme.cpp',
     ]
--- a/xpcom/threads/moz.build
+++ b/xpcom/threads/moz.build
@@ -89,19 +89,17 @@ UNIFIED_SOURCES += [
 LOCAL_INCLUDES += [
     '../build',
     '/caps',
     '/tools/profiler',
 ]
 
 # BHR disabled for Release builds because of bug 965392.
 # BHR disabled for debug builds because of bug 979069.
-# BHR disabled on gonk because of bug 1180533
 # BHR disabled for TSan builds because of bug 1121216.
 if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('release') and \
    not CONFIG['MOZ_DEBUG'] and \
-   not CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and \
    not CONFIG['MOZ_TSAN']:
     DEFINES['MOZ_ENABLE_BACKGROUND_HANG_MONITOR'] = 1
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')