Bug 1055281 - check for existence of paths in LOCAL_INCLUDES in moz.build; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Wed, 20 Aug 2014 11:51:33 -0400
changeset 222699 b4356b4f14deca9878fc333c479ae121bc76dbff
parent 222698 3fd85ddae58a47173601a0f67110172efca5084b
child 222700 585a440843210eed1e1db9fd4762d5f32038b380
push idunknown
push userunknown
push dateunknown
reviewersmshal
bugs1055281
milestone34.0a1
Bug 1055281 - check for existence of paths in LOCAL_INCLUDES in moz.build; r=mshal
content/media/fmp4/eme/moz.build
content/media/fmp4/moz.build
content/media/gmp/moz.build
dom/bindings/moz.build
dom/ipc/moz.build
dom/plugins/base/android/moz.build
dom/plugins/base/moz.build
gfx/skia/generate_mozbuild.py
gfx/skia/moz.build
intl/lwbrk/tests/moz.build
intl/unicharutil/tests/moz.build
intl/unicharutil/util/internal/moz.build
intl/unicharutil/util/moz.build
layout/build/moz.build
media/libyuv/libyuv.gyp
media/mtransport/build/moz.build
media/mtransport/standalone/moz.build
media/omx-plugin/froyo/moz.build
media/omx-plugin/gb/moz.build
media/omx-plugin/gb235/moz.build
media/omx-plugin/hc/moz.build
media/omx-plugin/kk/moz.build
media/omx-plugin/moz.build
media/webrtc/signaling/signaling.gyp
media/webrtc/signaling/test/moz.build
netwerk/sctp/datachannel/moz.build
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/gyp_reader.py
python/mozbuild/mozbuild/test/backend/data/local_includes/bar/baz/dummy_file_for_nonempty_directory
python/mozbuild/mozbuild/test/backend/data/local_includes/foo/dummy_file_for_nonempty_directory
python/mozbuild/mozbuild/test/frontend/data/local_includes/bar/baz/dummy_file_for_nonempty_directory
python/mozbuild/mozbuild/test/frontend/data/local_includes/foo/dummy_file_for_nonempty_directory
python/mozbuild/mozbuild/test/frontend/data/missing-local-includes/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
toolkit/components/build/moz.build
--- a/content/media/fmp4/eme/moz.build
+++ b/content/media/fmp4/eme/moz.build
@@ -13,18 +13,14 @@ EXPORTS += [
 UNIFIED_SOURCES += [
     'EMEAudioDecoder.cpp',
     'EMEDecoderModule.cpp',
     'EMEH264Decoder.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
-LOCAL_INCLUDES += [
-    '../base',
-]
-  
 FINAL_LIBRARY = 'xul'
 
 FAIL_ON_WARNINGS = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DEFINES['NOMINMAX'] = True
--- a/content/media/fmp4/moz.build
+++ b/content/media/fmp4/moz.build
@@ -60,18 +60,14 @@ if CONFIG['MOZ_APPLEMEDIA']:
   ]
 
 if CONFIG['ANDROID_VERSION'] >= '18'and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     DEFINES['MOZ_GONK_MEDIACODEC'] = True
     DIRS += ['gonk']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
-LOCAL_INCLUDES += [
-    '../base',
-]
-
 FINAL_LIBRARY = 'xul'
 
 FAIL_ON_WARNINGS = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DEFINES['NOMINMAX'] = True
--- a/content/media/gmp/moz.build
+++ b/content/media/gmp/moz.build
@@ -109,14 +109,13 @@ DEFINES['GMP_SAFE_SHMEM'] = True
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 # media/mtransport so we work with --disable-webrtc
 LOCAL_INCLUDES += [
-    '../base',
     '/media/mtransport',
     '/xpcom/base',
     '/xpcom/build',
     '/xpcom/threads',
 ]
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -49,17 +49,16 @@ LOCAL_INCLUDES += [
     '/content/svg/content/src',
     '/content/xul/content/src',
     '/content/xul/document/src',
     '/dom/base',
     '/dom/battery',
     '/dom/bluetooth',
     '/dom/camera',
     '/dom/canvas',
-    '/dom/file',
     '/dom/indexedDB',
     '/dom/src/geolocation',
     '/dom/workers',
     '/dom/xbl',
     '/dom/xml',
     '/dom/xslt/base',
     '/dom/xslt/xpath',
     '/js/ipc',
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -95,17 +95,16 @@ IPDL_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
-    '../src/base',
     '../src/geolocation',
     '../src/storage',
     '/chrome',
     '/content/base/src',
     '/content/media/webspeech/synth/ipc',
     '/docshell/base',
     '/dom/base',
     '/dom/bluetooth',
@@ -132,19 +131,14 @@ DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG[
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk', 'qt'):
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
 for var in ('MOZ_PERMISSIONS', 'MOZ_CHILD_PERMISSIONS'):
     if CONFIG[var]:
         DEFINES[var] = True
 
-if CONFIG['ENABLE_TESTS']:
-    LOCAL_INCLUDES += [
-      'ipc/glue',
-    ]
-
 JAR_MANIFESTS += ['jar.mn']
 
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/dom/plugins/base/android/moz.build
+++ b/dom/plugins/base/android/moz.build
@@ -25,17 +25,16 @@ SOURCES += [
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/plugins/base',
-    '/dom/plugins/base/android/include',
     '/gfx/gl',
     '/widget/android',
     '/widget/xpwidgets',
 ]
 
 DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -94,18 +94,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'andr
     # Therefore, enable FAIL_ON_WARNINGS only on non-Android platforms.
     FAIL_ON_WARNINGS = True
 
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/dom/base',
-    '/gfx/skia/include/config',
-    '/gfx/skia/include/core',
     '/layout/generic',
     '/layout/xul',
     '/widget/android',
     '/widget/xpwidgets',
     '/xpcom/base',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -51,34 +51,32 @@ MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'gkmedias'
 LOCAL_INCLUDES += [
     'trunk/include/config',
     'trunk/include/core',
     'trunk/include/effects',
     'trunk/include/gpu',
     'trunk/include/images',
-    'trunk/include/lazy',
     'trunk/include/pathops',
     'trunk/include/pipe',
     'trunk/include/ports',
     'trunk/include/utils',
     'trunk/include/utils/mac',
     'trunk/include/utils/win',
     'trunk/include/views',
     'trunk/src/core',
     'trunk/src/gpu',
     'trunk/src/gpu/effects',
     'trunk/src/gpu/gl',
     'trunk/src/image',
     'trunk/src/lazy',
     'trunk/src/opts',
     'trunk/src/sfnt',
     'trunk/src/utils',
-    'trunk/src/utils/android',
     'trunk/src/utils/mac',
     'trunk/src/utils/win',
 ]
 
 DEFINES['SK_A32_SHIFT'] = 24
 DEFINES['SK_R32_SHIFT'] = 16
 DEFINES['SK_G32_SHIFT'] = 8
 DEFINES['SK_B32_SHIFT'] = 0
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -883,34 +883,32 @@ MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'gkmedias'
 LOCAL_INCLUDES += [
     'trunk/include/config',
     'trunk/include/core',
     'trunk/include/effects',
     'trunk/include/gpu',
     'trunk/include/images',
-    'trunk/include/lazy',
     'trunk/include/pathops',
     'trunk/include/pipe',
     'trunk/include/ports',
     'trunk/include/utils',
     'trunk/include/utils/mac',
     'trunk/include/utils/win',
     'trunk/include/views',
     'trunk/src/core',
     'trunk/src/gpu',
     'trunk/src/gpu/effects',
     'trunk/src/gpu/gl',
     'trunk/src/image',
     'trunk/src/lazy',
     'trunk/src/opts',
     'trunk/src/sfnt',
     'trunk/src/utils',
-    'trunk/src/utils/android',
     'trunk/src/utils/mac',
     'trunk/src/utils/win',
 ]
 
 DEFINES['SK_A32_SHIFT'] = 24
 DEFINES['SK_R32_SHIFT'] = 16
 DEFINES['SK_G32_SHIFT'] = 8
 DEFINES['SK_B32_SHIFT'] = 0
--- a/intl/lwbrk/tests/moz.build
+++ b/intl/lwbrk/tests/moz.build
@@ -5,18 +5,14 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 CPP_UNIT_TESTS += [
     'TestLineBreak',
 ]
 
 SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
 
-LOCAL_INCLUDES += [
-    '../public',
-]
-
 USE_LIBS += [
     'mozalloc',
     'nspr',
     'xpcomglue_s',
     'xul',
 ]
--- a/intl/unicharutil/tests/moz.build
+++ b/intl/unicharutil/tests/moz.build
@@ -10,20 +10,16 @@ SOURCES += [
     'NormalizationTest.cpp',
     'UnicharSelfTest.cpp',
 ]
 
 SIMPLE_PROGRAMS += [
     "%s" % (fyl[0:-4]) for fyl in SOURCES
 ]
 
-LOCAL_INCLUDES += [
-    '../public',
-]
-
 USE_STATIC_LIBS = True
 
 USE_LIBS += [
     'mozalloc',
     'nspr',
     'unicharutil_external_s',
     'xul',
 ]
--- a/intl/unicharutil/util/internal/moz.build
+++ b/intl/unicharutil/util/internal/moz.build
@@ -7,10 +7,9 @@
 include('../objs.mozbuild')
 
 UNIFIED_SOURCES += intl_unicharutil_util_cppsrcs
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '..',
-    '../../src',
 ]
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -22,20 +22,16 @@ include('objs.mozbuild')
 UNIFIED_SOURCES += intl_unicharutil_util_cppsrcs
 
 LIBRARY_NAME = 'unicharutil_external_s'
 
 FORCE_STATIC_LIB = True
 
 SDK_LIBRARY = True
 
-LOCAL_INCLUDES += [
-    '../src',
-]
-
 USE_STATIC_LIBS = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
     # Don't include directives about which CRT to use
     CFLAGS += ['-Zl']
     CXXFLAGS += ['-Zl']
 
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
@@ -44,17 +44,16 @@ LOCAL_INCLUDES += [
     '/content/xul/content/src',
     '/content/xul/document/src',
     '/content/xul/templates/src',
     '/docshell/base',
     '/dom/audiochannel',
     '/dom/base',
     '/dom/camera',
     '/dom/canvas',
-    '/dom/file',
     '/dom/filesystem',
     '/dom/media',
     '/dom/speakermanager',
     '/dom/src/geolocation',
     '/dom/src/json',
     '/dom/src/jsurl',
     '/dom/src/offline',
     '/dom/src/storage',
@@ -71,21 +70,17 @@ LOCAL_INCLUDES += [
     '/extensions/cookie',
     '/js/xpconnect/loader',
     '/js/xpconnect/src',
     '/netwerk/base/src',
     '/netwerk/cookie',
     '/view',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):
-    LOCAL_INCLUDES += [
-        '/dom/system/unix',
-    ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/dom/system/windows',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '/dom/system/mac',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
@@ -119,17 +114,12 @@ if CONFIG['MOZ_B2G_BT']:
         '/dom/bluetooth',
     ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     LOCAL_INCLUDES += [
         '/content/media/webspeech/synth',
     ]
 
-if CONFIG['MOZ_FFMPEG']:
-    LOCAL_INCLUDES += [
-        '/content/media/fmp4/ffmpeg/include',
-    ]
-
 if CONFIG['MOZ_GSTREAMER']:
     CXXFLAGS += CONFIG['GSTREAMER_CFLAGS']
 
 FINAL_LIBRARY = 'xul'
--- a/media/libyuv/libyuv.gyp
+++ b/media/libyuv/libyuv.gyp
@@ -121,26 +121,16 @@
             'LIBYUV_DISABLE_MIPS',
           ],
         }],
         [ 'yuv_disable_avx2==1', {
           'defines': [
             'LIBYUV_DISABLE_AVX2',
           ]
         }],
-        ['build_with_mozilla==1', {
-          'include_dirs': [
-            '$(DEPTH)/dist/include',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              '$(DEPTH)/dist/include',
-            ],
-          },
-        }],
       ],
       'defines': [
         # Enable the following 3 macros to turn off assembly for specified CPU.
         # 'LIBYUV_DISABLE_X86',
         # 'LIBYUV_DISABLE_NEON',
         # 'LIBYUV_DISABLE_MIPS',
         # This disables AVX2 (Haswell) support, overriding compiler checks
         # 'LIBYUV_DISABLE_AVX2',
--- a/media/mtransport/build/moz.build
+++ b/media/mtransport/build/moz.build
@@ -27,19 +27,16 @@ EXPORTS.mtransport += [
 
 include('../objs.mozbuild')
 
 # These files cannot be built in unified mode because they force NSPR logging.
 SOURCES += mtransport_cppsrcs
 
 FAIL_ON_WARNINGS = True
 
-LOCAL_INCLUDES = [
-    '/media/webrtc/trunk/third_party/libjingle/source/',
-]
 LOCAL_INCLUDES += [
     '/media/mtransport/',
     '/media/mtransport/third_party/',
     '/media/mtransport/third_party/nICEr/src/crypto',
     '/media/mtransport/third_party/nICEr/src/ice',
     '/media/mtransport/third_party/nICEr/src/net',
     '/media/mtransport/third_party/nICEr/src/stun',
     '/media/mtransport/third_party/nICEr/src/util',
--- a/media/mtransport/standalone/moz.build
+++ b/media/mtransport/standalone/moz.build
@@ -6,19 +6,16 @@
 
 include('../objs.mozbuild')
 
 # These files cannot be built in unified mode because they force NSPR logging.
 SOURCES += mtransport_cppsrcs
 
 LIBRARY_NAME = 'mtransport_s'
 
-LOCAL_INCLUDES = [
-    '/media/webrtc/trunk/third_party/libjingle/source/',
-]
 LOCAL_INCLUDES += [
     '/media/mtransport/',
     '/media/mtransport/third_party/',
     '/media/mtransport/third_party/nICEr/src/crypto',
     '/media/mtransport/third_party/nICEr/src/ice',
     '/media/mtransport/third_party/nICEr/src/net',
     '/media/mtransport/third_party/nICEr/src/stun',
     '/media/mtransport/third_party/nICEr/src/util',
--- a/media/omx-plugin/froyo/moz.build
+++ b/media/omx-plugin/froyo/moz.build
@@ -8,17 +8,16 @@ SOURCES += [
     'OmxPluginFroyo.cpp',
 ]
 
 LIBRARY_NAME = 'omxpluginfroyo'
 
 FORCE_SHARED_LIB = True
 
 LOCAL_INCLUDES += [
-    '../../../content/media/plugins',
     '../include/froyo',
     '../include/froyo/media/stagefright/openmax',
 ]
 
 USE_LIBS += [
     '/media/omx-plugin/lib/froyo/libstagefright/stagefright',
     '/media/omx-plugin/lib/gb/libutils/utils',
     'stagefright_color_conversion',
--- a/media/omx-plugin/gb/moz.build
+++ b/media/omx-plugin/gb/moz.build
@@ -8,17 +8,16 @@ SOURCES += [
     'OmxPlugin236.cpp',
 ]
 
 LIBRARY_NAME = 'omxplugingb'
 
 FORCE_SHARED_LIB = True
 
 LOCAL_INCLUDES += [
-    '../../../content/media/plugins',
     '../include/gb',
     '../include/gb/media/stagefright/openmax',
 ]
 
 USE_LIBS += [
     '/media/omx-plugin/lib/gb/libstagefright/stagefright',
     '/media/omx-plugin/lib/gb/libutils/utils',
     'stagefright_color_conversion',
--- a/media/omx-plugin/gb235/moz.build
+++ b/media/omx-plugin/gb235/moz.build
@@ -8,17 +8,16 @@ SOURCES += [
     'OmxPlugin235.cpp',
 ]
 
 LIBRARY_NAME = 'omxplugingb235'
 
 FORCE_SHARED_LIB = True
 
 LOCAL_INCLUDES += [
-    '../../../content/media/plugins',
     '../include/gb',
     '../include/gb/media/stagefright/openmax',
 ]
 
 USE_LIBS += [
     '/media/omx-plugin/lib/gb/libutils/utils',
     '/media/omx-plugin/lib/gb235/libstagefright/stagefright',
     'stagefright_color_conversion',
--- a/media/omx-plugin/hc/moz.build
+++ b/media/omx-plugin/hc/moz.build
@@ -8,17 +8,16 @@ SOURCES += [
     'OmxPluginHoneycomb.cpp',
 ]
 
 LIBRARY_NAME = 'omxpluginhc'
 
 FORCE_SHARED_LIB = True
 
 LOCAL_INCLUDES += [
-    '../../../content/media/plugins',
     '../include/gb',
     '../include/gb/media/stagefright/openmax',
 ]
 
 USE_LIBS += [
     '/media/omx-plugin/lib/gb/libutils/utils',
     '/media/omx-plugin/lib/hc/libstagefright/stagefright',
 ]
--- a/media/omx-plugin/kk/moz.build
+++ b/media/omx-plugin/kk/moz.build
@@ -8,17 +8,16 @@ SOURCES += [
     'OmxPluginKitKat.cpp',
 ]
 
 LIBRARY_NAME = 'omxpluginkk'
 
 FORCE_SHARED_LIB = True
 
 LOCAL_INCLUDES += [
-    '../../../content/media/plugins',
     '../include/ics',
     '../include/ics/media/stagefright/openmax',
 ]
 
 USE_LIBS += [
     '/media/omx-plugin/lib/ics/libstagefright/stagefright',
     '/media/omx-plugin/lib/ics/libutils/utils',
     'videoeditorplayer',
--- a/media/omx-plugin/moz.build
+++ b/media/omx-plugin/moz.build
@@ -17,20 +17,16 @@
 SOURCES += [
     'OmxPlugin.cpp',
 ]
 
 LIBRARY_NAME = 'omxplugin'
 
 FORCE_SHARED_LIB = True
 
-LOCAL_INCLUDES += [
-    '../../content/media/plugins',
-]
-
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     pass
 else:
     LOCAL_INCLUDES += [
         'include/ics',
         'include/ics/media/stagefright/openmax',
     ]
 
--- a/media/webrtc/signaling/signaling.gyp
+++ b/media/webrtc/signaling/signaling.gyp
@@ -45,27 +45,25 @@
         './src/media',
         './src/media-conduit',
         './src/mediapipeline',
         './src/softphonewrapper',
         './src/peerconnection',
         './include',
         './src/sipcc/include',
         './src/sipcc/cpr/include',
-        '../../../ipc/chromium/src/base/third_party/nspr',
         '../../../xpcom/base',
         '../../../dom/base',
         '../../../content/media',
         '../../../media/mtransport',
         '../trunk',
         '../trunk/webrtc',
         '../trunk/webrtc/video_engine/include',
         '../trunk/webrtc/voice_engine/include',
         '../trunk/webrtc/modules/interface',
-        '../trunk/webrtc/peerconnection',
         '../../libyuv/include',
         '../../mtransport/third_party/nrappkit/src/util/libekr',
       ],
 
       #
       # DEPENDENCIES
       #
       'dependencies': [
@@ -329,20 +327,16 @@
         './src/sipcc/core/common',
         './src/sipcc/core/sipstack/h',
         './src/sipcc/core/ccapp',
         './src/sipcc/core/sdp',
         './src/sipcc/core/gsm/h',
         './src/sipcc/plat/common',
         '../../../media/mtransport',
         '../../../dom/base',
-        '../trunk/third_party/libsrtp/srtp/include',
-        '../trunk/third_party/libsrtp/srtp/crypto/include',
-        # Danger: this is to include config.h. This could be bad.
-        '../trunk/third_party/libsrtp/config',
         '../../../netwerk/sctp/datachannel',
       ],
 
       #
       # DEPENDENCIES
       #
       'dependencies': [
       ],
--- a/media/webrtc/signaling/test/moz.build
+++ b/media/webrtc/signaling/test/moz.build
@@ -36,30 +36,28 @@ LOCAL_INCLUDES += [
     '/media/mtransport/third_party/nrappkit/src/event',
     '/media/mtransport/third_party/nrappkit/src/log',
     '/media/mtransport/third_party/nrappkit/src/plugin',
     '/media/mtransport/third_party/nrappkit/src/registry',
     '/media/mtransport/third_party/nrappkit/src/share',
     '/media/mtransport/third_party/nrappkit/src/stats',
     '/media/mtransport/third_party/nrappkit/src/util/libekr',
     '/media/webrtc/signaling/include',
-    '/media/webrtc/signaling/media-conduit',
     '/media/webrtc/signaling/src/common/browser_logging',
     '/media/webrtc/signaling/src/common/time_profiling',
     '/media/webrtc/signaling/src/media',
     '/media/webrtc/signaling/src/media-conduit',
     '/media/webrtc/signaling/src/mediapipeline',
     '/media/webrtc/signaling/src/peerconnection',
     '/media/webrtc/signaling/src/sipcc/core/includes',
     '/media/webrtc/signaling/src/sipcc/core/sdp',
     '/media/webrtc/signaling/src/sipcc/cpr/include',
     '/media/webrtc/signaling/src/sipcc/include',
     '/media/webrtc/trunk',
     '/media/webrtc/trunk/testing/gtest/include',
-    '/media/webrtc/trunk/third_party/libjingle/source',
     '/xpcom/base',
 ]
 
 if CONFIG['OS_TARGET'] == 'Android':
     LOCAL_INCLUDES += [
         '/media/mtransport/third_party/nrappkit/src/port/android/include',
     ]
 
--- a/netwerk/sctp/datachannel/moz.build
+++ b/netwerk/sctp/datachannel/moz.build
@@ -18,17 +18,16 @@ FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../src',
     '/media/mtransport',
-    '/media/webrtc/trunk/third_party/libjingle/source',
 ]
 
 DEFINES['INET'] = 1
 DEFINES['SCTP_DEBUG'] = 1
 
 if CONFIG['OS_TARGET'] != 'Android':
     DEFINES['INET6'] = 1
 
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -552,28 +552,41 @@ class TreeMetadataEmitter(LoggingMixin):
         test_js_modules = context.get('TESTING_JS_MODULES')
         if test_js_modules:
             yield JavaScriptModules(context, test_js_modules, 'testing')
 
         simple_lists = [
             ('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile),
             ('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile),
             ('IPDL_SOURCES', IPDLFile),
-            ('LOCAL_INCLUDES', LocalInclude),
             ('GENERATED_INCLUDES', GeneratedInclude),
             ('PREPROCESSED_TEST_WEBIDL_FILES', PreprocessedTestWebIDLFile),
             ('PREPROCESSED_WEBIDL_FILES', PreprocessedWebIDLFile),
             ('TEST_WEBIDL_FILES', TestWebIDLFile),
             ('WEBIDL_FILES', WebIDLFile),
             ('WEBIDL_EXAMPLE_INTERFACES', ExampleWebIDLInterface),
         ]
         for context_var, klass in simple_lists:
             for name in context.get(context_var, []):
                 yield klass(context, name)
 
+        for local_include in context.get('LOCAL_INCLUDES', []):
+            if local_include.startswith('/'):
+                path = self.config.topsrcdir
+                relative_include = local_include[1:]
+            else:
+                path = context.srcdir
+                relative_include = local_include
+
+            actual_include = os.path.join(path, relative_include)
+            if not os.path.exists(actual_include):
+                raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
+                    'does not exist: %s (resolved to %s)' % (local_include, actual_include), context)
+            yield LocalInclude(context, local_include)
+
         if context.get('FINAL_TARGET') or context.get('XPI_NAME') or \
                 context.get('DIST_SUBDIR'):
             yield InstallationTarget(context)
 
         host_libname = context.get('HOST_LIBRARY_NAME')
         libname = context.get('LIBRARY_NAME')
 
         if host_libname:
--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py
+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ -184,16 +184,30 @@ def read_from_gyp(config, path, output, 
             for define in target_conf.get('defines', []):
                 if '=' in define:
                     name, value = define.split('=', 1)
                     context['DEFINES'][name] = value
                 else:
                     context['DEFINES'][define] = True
 
             for include in target_conf.get('include_dirs', []):
+                # moz.build expects all LOCAL_INCLUDES to exist, so ensure they do.
+                #
+                # NB: gyp files sometimes have actual absolute paths (e.g.
+                # /usr/include32) and sometimes paths that moz.build considers
+                # absolute, i.e. starting from topsrcdir. There's no good way
+                # to tell them apart here, and the actual absolute paths are
+                # likely bogus. In any event, actual absolute paths will be
+                # filtered out by trying to find them in topsrcdir.
+                if include.startswith('/'):
+                    resolved = mozpath.abspath(mozpath.join(config.topsrcdir, include[1:]))
+                else:
+                    resolved = mozpath.abspath(mozpath.join(mozpath.dirname(build_file), include))
+                if not os.path.exists(resolved):
+                    continue
                 context['LOCAL_INCLUDES'] += [include]
 
             context['EXTRA_ASSEMBLER_FLAGS'] = target_conf.get('asflags_mozilla', [])
             context['EXTRA_COMPILE_FLAGS'] = target_conf.get('cflags_mozilla', [])
         else:
             # Ignore other types than static_library because we don't have
             # anything using them, and we're not testing them. They can be
             # added when that becomes necessary.
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/missing-local-includes/moz.build
@@ -0,0 +1,5 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+LOCAL_INCLUDES += ['/bar/baz', 'foo']
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -569,11 +569,17 @@ class TestEmitterBasic(unittest.TestCase
 
     def test_xpidl_module_no_sources(self):
         """XPIDL_MODULE without XPIDL_SOURCES should be rejected."""
         with self.assertRaisesRegexp(SandboxValidationError, 'XPIDL_MODULE '
             'cannot be defined'):
             reader = self.reader('xpidl-module-no-sources')
             self.read_topsrcdir(reader)
 
+    def test_missing_local_includes(self):
+        """LOCAL_INCLUDES containing non-existent directories should be rejected."""
+        with self.assertRaisesRegexp(SandboxValidationError, 'Path specified in '
+            'LOCAL_INCLUDES does not exist'):
+            reader = self.reader('missing-local-includes')
+            self.read_topsrcdir(reader)
 
 if __name__ == '__main__':
     main()
--- a/toolkit/components/build/moz.build
+++ b/toolkit/components/build/moz.build
@@ -15,17 +15,16 @@ SOURCES += [
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../../xre',
     '../alerts',
     '../downloads',
     '../feeds',
     '../find',
-    '../intl',
     '../jsdownloads/src',
     '../protobuf',
     '../startup',
     '../statusfilter',
     '../typeaheadfind',
     '../url-classifier',
 ]