Merge branch '7.8'
[mesa.git] / scons / gallium.py
index 1d5e041c77d811bff23c7fc1ed609c7e924c0be4..dd7275460dae08b595f2db04256c95f3502976ec 100644 (file)
@@ -142,8 +142,6 @@ def generate(env):
     # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
     build_topdir = 'build'
     build_subdir = env['platform']
-    if env['llvm']:
-        build_subdir += "-llvm"
     if env['machine'] != 'generic':
         build_subdir += '-' + env['machine']
     if env['debug']:
@@ -155,7 +153,9 @@ def generate(env):
     # different scons versions building the same source file
     env['build'] = build_dir
     env.SConsignFile(os.path.join(build_dir, '.sconsign'))
-    env.CacheDir('build/cache')
+    if 'SCONS_CACHE_DIR' in os.environ:
+        print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],)
+        env.CacheDir(os.environ['SCONS_CACHE_DIR'])
     env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf')
     env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log')
 
@@ -469,6 +469,10 @@ def generate(env):
     # Default libs
     env.Append(LIBS = [])
 
+    # Load LLVM
+    if env['llvm']:
+        env.Tool('llvm')
+
     # Custom builders and methods
     env.Tool('custom')
     createInstallMethods(env)