r300g: Link ralloc.c and register_allocate.c into separate library
authorMatt Turner <mattst88@gmail.com>
Mon, 10 Sep 2012 20:34:09 +0000 (13:34 -0700)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Thu, 10 Jan 2013 21:01:06 +0000 (22:01 +0100)
src/gallium/drivers/r300/Makefile.am
src/gallium/targets/pipe-loader/Makefile
src/gallium/targets/vdpau-r300/Makefile
src/gallium/targets/xorg-r300/Makefile
src/gallium/targets/xvmc-r300/Makefile

index 3f39af3b1042d26ed0e8cc92eb66a5f5ad531b62..3b88f7348f347172e5bae721e44d6891723fdf8d 100644 (file)
@@ -1,7 +1,7 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libr300.la
+noinst_LTLIBRARIES = libr300.la libr300-helper.la
 check_PROGRAMS = r300_compiler_tests
 testdir = compiler/tests
 TESTS = r300_compiler_tests
@@ -26,11 +26,20 @@ r300_compiler_tests_SOURCES = \
        $(testdir)/rc_test_helpers.c \
        $(testdir)/unit_test.c
 
-libr300_la_SOURCES = \
-       $(C_SOURCES) \
+libr300_la_SOURCES = $(C_SOURCES)
+
+# These two files are included in libmesagallium, which is included in the dri
+# targets. So, they were added directly to r300g the dri-r300 target would have
+# duplicated symbols, and if they weren't the other *-r300 targets would fail
+# with undefined symbols.
+#
+# Solve this by building them into a separate helper library that can be linked
+# in place of libmesagallium.
+libr300_helper_la_SOURCES = \
        $(top_srcdir)/src/glsl/ralloc.c \
        $(top_srcdir)/src/mesa/program/register_allocate.c
 
 #XXX: Delete this when all r300 targets are converted to automake.
-all-local: libr300.la
+all-local: libr300.la libr300-helper.la
        ln -f $(builddir)/.libs/libr300.a $(builddir)/libr300.a
+       ln -f $(builddir)/.libs/libr300-helper.a $(builddir)/libr300-helper.a
index b8688edcf535593a08ac075d26ba49510cd79794..7c17866667c149a8d301e4b632c5444e8db2fad7 100644 (file)
@@ -48,6 +48,7 @@ nouveau_SYS = $(NOUVEAU_LIBS)
 # r300 pipe driver
 r300_LIBS = \
        $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
+       $(TOP)/src/gallium/drivers/r300/libr300-helper.a \
        $(TOP)/src/gallium/drivers/r300/libr300.a
 r300_SYS += $(RADEON_LIBS)
 
index e79c920feb7dea5eab23eb74d7e30879e2a9b198..cc9252d1dfebc6bf05a5061c442bea70c45adba2 100644 (file)
@@ -6,14 +6,14 @@ LIBBASENAME = vdpau_r300
 DRIVER_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
 
 PIPE_DRIVERS = \
+        $(TOP)/src/gallium/drivers/r300/libr300-helper.a \
         $(TOP)/src/gallium/drivers/r300/libr300.a \
         $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
         $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
         $(TOP)/src/gallium/drivers/rbug/librbug.a \
         $(TOP)/src/gallium/drivers/trace/libtrace.a \
         $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
-       $(TOP)/src/gallium/auxiliary/libgallium.a \
-       $(TOP)/src/mesa/libmesagallium.a
+       $(TOP)/src/gallium/auxiliary/libgallium.a
 
 C_SOURCES = \
        target.c \
index 45bb3d7e7011d6f89f0a3fdeb0cd82024bbe9494..08b87185f76bac3f15cada0ce1fa63a94a6a524c 100644 (file)
@@ -13,6 +13,7 @@ DRIVER_DEFINES = \
 DRIVER_PIPES = \
        $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \
        $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
+       $(TOP)/src/gallium/drivers/r300/libr300-helper.a \
        $(TOP)/src/gallium/drivers/r300/libr300.a \
        $(TOP)/src/gallium/drivers/galahad/libgalahad.a \
        $(TOP)/src/gallium/drivers/trace/libtrace.a \
index d2ab488694407b26a5e80e20bdc4d15a68375886..0bf75cbe0709f779e0ba1ed4f430e9fc326ef74f 100644 (file)
@@ -6,6 +6,7 @@ LIBBASENAME = XvMCr300
 DRIVER_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
 
 PIPE_DRIVERS = \
+        $(TOP)/src/gallium/drivers/r300/libr300-helper.a \
         $(TOP)/src/gallium/drivers/r300/libr300.a \
         $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
         $(TOP)/src/gallium/drivers/trace/libtrace.a \