Bug 1221453 - Use ObjDirPaths for GENERATED_INCLUDES and merge with LOCAL_INCLUDES. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 04 Nov 2015 14:20:20 +0900
changeset 271394 178b4675470e5d695df1693f74ed232dd94ac984
parent 271393 b499168b626fecdc1e709249d8efb186130c8a2d
child 271395 04b8607b90b9cefa9150e3098f8788c6414b5452
push id67644
push usermh@glandium.org
push dateFri, 06 Nov 2015 00:59:36 +0000
treeherdermozilla-inbound@04b8607b90b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1221453
milestone45.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 1221453 - Use ObjDirPaths for GENERATED_INCLUDES and merge with LOCAL_INCLUDES. r=gps
b2g/app/moz.build
browser/app/moz.build
chrome/moz.build
dom/bindings/test/moz.build
ipc/chromium/chromium-config.mozbuild
js/src/gdb/moz.build
js/src/jsapi-tests/moz.build
js/src/moz.build
js/src/shell/moz.build
media/webrtc/signaling/test/common.build
memory/build/moz.build
memory/jemalloc/moz.build
memory/mozalloc/moz.build
memory/mozalloc/staticruntime/moz.build
memory/replace/jemalloc/moz.build
mozglue/android/moz.build
netwerk/build/moz.build
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/frontend/data.py
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/gyp_reader.py
python/mozbuild/mozbuild/test/backend/data/generated_includes/moz.build
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
python/mozbuild/mozbuild/test/frontend/data/generated_includes/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
security/manager/pki/moz.build
security/manager/ssl/moz.build
webapprt/gtk/moz.build
webapprt/mac/moz.build
webapprt/win/moz.build
xpcom/build/moz.build
xpcom/components/moz.build
xpcom/io/moz.build
xpcom/libxpcomrt/moz.build
xpcom/typelib/xpt/moz.build
--- a/b2g/app/moz.build
+++ b/b2g/app/moz.build
@@ -23,21 +23,18 @@ if CONFIG['_MSC_VER']:
 
 USE_LIBS += [
     'zlib',
 ]
 
 for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION', 'MOZ_UPDATER'):
     DEFINES[var] = CONFIG[var]
 
