[Mesa-dev] [PATCH 05/12] r300g: share the source list

Chia-I Wu olvaffe at gmail.com
Fri Aug 26 07:52:08 PDT 2011


On Fri, Aug 26, 2011 at 10:07 PM, Tom Stellard <thomas.stellard at amd.com> wrote:
> On Thu, 2011-08-25 at 22:28 -0400, Chia-I Wu wrote:
>> On Fri, Aug 26, 2011 at 5:29 AM, Tom Stellard <thomas.stellard at amd.com> wrote:
>> > On Thu, 2011-08-25 at 00:55 -0400, Chia-I Wu wrote:
>> >> From: Chia-I Wu <olv at lunarg.com>
>> >>
>> >> ---
>> >>  src/gallium/drivers/r300/Makefile         |   63 ++--------------------------
>> >>  src/gallium/drivers/r300/Makefile.sources |   57 ++++++++++++++++++++++++++
>> >>  src/gallium/drivers/r300/SConscript       |   57 +-------------------------
>> >>  3 files changed, 63 insertions(+), 114 deletions(-)
>> >>  create mode 100644 src/gallium/drivers/r300/Makefile.sources
>> >>
>> >> diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile
>> >> index 4f02127..bbb0103 100644
>> >> --- a/src/gallium/drivers/r300/Makefile
>> >> +++ b/src/gallium/drivers/r300/Makefile
>> >> @@ -3,64 +3,11 @@ include $(TOP)/configs/current
>> >>
>> >>  LIBNAME = r300
>> >>
>> >> -C_SOURCES = \
>> >> -     r300_blit.c \
>> >> -     r300_chipset.c \
>> >> -     r300_context.c \
>> >> -     r300_debug.c \
>> >> -     r300_emit.c \
>> >> -     r300_flush.c \
>> >> -     r300_fs.c \
>> >> -     r300_hyperz.c \
>> >> -     r300_query.c \
>> >> -     r300_render.c \
>> >> -     r300_render_stencilref.c \
>> >> -     r300_render_translate.c \
>> >> -     r300_resource.c \
>> >> -     r300_screen.c \
>> >> -     r300_screen_buffer.c \
>> >> -     r300_state.c \
>> >> -     r300_state_derived.c \
>> >> -     r300_vs.c \
>> >> -     r300_vs_draw.c \
>> >> -     r300_texture.c \
>> >> -     r300_texture_desc.c \
>> >> -     r300_tgsi_to_rc.c \
>> >> -     r300_transfer.c \
>> >> -     \
>> >> -     compiler/radeon_code.c \
>> >> -     compiler/radeon_compiler.c \
>> >> -     compiler/radeon_compiler_util.c \
>> >> -     compiler/radeon_emulate_branches.c \
>> >> -     compiler/radeon_emulate_loops.c \
>> >> -     compiler/radeon_program.c \
>> >> -     compiler/radeon_program_print.c \
>> >> -     compiler/radeon_opcodes.c \
>> >> -     compiler/radeon_program_alu.c \
>> >> -     compiler/radeon_program_pair.c \
>> >> -     compiler/radeon_program_tex.c \
>> >> -     compiler/radeon_pair_translate.c \
>> >> -     compiler/radeon_pair_schedule.c \
>> >> -     compiler/radeon_pair_regalloc.c \
>> >> -     compiler/radeon_pair_dead_sources.c \
>> >> -     compiler/radeon_dataflow.c \
>> >> -     compiler/radeon_dataflow_deadcode.c \
>> >> -     compiler/radeon_dataflow_swizzles.c \
>> >> -     compiler/radeon_list.c \
>> >> -     compiler/radeon_optimize.c \
>> >> -     compiler/radeon_remove_constants.c \
>> >> -     compiler/radeon_rename_regs.c \
>> >> -     compiler/radeon_variable.c \
>> >> -     compiler/r3xx_fragprog.c \
>> >> -     compiler/r300_fragprog.c \
>> >> -     compiler/r300_fragprog_swizzle.c \
>> >> -     compiler/r300_fragprog_emit.c \
>> >> -     compiler/r500_fragprog.c \
>> >> -     compiler/r500_fragprog_emit.c \
>> >> -     compiler/r3xx_vertprog.c \
>> >> -     compiler/r3xx_vertprog_dump.c \
>> >> -     compiler/memory_pool.c \
>> >> -     \
>> >> +# get C_SOURCES
>> >> +include Makefile.sources
>> >> +
>> >> +# to build tests
>> >> +C_SOURCES += \
>> >>       $(TOP)/src/glsl/ralloc.c \
>> >>       $(TOP)/src/mesa/program/register_allocate.c
>> >>
>> > ralloc.c and register_allocate.c should also go in the shared source
>> > list.
>> As we are building an archive here, these two files are not needed.
>> For example, r300_dri.so will still link without them.  It seems to me
>> that they are added so that the compiler tests (r300/compiler/tests)
>> can be built by simply linking to libr300.a (and depending on ld to
>> drop object files that are not referenced).
>
> Hi,
>
> I don't really have a lot of insight into how the Android build system
> works, but those files were originally added so that r300_dri.so would
> link correctly for Gallium targets that didn't use GLSL, because without
> GLSL those files weren't being built.  What will happen if someone tries
> to build only the g3dvl target on Android (if this is even possible)?
Ah, I see.  I wrongly assumed the only targets are r300_dri.so and the
compiler tests.  Yes, that would be a problem for targets that do not
link libmesagallium.a, such as g3dvl.

But to correctly support r300g for non-GL targets with Android build
system, I will need to create two more static libraries, consisting of
ralloc.o and register_allocate.o respectively.  It seems to be an
overkill.  I think it is better to leave Makefile and SConscript as
is, which is already the case, and let Android.mk skip those two
files.  I will update the comments and commit logs to reflect this.

>>
>> If they were to be added to Makefile.sources, we would need to define
>> TOP in Makefile.sources as SCons parses only the file.  Also, Android
>> build system, to be added in a latter patch, does not like source
>> files from another directory.  I think it is best to leave them out
>> from Makefile.sources.  I forgot to update the commit log when I later
>> found out about this.  There is already a comment in Makefile about
>> this.  Do you think it is sufficient that I update the commit log?
>>
>>
>
> I think the comment in the Makefile is OK.
>
> -Tom
>
>
>
>
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list