glsl: Remove extra checks for constant true assignment conditions.
[mesa.git] / scons / gallium.py
index 3c0ff905389f207344bc6c18ce89a0e27e16ec1c..df060f01a3c696cf165a27a339328ba69659de7b 100644 (file)
@@ -114,6 +114,9 @@ def pkg_config_modules(env, name, modules):
     if not env.Detect('pkg-config'):
         return
 
+    if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
+        return
+
     # Put -I and -L flags directly into the environment, as these don't affect
     # the compilation of targets that do not use them
     try:
@@ -548,6 +551,10 @@ def generate(env):
     env.Append(LINKFLAGS = linkflags)
     env.Append(SHLINKFLAGS = shlinkflags)
 
+    # We have C++ in several libraries, so always link with the C++ compiler
+    if env['gcc']:
+        env['LINK'] = env['CXX']
+
     # Default libs
     env.Append(LIBS = [])
 
@@ -557,8 +564,13 @@ def generate(env):
         env.Tool('udis86')
     
     pkg_config_modules(env, 'x11', ['x11', 'xext'])
-    pkg_config_modules(env, 'dri', ['libdrm'])
+    pkg_config_modules(env, 'drm', ['libdrm'])
+    pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
+    pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
     pkg_config_modules(env, 'xorg', ['xorg-server'])
+    pkg_config_modules(env, 'kms', ['libkms'])
+
+    env['dri'] = env['x11'] and env['drm']
 
     # Custom builders and methods
     env.Tool('custom')