gallium/trace: remove useless NULL check from trace_screen_create()
[mesa.git] / src / gallium / targets / libgl-gdi / SConscript
index 57704440ce7a027aa3af90a952a3f8a6bb31dc0a..594f34d7fadff5385c5ba9d7ea7bc73015a75197 100644 (file)
@@ -3,49 +3,55 @@
 
 Import('*')
 
-if env['platform'] == 'windows':
-
-    env = env.Clone()
-
-    env.Append(CPPPATH = [
-        '#src/gallium/state_trackers/wgl',
-    ])
-
-    env.Append(LIBS = [
-        'gdi32',
-        'user32',
-        'kernel32',
-        'ws2_32',
-    ])
+env = env.Clone()
+
+env.Append(CPPPATH = [
+    '#src',
+    '#src/gallium/state_trackers/wgl',
+    '#src/gallium/winsys/sw',
+])
+
+env.Append(LIBS = [
+    'gdi32',
+    'user32',
+    'kernel32',
+    'ws2_32',
+])
+
+env.Prepend(LIBS = [mesautil])
+
+sources = ['libgl_gdi.c']
+drivers = []
+
+if True:
+    drivers += [softpipe]
+
+if env['llvm']:
+    env.Append(CPPDEFINES = 'HAVE_LLVMPIPE')
+    drivers += [llvmpipe]
+
+if env['gcc'] and env['machine'] != 'x86_64':
+    # DEF parser in certain versions of MinGW is busted, as does not behave as
+    # MSVC.  mingw-w64 works fine.
+    sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def']
+else:
+    sources += ['#src/gallium/state_trackers/wgl/opengl32.def']
+    
+drivers += [trace, rbug]
 
-    sources = []
-    drivers = []
+env['no_import_lib'] = 1
 
-    if 'softpipe' in env['drivers']:
-        sources = ['gdi_softpipe_winsys.c']
-        drivers = [softpipe]
+# when GLES is enabled, gl* and _glapi_* belong to bridge_glapi and
+# shared_glapi respectively
+if env['gles']:
+    env.Prepend(LIBPATH = [shared_glapi.dir])
+    glapi = [bridge_glapi, 'libglapi']
 
-    if 'llvmpipe' in env['drivers']:
-        env.Tool('llvm')
-        if 'LLVM_VERSION' in env:
-            sources = ['gdi_llvmpipe_winsys.c']
-            drivers = [llvmpipe]
+opengl32 = env.SharedLibrary(
+    target ='opengl32',
+    source = sources,
+    LIBS = wgl + ws_gdi + glapi + mesa + drivers + gallium + glsl + env['LIBS'],
+)
 
-    if not sources or not drivers:
-        print 'warning: softpipe or llvmpipe not selected, gdi winsys disabled'
-        Return()
-    
-    if env['gcc']:
-        sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def']
-    else:
-        sources += ['#src/gallium/state_trackers/wgl/opengl32.def']
-        
-    drivers += [trace]
-
-    env['no_import_lib'] = 1
-
-    env.SharedLibrary(
-        target ='opengl32',
-        source = sources,
-        LIBS = wgl + ws_gdi + glapi + mesa + drivers + gallium + glsl + env['LIBS'],
-    )
+env.Alias('opengl32', opengl32)
+env.Alias('libgl-gdi', opengl32)