[Mesa-dev] [PATCH 2/3] gallium/radeon: link in libradeon.la at target level

Emil Velikov emil.l.velikov at gmail.com
Mon May 12 16:15:02 PDT 2014


It makes more sense to link the core and common parts of the driver as the
target is build. Additionally this will help us drop duplicating symbols
for targets that static link mulitple pipe-drivers. Only egl-static needs
that currently with more to come.

To simplify things a bit add HAVE_GALLIUM_RADEON_COMMON variable.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 configure.ac                                   |  2 ++
 src/gallium/drivers/Makefile.am                | 24 ++++++++----------------
 src/gallium/drivers/r600/Makefile.am           |  2 --
 src/gallium/drivers/radeonsi/Makefile.am       |  2 --
 src/gallium/targets/egl-static/Makefile.am     |  5 +++++
 src/gallium/targets/pipe-loader/Makefile.am    |  2 ++
 src/gallium/targets/r600/dri/Makefile.am       |  1 +
 src/gallium/targets/r600/omx/Makefile.am       |  1 +
 src/gallium/targets/r600/vdpau/Makefile.am     |  1 +
 src/gallium/targets/r600/xvmc/Makefile.am      |  1 +
 src/gallium/targets/radeonsi/dri/Makefile.am   |  1 +
 src/gallium/targets/radeonsi/omx/Makefile.am   |  1 +
 src/gallium/targets/radeonsi/vdpau/Makefile.am |  1 +
 13 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/configure.ac b/configure.ac
index 99a761a..5d19cfa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1948,6 +1948,8 @@ AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_RADEON_COMMON, test "x$HAVE_GALLIUM_R600" = xyes -o \
+                                                "x$HAVE_GALLIUM_RADEONSI" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
diff --git a/src/gallium/drivers/Makefile.am b/src/gallium/drivers/Makefile.am
index f8baa3c..3d53cad 100644
--- a/src/gallium/drivers/Makefile.am
+++ b/src/gallium/drivers/Makefile.am
@@ -5,22 +5,6 @@ SUBDIRS = . galahad identity noop trace rbug
 
 ################################################################################
 
-if HAVE_GALLIUM_R600
-
-SUBDIRS += radeon
-
-else
-
-if HAVE_GALLIUM_RADEONSI
-
-SUBDIRS += radeon
-
-endif
-
-endif
-
-################################################################################
-
 if HAVE_GALLIUM_FREEDRENO
 
 SUBDIRS += freedreno
@@ -61,6 +45,14 @@ endif
 
 ################################################################################
 
+if HAVE_GALLIUM_RADEON_COMMON
+
+SUBDIRS += radeon
+
+endif
+
+################################################################################
+
 if HAVE_GALLIUM_R300
 
 SUBDIRS += r300
diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
index be8635d..30e098e 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -17,8 +17,6 @@ libr600_la_SOURCES = \
 	$(C_SOURCES) \
 	$(CXX_SOURCES)
 
-libr600_la_LIBADD = ../radeon/libradeon.la
-
 if NEED_RADEON_LLVM
 
 AM_CFLAGS += \
diff --git a/src/gallium/drivers/radeonsi/Makefile.am b/src/gallium/drivers/radeonsi/Makefile.am
index f409f7e..926b203 100644
--- a/src/gallium/drivers/radeonsi/Makefile.am
+++ b/src/gallium/drivers/radeonsi/Makefile.am
@@ -32,5 +32,3 @@ AM_CFLAGS = \
 noinst_LTLIBRARIES = libradeonsi.la
 
 libradeonsi_la_SOURCES = $(C_SOURCES)
-libradeonsi_la_LIBADD = \
-	../radeon/libradeon.la
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 1aa5d37..332b38d 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -183,6 +183,11 @@ egl_gallium_la_LIBADD += \
 	$(NOUVEAU_LIBS)
 endif
 