-GENERATED_INCLUDES += [
-    '/build',
-]
-
 LOCAL_INCLUDES += [
+    '!/build',
     '/toolkit/xre',
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     LOCAL_INCLUDES += [
         '/widget/gonk/libdisplay',
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -19,21 +19,18 @@ SOURCES += [
     'nsBrowserApp.cpp',
 ]
 
 FINAL_TARGET_FILES += ['blocklist.xml']
 FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js']
 
 DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
 
-GENERATED_INCLUDES += [
-    '/build',
-]
-
 LOCAL_INCLUDES += [
+    '!/build',
     '/toolkit/xre',
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 DELAYLOAD_DLLS += [
     'mozglue.dll',
 ]
--- a/chrome/moz.build
+++ b/chrome/moz.build
@@ -23,21 +23,18 @@ UNIFIED_SOURCES += [
     'nsChromeRegistryChrome.cpp',
     'nsChromeRegistryContent.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
-GENERATED_INCLUDES += [
-    '/xpcom',
-]
-
 LOCAL_INCLUDES += [
+    '!/xpcom',
     '/dom/base',
     '/netwerk/base',
     '/netwerk/protocol/res',
     '/xpcom/components'
 ]
 
 if CONFIG['MOZ_ENABLE_GTK']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/dom/bindings/test/moz.build
+++ b/dom/bindings/test/moz.build
@@ -36,14 +36,14 @@ PREPROCESSED_TEST_WEBIDL_FILES += [
     'TestJSImplGen.webidl',
 ]
 
 WEBIDL_EXAMPLE_INTERFACES += [
     'TestExampleInterface',
     'TestExampleProxyInterface',
 ]
 
-GENERATED_INCLUDES += ['..']
 LOCAL_INCLUDES += [
+    '!..',
     '/dom/bindings',
     '/js/xpconnect/src',
     '/js/xpconnect/wrappers',
 ]
--- a/ipc/chromium/chromium-config.mozbuild
+++ b/ipc/chromium/chromium-config.mozbuild
@@ -1,23 +1,20 @@
 # -*- 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/.
 
 LOCAL_INCLUDES += [
+    '!/ipc/ipdl/_ipdlheaders',
     '/ipc/chromium/src',
     '/ipc/glue',
 ]
 
-GENERATED_INCLUDES += [
-    '/ipc/ipdl/_ipdlheaders',
-]
-
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'psapi',
         'shell32',
         'dbghelp',
     ]
 
     DEFINES.update({
--- a/js/src/gdb/moz.build
+++ b/js/src/gdb/moz.build
@@ -18,16 +18,18 @@ UNIFIED_SOURCES += [
     'tests/test-jsval.cpp',
     'tests/test-prettyprinters.cpp',
     'tests/test-Root.cpp',
     'tests/typedef-printers.cpp',
 ]
 
 DEFINES['EXPORT_JS_API'] = True
 
-LOCAL_INCLUDES += ['..']
-GENERATED_INCLUDES += ['..']
+LOCAL_INCLUDES += [
+    '!..',
+    '..',
+]
 
 USE_LIBS += [
     'static:js',
 ]
 
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
--- a/js/src/jsapi-tests/moz.build
+++ b/js/src/jsapi-tests/moz.build
@@ -99,18 +99,20 @@ if CONFIG['ENABLE_ION']:
         'testJitMoveEmitterCycles.cpp',
         'testJitRangeAnalysis.cpp',
         'testJitRegisterSet.cpp',
         'testJitRValueAlloc.cpp',
     ]
 
 DEFINES['EXPORT_JS_API'] = True
 
-LOCAL_INCLUDES += ['..']
-GENERATED_INCLUDES += ['..']
+LOCAL_INCLUDES += [
+    '!..',
+    '..',
+]
 
 USE_LIBS += [
     'static:js',
 ]
 
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if not CONFIG['GNU_CXX']:
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -536,18 +536,18 @@ else:
     ]
 
 if CONFIG['JS_HAS_CTYPES']:
     SOURCES += [
         'ctypes/CTypes.cpp',
         'ctypes/Library.cpp',
     ]
     if not CONFIG['MOZ_NATIVE_FFI']:
-        GENERATED_INCLUDES += [
-            'ctypes/libffi/include',
+        LOCAL_INCLUDES += [
+            '!ctypes/libffi/include',
         ]
 
 if CONFIG['MOZ_VTUNE']:
     SOURCES += [
         'vtune/jitprofiling.c'
     ]
 
 if CONFIG['HAVE_LINUX_PERF_EVENT_H']:
--- a/js/src/shell/moz.build
+++ b/js/src/shell/moz.build
@@ -19,16 +19,18 @@ UNIFIED_SOURCES += [
 DEFINES['EXPORT_JS_API'] = True
 
 if CONFIG['_MSC_VER']:
     # unnecessary PGO for js shell.  But gcc cannot turn off pgo because it is
     # necessary to link PGO lib on gcc when a object/static lib are compiled
     # for PGO.
     NO_PGO = True
 
-LOCAL_INCLUDES += ['..']
-GENERATED_INCLUDES += ['..']
+LOCAL_INCLUDES += [
+    '!..',
+    '..',
+]
 
 OS_LIBS += CONFIG['EDITLINE_LIBS']
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if not CONFIG['GNU_CXX']:
     ALLOW_COMPILER_WARNINGS = True
--- a/media/webrtc/signaling/test/common.build
+++ b/media/webrtc/signaling/test/common.build
@@ -6,20 +6,18 @@
 
 if CONFIG['OS_TARGET'] in ('Darwin', 'Android'):
     DEFINES['GTEST_USE_OWN_TR1_TUPLE'] = 1
 
 for var in ('MOZILLA_EXTERNAL_LINKAGE', 'USE_FAKE_MEDIA_STREAMS', 'USE_FAKE_PCOBSERVER',
             'NR_SOCKET_IS_VOID_PTR', 'HAVE_STRDUP'):
     DEFINES[var] = True
 
-GENERATED_INCLUDES += [
-  '/dom/bindings',
-]
 LOCAL_INCLUDES += [
+    '!/dom/bindings',
     '/dom/media/',
     '/ipc/chromium/src',
     '/media/mtransport',
     '/media/mtransport/test',
     '/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/nrappkit/src/event',
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -22,17 +22,17 @@ SOURCES += [
     'jemalloc_config.cpp',
     'mozmemory_wrap.c',
 ]
 
 if CONFIG['MOZ_JEMALLOC4']:
     SOURCES += [
         'mozjemalloc_compat.c',
     ]
-    GENERATED_INCLUDES += ['../jemalloc/src/include']
+    LOCAL_INCLUDES += ['!../jemalloc/src/include']
     if CONFIG['_MSC_VER']:
         LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat']
         if not CONFIG['HAVE_INTTYPES_H']:
             LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat/C99']
 
 if CONFIG['MOZ_REPLACE_MALLOC']:
     SOURCES += [
         'replace_malloc.c',
--- a/memory/jemalloc/moz.build
+++ b/memory/jemalloc/moz.build
@@ -64,13 +64,15 @@ if CONFIG['OS_TARGET'] == 'Linux':
 if CONFIG['MOZ_NUWA_PROCESS'] and CONFIG['MOZ_JEMALLOC4']:
     DEFINES['pthread_mutex_lock'] = '__real_pthread_mutex_lock'
 
 if CONFIG['GNU_CC']:
     CFLAGS += ['-std=gnu99']
 
 DEFINES['abort'] = 'moz_abort'
 
-GENERATED_INCLUDES += ['src/include']
-LOCAL_INCLUDES += ['src/include']
+LOCAL_INCLUDES += [
+    '!src/include',
+    'src/include',
+]
 
 # We allow warnings for third-party code that can be updated from upstream.
 ALLOW_COMPILER_WARNINGS = True
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -31,23 +31,24 @@ UNIFIED_SOURCES += [
     'mozalloc_oom.cpp',
 ]
 
 FINAL_LIBRARY = 'mozglue'
 
 # The strndup declaration in string.h is in an ifdef __USE_GNU section
 DEFINES['_GNU_SOURCE'] = True
 
-GENERATED_INCLUDES += ['/xpcom']
-
 DISABLE_STL_WRAPPING = True
 
 DEFINES['IMPL_MFBT'] = True
 
 if CONFIG['_MSC_VER']:
     DIRS += ['staticruntime']
 
-LOCAL_INCLUDES += ['/memory/build']
+LOCAL_INCLUDES += [
+    '!/xpcom',
+    '/memory/build',
+]
 
 DIST_INSTALL = True
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
--- a/memory/mozalloc/staticruntime/moz.build
+++ b/memory/mozalloc/staticruntime/moz.build
@@ -14,17 +14,17 @@ if CONFIG['WRAP_STL_INCLUDES']:
         ]
 
 UNIFIED_SOURCES += [
     '../mozalloc.cpp',
     '../mozalloc_abort.cpp',
     '../mozalloc_oom.cpp',
 ]
 
-GENERATED_INCLUDES += ['/xpcom']
+LOCAL_INCLUDES += ['!/xpcom']
 
 DISABLE_STL_WRAPPING = True
 
 DEFINES['IMPL_MFBT'] = True
 
 USE_STATIC_LIBS = True
 
 Library('mozalloc_staticruntime')
--- a/memory/replace/jemalloc/moz.build
+++ b/memory/replace/jemalloc/moz.build
@@ -21,17 +21,17 @@ SharedLibrary('replace_jemalloc')
 
 USE_LIBS += [
     'jemalloc',
 ]
 
 DEFINES['MOZ_JEMALLOC4'] = True
 DEFINES['MOZ_REPLACE_JEMALLOC'] = True
 
-GENERATED_INCLUDES += ['../../jemalloc/src/include']
+LOCAL_INCLUDES += ['!../../jemalloc/src/include']
 if CONFIG['_MSC_VER']:
     LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat']
     if not CONFIG['HAVE_INTTYPES_H']:
         LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat/C99']
 
 DISABLE_STL_WRAPPING = True
 
 if CONFIG['GNU_CC']:
--- a/mozglue/android/moz.build
+++ b/mozglue/android/moz.build
@@ -21,18 +21,18 @@ FINAL_LIBRARY = 'mozglue'
 
 for var in ('ANDROID_PACKAGE_NAME',
             'ANDROID_CPU_ARCH'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
 if CONFIG['MOZ_FOLD_LIBS']:
     DEFINES['MOZ_FOLD_LIBS'] = True
 
-GENERATED_INCLUDES += ['/build']
 LOCAL_INCLUDES += [
+    '!/build',
     '../linker',
     '/db/sqlite3/src',
     '/ipc/chromium/src',
     '/nsprpub/lib/ds',
     '/nsprpub/lib/libc/include',
     '/nsprpub/pr/include',
     '/security/nss/lib/base',
     '/security/nss/lib/certdb',
--- a/netwerk/build/moz.build
+++ b/netwerk/build/moz.build
@@ -68,11 +68,11 @@ if CONFIG['NECKO_WIFI']:
         '/netwerk/wifi',
     ]
 
 if CONFIG['MOZ_RTSP']:
     LOCAL_INCLUDES += [
         '/netwerk/protocol/rtsp',
     ]
 
-GENERATED_INCLUDES += [
-    '/netwerk/dns',
+LOCAL_INCLUDES += [
+    '!/netwerk/dns',
 ]
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -42,17 +42,16 @@ from ..frontend.data import (
     ContextWrapped,
     Defines,
     DistFiles,
     DirectoryTraversal,
     Exports,
     ExternalLibrary,
     FinalTargetFiles,
     GeneratedFile,
-    GeneratedInclude,
     GeneratedSources,
     HostDefines,
     HostLibrary,
     HostProgram,
     HostSimpleProgram,
     HostSources,
     InstallationTarget,
     JARManifest,
@@ -556,19 +555,16 @@ class RecursiveMakeBackend(CommonBackend
 
         elif isinstance(obj, HostSimpleProgram):
             self._process_host_simple_program(obj.program, backend_file)
             self._process_linked_libraries(obj, backend_file)
 
         elif isinstance(obj, LocalInclude):
             self._process_local_include(obj.path, backend_file)
 
-        elif isinstance(obj, GeneratedInclude):
-            self._process_generated_include(obj.path, backend_file)
-
         elif isinstance(obj, PerSourceFlag):
             self._process_per_source_flag(obj, backend_file)
 
         elif isinstance(obj, InstallationTarget):
             self._process_installation_target(obj, backend_file)
 
         elif isinstance(obj, JavaScriptModules):
             self._process_javascript_modules(obj, backend_file)
@@ -1240,23 +1236,16 @@ INSTALL_TARGETS += %(prefix)s
 
     def _process_local_include(self, local_include, backend_file):
         path = self._pretty_path(local_include, backend_file)
         if ' ' in path:
             backend_file.write('LOCAL_INCLUDES += -I\'%s\'\n' % path)
         else:
             backend_file.write('LOCAL_INCLUDES += -I%s\n' % path)
 
-    def _process_generated_include(self, generated_include, backend_file):
-        if generated_include.startswith('/'):
-            path = self.environment.topobjdir.replace('\\', '/')
-        else:
-            path = ''
-        backend_file.write('LOCAL_INCLUDES += -I%s%s\n' % (path, generated_include))
-
     def _process_per_source_flag(self, per_source_flag, backend_file):
         for flag in per_source_flag.flags:
             backend_file.write('%s_FLAGS += %s\n' % (mozpath.basename(per_source_flag.file_name), flag))
 
     def _process_java_jar_data(self, jar, backend_file):
         target = jar.name
         backend_file.write('JAVA_JAR_TARGETS += %s\n' % target)
         backend_file.write('%s_DEST := %s.jar\n' % (target, jar.name))
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1072,21 +1072,16 @@ VARIABLES = {
 
     'USE_STATIC_LIBS': (bool, bool,
         """Whether the code in this directory is a built against the static
         runtime library.
 
         This variable only has an effect when building with MSVC.
         """, None),
 
-    'GENERATED_INCLUDES' : (StrictOrderingOnAppendList, list,
-        """Directories generated by the build system to be searched for include
-        files by the compiler.
-        """, None),
-
     'HOST_SOURCES': (ContextDerivedTypedList(SourcePath, StrictOrderingOnAppendList), list,
         """Source code files to compile with the host compiler.
 
         This variable contains a list of source code files to compile.
         with the host compiler.
         """, None),
 
     'IS_COMPONENT': (bool, bool,
@@ -1164,17 +1159,17 @@ VARIABLES = {
     'HOST_USE_LIBS': (StrictOrderingOnAppendList, list,
         """List of libraries to link to host programs and libraries.
         """, None),
 
     'HOST_OS_LIBS': (List, list,
         """List of system libraries for host programs and libraries.
         """, None),
 
-    'LOCAL_INCLUDES': (ContextDerivedTypedList(SourcePath, StrictOrderingOnAppendList), list,
+    'LOCAL_INCLUDES': (ContextDerivedTypedList(Path, StrictOrderingOnAppendList), list,
         """Additional directories to be searched for include files by the compiler.
         """, None),
 
     'NO_PGO': (bool, bool,
         """Whether profile-guided optimization is disable in this directory.
         """, None),
 
     'NO_VISIBILITY_FLAGS': (bool, bool,
@@ -2105,14 +2100,24 @@ DEPRECATION_HINTS = {
         Please use
 
             SOURCES += [ '!foo.cpp' ]
 
         instead of
 
             GENERATED_SOURCES += [ 'foo.cpp']
     ''',
+
+    'GENERATED_INCLUDES': '''
+        Please use
+
+            LOCAL_INCLUDES += [ '!foo' ]
+
+        instead of
+
+            GENERATED_INCLUDES += [ 'foo' ]
+    ''',
 }
 
 # Make sure that all template variables have a deprecation hint.
 for name in TEMPLATE_VARIABLES:
     if name not in DEPRECATION_HINTS:
         raise RuntimeError('Missing deprecation hint for %s' % name)
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -643,28 +643,16 @@ class LocalInclude(ContextDerived):
         'path',
     )
 
     def __init__(self, context, path):
         ContextDerived.__init__(self, context)
 
         self.path = path
 
-class GeneratedInclude(ContextDerived):
-    """Describes an individual generated include path."""
-
-    __slots__ = (
-        'path',
-    )
-
-    def __init__(self, context, path):
-        ContextDerived.__init__(self, context)
-
-        self.path = path
-
 
 class PerSourceFlag(ContextDerived):
     """Describes compiler flags specified for individual source files."""
 
     __slots__ = (
         'file_name',
         'flags',
     )
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -33,17 +33,16 @@ from .data import (
     ContextWrapped,
     Defines,
     DistFiles,
     DirectoryTraversal,
     Exports,
     FinalTargetFiles,
     GeneratedEventWebIDLFile,
     GeneratedFile,
-    GeneratedInclude,
     GeneratedSources,
     GeneratedWebIDLFile,
     ExampleWebIDLInterface,
     ExternalStaticLibrary,
     ExternalSharedLibrary,
     HeaderFileSubstitution,
     HostDefines,
     HostLibrary,
@@ -654,29 +653,29 @@ 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),
-            ('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 not os.path.exists(local_include.full_path):
+            if (not isinstance(local_include, ObjDirPath) and
+                    not os.path.exists(local_include.full_path)):
                 raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
                     'does not exist: %s (resolved to %s)' % (local_include,
                     local_include.full_path), context)
             yield LocalInclude(context, local_include)
 
         final_target_files = context.get('FINAL_TARGET_FILES')
         if final_target_files:
             yield FinalTargetFiles(context, final_target_files, context['FINAL_TARGET'])
--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py
+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ -216,19 +216,19 @@ def read_from_gyp(config, path, output, 
             # 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.
             raise NotImplementedError('Unsupported gyp target type: %s' % spec['type'])
 
         # Add some features to all contexts. Put here in case LOCAL_INCLUDES
         # order matters.
         context['LOCAL_INCLUDES'] += [
+            '!/ipc/ipdl/_ipdlheaders',
             '/ipc/chromium/src',
             '/ipc/glue',
         ]
-        context['GENERATED_INCLUDES'] += ['/ipc/ipdl/_ipdlheaders']
         # These get set via VC project file settings for normal GYP builds.
         if config.substs['OS_TARGET'] == 'WINNT':
             context['DEFINES']['UNICODE'] = True
             context['DEFINES']['_UNICODE'] = True
         context['DISABLE_STL_WRAPPING'] = True
 
         yield context
--- a/python/mozbuild/mozbuild/test/backend/data/generated_includes/moz.build
+++ b/python/mozbuild/mozbuild/test/backend/data/generated_includes/moz.build
@@ -1,5 +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/
 
-GENERATED_INCLUDES += ['/bar/baz', 'foo']
+LOCAL_INCLUDES += ['!/bar/baz', '!foo']
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -622,17 +622,17 @@ class TestRecursiveMakeBackend(BackendTe
         env = self._consume('generated_includes', RecursiveMakeBackend)
 
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
 
         topobjdir = env.topobjdir.replace('\\', '/')
 
         expected = [
-            'LOCAL_INCLUDES += -I%s/bar/baz' % topobjdir,
+            'LOCAL_INCLUDES += -Ibar/baz',
             'LOCAL_INCLUDES += -Ifoo',
         ]
 
         found = [str for str in lines if str.startswith('LOCAL_INCLUDES')]
         self.assertEqual(found, expected)
 
     def test_final_target(self):
         """Test that FINAL_TARGET is written to backend.mk correctly."""
--- a/python/mozbuild/mozbuild/test/frontend/data/generated_includes/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/generated_includes/moz.build
@@ -1,5 +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/
 
-GENERATED_INCLUDES += ['/bar/baz', 'foo']
+LOCAL_INCLUDES += ['!/bar/baz', '!foo']
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -13,17 +13,16 @@ from mozbuild.frontend.data import (
     AndroidResDirs,
     BrandingFiles,
     ConfigFileSubstitution,
     Defines,
     DistFiles,
     DirectoryTraversal,
     Exports,
     GeneratedFile,
-    GeneratedInclude,
     GeneratedSources,
     HostDefines,
     HostSources,
     IPDLFile,
     JARManifest,
     JsPreferenceFile,
     LocalInclude,
     Program,
@@ -656,20 +655,29 @@ class TestEmitterBasic(unittest.TestCase
 
         self.assertEqual(local_includes, expected)
 
     def test_generated_includes(self):
         """Test that GENERATED_INCLUDES is emitted correctly."""
         reader = self.reader('generated_includes')
         objs = self.read_topsrcdir(reader)
 
-        generated_includes = [o.path for o in objs if isinstance(o, GeneratedInclude)]
+        generated_includes = [o.path for o in objs if isinstance(o, LocalInclude)]
         expected = [
-            '/bar/baz',
-            'foo',
+            '!/bar/baz',
+            '!foo',
+        ]
+
+        self.assertEqual(generated_includes, expected)
+
+        generated_includes = [o.path.full_path
+                              for o in objs if isinstance(o, LocalInclude)]
+        expected = [
+            mozpath.join(reader.config.topobjdir, 'bar/baz'),
+            mozpath.join(reader.config.topobjdir, 'foo'),
         ]
 
         self.assertEqual(generated_includes, expected)
 
     def test_defines(self):
         reader = self.reader('defines')
         objs = self.read_topsrcdir(reader)
 
--- a/security/manager/pki/moz.build
+++ b/security/manager/pki/moz.build
@@ -14,13 +14,13 @@ XPIDL_MODULE = 'pippki'
 
 UNIFIED_SOURCES += [
     'nsASN1Tree.cpp',
     'nsNSSDialogHelper.cpp',
     'nsNSSDialogs.cpp',
     'nsPKIModule.cpp',
 ]
 
-GENERATED_INCLUDES += [
-    '/dist/public/nss',
+LOCAL_INCLUDES += [
+    '!/dist/public/nss',
 ]
 
 FINAL_LIBRARY = 'xul'
--- a/security/manager/ssl/moz.build
+++ b/security/manager/ssl/moz.build
@@ -156,18 +156,18 @@ UNIFIED_SOURCES += [
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/base',
     '/security/certverifier',
     '/security/pkix/include',
 ]
 
-GENERATED_INCLUDES += [
-    '/dist/public/nss',
+LOCAL_INCLUDES += [
+    '!/dist/public/nss',
 ]
 
 if CONFIG['NSS_DISABLE_DBM']:
     DEFINES['NSS_DISABLE_DBM'] = '1'
 
 DEFINES['SSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES'] = 'True'
 DEFINES['NSS_ENABLE_ECC'] = 'True'
 for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
--- a/webapprt/gtk/moz.build
+++ b/webapprt/gtk/moz.build
@@ -7,18 +7,18 @@
 # mozglue is statically linked into GeckoPrograms on gtk builds, so
 # we can use GeckoProgram, contrary to other platforms.
 GeckoProgram('webapprt-stub')
 
 SOURCES += [
     'webapprt.cpp',
 ]
 
-GENERATED_INCLUDES += ['/build']
 LOCAL_INCLUDES += [
+    '!/build',
     '/toolkit/xre',
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 DISABLE_STL_WRAPPING = True
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/webapprt/mac/moz.build
+++ b/webapprt/mac/moz.build
@@ -10,18 +10,18 @@
 Program('webapprt-stub')
 
 SOURCES += [
     'webapprt.mm',
 ]
 
 DEFINES['XPCOM_GLUE'] = True
 
-GENERATED_INCLUDES += ['/build']
 LOCAL_INCLUDES += [
+    '!/build',
     '/toolkit/xre',
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 USE_LIBS += [
     'mfbt',
     'xpcomglue',
--- a/webapprt/win/moz.build
+++ b/webapprt/win/moz.build
@@ -15,18 +15,18 @@ SOURCES += [
 
 DEFINES['XPCOM_GLUE'] = True
 
 DEFINES['APP_VERSION'] = CONFIG['FIREFOX_VERSION']
 
 # Statically link against the CRT
 USE_STATIC_LIBS = True
 
-GENERATED_INCLUDES += ['/build']
 LOCAL_INCLUDES += [
+    '!/build',
     '/toolkit/xre',
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 if CONFIG['_MSC_VER']:
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -74,18 +74,18 @@ if CONFIG['GNU_CC']:
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['_IMPL_NS_STRINGAPI'] = True
 DEFINES['OMNIJAR_NAME'] = CONFIG['OMNIJAR_NAME']
 
-GENERATED_INCLUDES += ['..']
 LOCAL_INCLUDES += [
+    '!..',
     '../base',
     '../components',
     '../ds',
     '../glue',
     '../io',
     '../reflect/xptinfo',
     '../threads',
     '/chrome',
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -39,18 +39,18 @@ UNIFIED_SOURCES += [
     'nsNativeModuleLoader.cpp',
 ]
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
 
 FINAL_LIBRARY = 'xul'
 
-GENERATED_INCLUDES += ['..']
 LOCAL_INCLUDES += [
+    '!..',
     '../base',
     '../build',
     '../ds',
     '../reflect/xptinfo',
     '/chrome',
     '/modules/libjar',
 ]
 
--- a/xpcom/io/moz.build
+++ b/xpcom/io/moz.build
@@ -129,9 +129,9 @@ if CONFIG['GNU_CC']:
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['OS_ARCH'] == 'Linux' and 'lib64' in CONFIG['libdir']:
     DEFINES['HAVE_USR_LIB64_DIR'] = True
 
-GENERATED_INCLUDES += ['..']
+LOCAL_INCLUDES += ['!..']
--- a/xpcom/libxpcomrt/moz.build
+++ b/xpcom/libxpcomrt/moz.build
@@ -114,18 +114,18 @@ src_list += [
 
 
 SOURCES += sorted(src_list)
 
 if CONFIG['INTEL_ARCHITECTURE']:
     sse_string_path = '/xpcom/string/nsUTF8UtilsSSE2.cpp'
     SOURCES[sse_string_path].flags += CONFIG['SSE2_FLAGS']
 
-GENERATED_INCLUDES += ['..']
 LOCAL_INCLUDES = [
+    '!..',
     '../base',
     '../build',
     '../components',
     '../ds',
     '../glue',
     '../threads',
     '/netwerk/standalone/',
     '/xpcom/reflect/xptinfo/',
--- a/xpcom/typelib/xpt/moz.build
+++ b/xpcom/typelib/xpt/moz.build
@@ -17,18 +17,20 @@ UNIFIED_SOURCES += [
 EXPORTS += [
     'xpt_arena.h',
     'xpt_struct.h',
     'xpt_xdr.h',
 ]
 
 FINAL_LIBRARY = 'xul'
 
-GENERATED_INCLUDES += ['/xpcom/base']
-LOCAL_INCLUDES += ['/xpcom/base']
+LOCAL_INCLUDES += [
+    '!/xpcom/base',
+    '/xpcom/base',
+]
 
 if CONFIG['_MSC_VER']:
     CFLAGS += ['-Zl']
 
 # Code with FINAL_LIBRARY = 'xul' shouldn't do this, but the code
 # here doesn't use malloc functions anyways, while not setting
 # MOZ_NO_MOZALLOC makes the code include mozalloc.h, which includes
 # inline operator new definitions that MSVC linker doesn't strip