Import('*')

env = env.Clone()
env.Append(CPPPATH = '#/include')
env.Append(CPPPATH = '#/src/mesa')
env.Append(CPPPATH = '#/src/glsl')
env.Append(CPPPATH = '#/src/mapi')

# temporary fix
env['CFLAGS'] = str(env['CFLAGS']).replace('-Werror=declaration-after-statement', '')

r300compiler = env.ConvenienceLibrary(
    target = 'r300compiler',
    source = [
        'radeon_code.c',
        'radeon_compiler.c',
        'radeon_compiler_util.c',
        'radeon_program.c',
        'radeon_program_print.c',
        'radeon_opcodes.c',
        'radeon_program_alu.c',
        'radeon_program_pair.c',
        'radeon_program_tex.c',
        'radeon_pair_translate.c',
        'radeon_pair_schedule.c',
        'radeon_pair_regalloc.c',
	'radeon_pair_dead_sources.c',
        'radeon_optimize.c',
        'radeon_remove_constants.c',
        'radeon_rename_regs.c',
        'radeon_emulate_branches.c',
        'radeon_emulate_loops.c',
        'radeon_dataflow.c',
        'radeon_dataflow_deadcode.c',
        'radeon_dataflow_swizzles.c',
        'radeon_variable.c',
	'radeon_list.c',
        'r3xx_fragprog.c',
        'r300_fragprog.c',
        'r300_fragprog_swizzle.c',
        'r300_fragprog_emit.c',
        'r500_fragprog.c',
        'r500_fragprog_emit.c',
        'r3xx_vertprog.c',
        'r3xx_vertprog_dump.c',
        'memory_pool.c',
	'#/src/glsl/ralloc.c',
	'#/src/mesa/program/register_allocate.c'
    ])

Return('r300compiler')
