llvm-build: Add support for non-installed libraries (e.g., gtest).
 - These libraries are only reported by llvm-config when run from a development
   tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156838 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/llvm-build/llvmbuild/componentinfo.py b/utils/llvm-build/llvmbuild/componentinfo.py
index c32cc1a..e684ac2 100644
--- a/utils/llvm-build/llvmbuild/componentinfo.py
+++ b/utils/llvm-build/llvmbuild/componentinfo.py
@@ -116,6 +116,7 @@
         kwargs['required_libraries'] = items.get_list('required_libraries')
         kwargs['add_to_library_groups'] = items.get_list(
             'add_to_library_groups')
+        kwargs['installed'] = items.get_optional_bool('installed', True)
         return kwargs
 
     @staticmethod
@@ -124,7 +125,7 @@
         return LibraryComponentInfo(subpath, **kwargs)
 
     def __init__(self, subpath, name, dependencies, parent, library_name,
-                 required_libraries, add_to_library_groups):
+                 required_libraries, add_to_library_groups, installed):
         ComponentInfo.__init__(self, subpath, name, dependencies, parent)
 
         # If given, the name to use for the library instead of deriving it from
@@ -139,6 +140,9 @@
         # considered part of.
         self.add_to_library_groups = list(add_to_library_groups)
 
+        # Whether or not this library is installed.
+        self.installed = installed
+
     def get_component_references(self):
         for r in ComponentInfo.get_component_references(self):
             yield r
@@ -160,6 +164,8 @@
         if self.add_to_library_groups:
             print >>result, 'add_to_library_groups = %s' % ' '.join(
                 self.add_to_library_groups)
+        if not self.installed:
+            print >>result, 'installed = 0'
         return result.getvalue()
 
     def get_library_name(self):
@@ -194,10 +200,10 @@
       return OptionalLibraryComponentInfo(subpath, **kwargs)
 
     def __init__(self, subpath, name, dependencies, parent, library_name,
-                 required_libraries, add_to_library_groups):
+                 required_libraries, add_to_library_groups, installed):
       LibraryComponentInfo.__init__(self, subpath, name, dependencies, parent,
                                     library_name, required_libraries,
-                                    add_to_library_groups)
+                                    add_to_library_groups, installed)
 
 class LibraryGroupComponentInfo(ComponentInfo):
     type_name = 'LibraryGroup'