Merge remote branch 'origin/master' into pipe-video
[mesa.git] / src / glsl / SConscript
index 88a83fdb6fa0c37649d2c5a3cf523c1bdf14e4e0..7c6b6ae8c4df80541653cf1a257c3424a2933fa2 100644 (file)
@@ -7,14 +7,12 @@ from sys import executable as python_cmd
 env = env.Clone()
 
 env.Prepend(CPPPATH = [
+    '#include',
     '#src/mapi',
     '#src/mesa',
     '#src/glsl',
 ])
 
-if env['platform'] == 'windows':
-    env.Prepend(CPPPATH = ['#src/talloc'])
-
 sources = [
     'glcpp/glcpp-lex.c',
     'glcpp/glcpp-parse.c',
@@ -66,6 +64,7 @@ sources = [
     'opt_constant_propagation.cpp',
     'opt_constant_variable.cpp',
     'opt_copy_propagation.cpp',
+    'opt_copy_propagation_elements.cpp',
     'opt_dead_code.cpp',
     'opt_dead_code_local.cpp',
     'opt_dead_functions.cpp',
@@ -77,22 +76,19 @@ sources = [
     'opt_structure_splitting.cpp',
     'opt_swizzle_swizzle.cpp',
     'opt_tree_grafting.cpp',
+    'ralloc.c',
     's_expression.cpp',
     'strtod.c',
 ] 
 
 
-if env['platform'] == common.host_platform:
+if env['crosscompile'] and env['platform'] != 'embedded':
+    Import('builtin_glsl_function')
+else:
     if env['msvc']:
         env.Prepend(CPPPATH = ['#/src/getopt'])
         env.PrependUnique(LIBS = [getopt])
 
-    if env['platform'] == 'windows':
-        env.Prepend(CPPPATH = ['#src/talloc'])
-        env.Prepend(LIBS = [talloc])
-    else:
-        env.Prepend(LIBS = ['talloc'])
-
     builtin_compiler = env.Program(
         target = 'builtin_compiler',
         source = sources + ['main.cpp', 'builtin_stubs.cpp',
@@ -109,19 +105,12 @@ if env['platform'] == common.host_platform:
 
     env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', 'builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*'))
 
-    if env['msvc']:
-        # There is no LD_LIBRARY_PATH equivalent on Windows. We need to ensure
-        # talloc.dll is on the same dir as builtin_function.
-        talloc_dll_src = talloc.dir.File('talloc.dll')
-        talloc_dll_dst = builtin_compiler[0].dir.File('talloc.dll')
-        talloc_dll = env.Command(talloc_dll_dst, talloc_dll_src, Copy(talloc_dll_dst, talloc_dll_src))
-        env.Depends('builtin_function.cpp', talloc_dll)
-
     Export('builtin_glsl_function')
 
-    if common.cross_compiling:
+    if env['hostonly']:
         Return()
 
+
 sources += builtin_glsl_function
 
 glsl = env.ConvenienceLibrary(
@@ -141,7 +130,7 @@ if env['platform'] == 'windows':
         'user32',
     ])
 
-env.Prepend(LIBS = [glsl, talloc])
+env.Prepend(LIBS = [glsl])
 
 env.Program(
     target = 'glsl2',