+if HAVE_GALLIUM_RADEON_COMMON
+egl_gallium_la_LIBADD += \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la
+endif
+
 if HAVE_GALLIUM_R300
 AM_CPPFLAGS += -D_EGL_PIPE_R300=1
 egl_gallium_la_LIBADD += \
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index a1c7d25..3280694 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -107,6 +107,7 @@ nodist_EXTRA_pipe_r600_la_SOURCES = dummy.cpp
 pipe_r600_la_LIBADD = \
 	$(PIPE_LIBS) \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
 	$(LIBDRM_LIBS) \
 	$(RADEON_LIBS)
@@ -121,6 +122,7 @@ nodist_EXTRA_pipe_radeonsi_la_SOURCES = dummy.cpp
 pipe_radeonsi_la_LIBADD = \
 	$(PIPE_LIBS) \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
 	$(LIBDRM_LIBS) \
 	$(RADEON_LIBS)
diff --git a/src/gallium/targets/r600/dri/Makefile.am b/src/gallium/targets/r600/dri/Makefile.am
index e13275e..8e3e561 100644
--- a/src/gallium/targets/r600/dri/Makefile.am
+++ b/src/gallium/targets/r600/dri/Makefile.am
@@ -42,6 +42,7 @@ r600_dri_la_LDFLAGS = \
 
 r600_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
 	$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
diff --git a/src/gallium/targets/r600/omx/Makefile.am b/src/gallium/targets/r600/omx/Makefile.am
index e96027e..d2470ea 100644
--- a/src/gallium/targets/r600/omx/Makefile.am
+++ b/src/gallium/targets/r600/omx/Makefile.am
@@ -36,6 +36,7 @@ libomx_r600_la_SOURCES = \
 libomx_r600_la_LDFLAGS = $(GALLIUM_OMX_LINKER_FLAGS)
 
 libomx_r600_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(GALLIUM_OMX_LIB_DEPS) \
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am b/src/gallium/targets/r600/vdpau/Makefile.am
index b212024..8125e2d 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -38,6 +38,7 @@ libvdpau_r600_la_LDFLAGS = \
 	-Wl,--dynamic-list=$(srcdir)/../../r300/dri/radeon.dyn
 
 libvdpau_r600_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(GALLIUM_VDPAU_LIB_DEPS) \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am b/src/gallium/targets/r600/xvmc/Makefile.am
index a6c22f4..3e32f86 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -37,6 +37,7 @@ libXvMCr600_la_LDFLAGS = \
 	$(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCr600_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(GALLIUM_XVMC_LIB_DEPS) \
diff --git a/src/gallium/targets/radeonsi/dri/Makefile.am b/src/gallium/targets/radeonsi/dri/Makefile.am
index c9910dd..470b213 100644
--- a/src/gallium/targets/radeonsi/dri/Makefile.am
+++ b/src/gallium/targets/radeonsi/dri/Makefile.am
@@ -42,6 +42,7 @@ radeonsi_dri_la_LDFLAGS = \
 
 radeonsi_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
 	$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
diff --git a/src/gallium/targets/radeonsi/omx/Makefile.am b/src/gallium/targets/radeonsi/omx/Makefile.am
index 2cfc270..6d6066f 100644
--- a/src/gallium/targets/radeonsi/omx/Makefile.am
+++ b/src/gallium/targets/radeonsi/omx/Makefile.am
@@ -36,6 +36,7 @@ libomx_radeonsi_la_SOURCES = \
 libomx_radeonsi_la_LDFLAGS = $(GALLIUM_OMX_LINKER_FLAGS)
 
 libomx_radeonsi_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(GALLIUM_OMX_LIB_DEPS) \
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 975ae78..9ed40e6 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -39,6 +39,7 @@ libvdpau_radeonsi_la_LDFLAGS = \
 
 
 libvdpau_radeonsi_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(GALLIUM_VDPAU_LIB_DEPS) \
-- 
1.9.2



More information about the mesa-dev mailing list