glsl: Change type of is_array to bool.
[mesa.git] / src / glsl / SConscript
index f8e872368c263cf51820d1bd7effc4742cc871db..c4ab97c1e0889e7826c5f2516f76e9aa6eae6481 100644 (file)
@@ -14,10 +14,10 @@ env.Prepend(CPPPATH = [
     '#src/glsl/glcpp',
 ])
 
-# Make glcpp/glcpp-parse.h and glsl_parser.h reacheable from the include path
-env.Append(CPPPATH = [Dir('.').abspath])
+# Make glcpp-parse.h and glsl_parser.h reachable from the include path.
+env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath])
 
-env.Append(YACCFLAGS = '-d')
+env.Append(YACCFLAGS = '-d -p "glcpp_parser_"')
 
 parser_env = env.Clone()
 parser_env.Append(YACCFLAGS = [
@@ -25,6 +25,10 @@ parser_env.Append(YACCFLAGS = [
     '-p', '_mesa_glsl_',
 ])
 
+# without this line scons will expect "glsl_parser.hpp" instead of
+# "glsl_parser.h", causing glsl_parser.cpp to be regenerated every time
+parser_env['YACCHXXFILESUFFIX'] = '.h'
+
 glcpp_lexer = env.CFile('glcpp/glcpp-lex.c', 'glcpp/glcpp-lex.l')
 glcpp_parser = env.CFile('glcpp/glcpp-parse.c', 'glcpp/glcpp-parse.y')
 glsl_lexer = parser_env.CXXFile('glsl_lexer.cpp', 'glsl_lexer.ll')
@@ -42,7 +46,7 @@ glsl_sources = [
 source_lists = env.ParseSourceList('Makefile.sources')
 
 # add non-generated sources
-for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES', 'LIBGLSL_CXX_FILES'):
+for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES'):
     glsl_sources += source_lists[l]
 
 if env['msvc']:
@@ -52,22 +56,28 @@ if env['msvc']:
 if env['crosscompile'] and not env['embedded']:
     Import('builtin_glsl_function')
 else:
+    # Copy these files to avoid generation object files into src/mesa/program
+    env.Prepend(CPPPATH = ['#src/mesa/main'])
+    env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE'))
+    env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
     # Copy these files to avoid generation object files into src/mesa/program
     env.Prepend(CPPPATH = ['#src/mesa/program'])
-    env.Command('hash_table.c', '#src/mesa/program/hash_table.c', Copy('$TARGET', '$SOURCE'))
+    env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE'))
     env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE'))
 
     compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
 
     mesa_objs = env.StaticObject([
         'hash_table.c',
+        'imports.c',
+        'prog_hash_table.c',
         'symbol_table.c',
     ])
 
     compiler_objs += mesa_objs
 
     builtin_compiler = env.Program(
-        target = 'builtin_compiler',
+        target = 'builtin_compiler/builtin_compiler',
         source = compiler_objs + glsl_sources + \
             source_lists['BUILTIN_COMPILER_CXX_FILES'],
     )
@@ -83,7 +93,7 @@ else:
         command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
     )
 
-    env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', 'builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*'))
+    env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', '#src/glsl/builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*'))
 
     Export('builtin_glsl_function')