[Mesa-dev] [PATCH 04/21] radeon: Build and use libradeon the right way.

Johannes Obermayr johannesobermayr at gmx.de
Wed Sep 11 15:32:42 PDT 2013


Better build system integration for:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=91a160b
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b2855b

The EGL runtime issue should be fixed now.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64810
---
 configure.ac                                   |  2 --
 src/gallium/drivers/r600/Makefile.am           |  8 +------
 src/gallium/drivers/radeon/Makefile.am         | 31 ++++++--------------------
 src/gallium/drivers/radeonsi/Makefile.am       |  3 ---
 src/gallium/targets/dri-r600/Makefile.am       |  1 +
 src/gallium/targets/dri-radeonsi/Makefile.am   |  1 +
 src/gallium/targets/egl-static/Makefile.am     | 20 +++++++++--------
 src/gallium/targets/pipe-loader/Makefile.am    |  2 ++
 src/gallium/targets/vdpau-r600/Makefile.am     |  1 +
 src/gallium/targets/vdpau-radeonsi/Makefile.am |  1 +
 src/gallium/targets/xorg-r600/Makefile.am      |  1 +
 src/gallium/targets/xorg-radeonsi/Makefile.am  |  1 +
 src/gallium/targets/xvmc-r600/Makefile.am      |  1 +
 13 files changed, 28 insertions(+), 45 deletions(-)

diff --git a/configure.ac b/configure.ac
index e3d323d..6224386 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1779,7 +1779,6 @@ if test "x$with_gallium_drivers" != x; then
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
             if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
                 radeon_llvm_check
-                R600_NEED_RADEON_GALLIUM=yes;
                 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
             fi
             if test "x$enable_r600_llvm" = xyes; then
@@ -1936,7 +1935,6 @@ AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
                                          "x$HAVE_GALLIUM_SVGA" = xyes)
 AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
-AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
index 9203d03..d8dc816 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -22,19 +22,13 @@ libr600_la_SOURCES = \
 	$(C_SOURCES) \
 	$(CXX_SOURCES)
 
-libr600_la_LIBADD = ../radeon/libradeon.la
-
-if R600_NEED_RADEON_GALLIUM
-
+if NEED_RADEON_LLVM
 libr600_la_SOURCES += \
 	$(LLVM_C_SOURCES)
 
-libr600_la_LIBADD += ../radeon/libllvmradeon.la
-
 AM_CFLAGS += \
 	$(LLVM_CFLAGS) \
 	-I$(top_srcdir)/src/gallium/drivers/radeon/
-
 endif
 
 if USE_R600_LLVM_COMPILER
diff --git a/src/gallium/drivers/radeon/Makefile.am b/src/gallium/drivers/radeon/Makefile.am
index ac8cbd3..1a65a6a 100644
--- a/src/gallium/drivers/radeon/Makefile.am
+++ b/src/gallium/drivers/radeon/Makefile.am
@@ -1,38 +1,21 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-LIBGALLIUM_LIBS=
+libradeon_la_CFLAGS = \
+	$(GALLIUM_CFLAGS) \
+	$(RADEON_CFLAGS) \
+	$(VISIBILTY_CFLAGS) \
+	$(DEFINES)
 
 noinst_LTLIBRARIES = libradeon.la
 
-AM_CFLAGS = $(GALLIUM_CFLAGS) $(RADEON_CFLAGS)
-
 libradeon_la_SOURCES = \
 	$(C_SOURCES)
 
 if NEED_RADEON_LLVM
-
-libllvmradeon_la_LDFLAGS = \
-	$(LLVM_LDFLAGS)
-
-noinst_LTLIBRARIES += libllvmradeon.la
-
-libllvmradeon_la_CXXFLAGS = \
-	$(GALLIUM_CFLAGS) \
-	$(DEFINES)
-
-libllvmradeon_la_CFLAGS = \
-	$(GALLIUM_CFLAGS) \
+libradeon_la_CFLAGS += \
 	$(LLVM_CFLAGS)
 
-libllvmradeon_la_SOURCES = \
-	$(LLVM_CPP_FILES) \
+libradeon_la_SOURCES += \
 	$(LLVM_C_FILES)
-
-libllvmradeon_la_LIBADD = \
-	$(LIBGALLIUM_LIBS) \
-	$(CLOCK_LIB) \
-	$(LLVM_LIBS) \
-	$(ELF_LIB)
-
 endif
diff --git a/src/gallium/drivers/radeonsi/Makefile.am b/src/gallium/drivers/radeonsi/Makefile.am
index 0c27973..ac75231 100644
--- a/src/gallium/drivers/radeonsi/Makefile.am
+++ b/src/gallium/drivers/radeonsi/Makefile.am
@@ -34,6 +34,3 @@ AM_CPPFLAGS = \
 AM_CFLAGS = $(LLVM_CFLAGS)
 
 libradeonsi_la_SOURCES = $(C_SOURCES)
-libradeonsi_la_LIBADD = \
-	../radeon/libradeon.la \
-	../radeon/libllvmradeon.la
diff --git a/src/gallium/targets/dri-r600/Makefile.am b/src/gallium/targets/dri-r600/Makefile.am
index 2b3524b..d217f0d 100644
--- a/src/gallium/targets/dri-r600/Makefile.am
+++ b/src/gallium/targets/dri-r600/Makefile.am
@@ -51,6 +51,7 @@ r600_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
diff --git a/src/gallium/targets/dri-radeonsi/Makefile.am b/src/gallium/targets/dri-radeonsi/Makefile.am
index f7d87a6..28a09ba 100644
--- a/src/gallium/targets/dri-radeonsi/Makefile.am
+++ b/src/gallium/targets/dri-radeonsi/Makefile.am
@@ -52,6 +52,7 @@ radeonsi_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 0b30aeb..2c3a09e 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -64,7 +64,7 @@ egl_gallium_la_LIBADD = \
 	$(PTHREAD_LIBS) \
 	-lm
 
-egl_gallium_la_LDFLAGS = -Wl,--no-undefined -Wl,--allow-multiple-definition -avoid-version -module
+egl_gallium_la_LDFLAGS = -Wl,--no-undefined -avoid-version -module
 
 if HAVE_EGL_PLATFORM_X11
 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
@@ -174,27 +174,29 @@ egl_gallium_la_LIBADD += \
 	$(NOUVEAU_LIBS)
 endif
 
+if NEED_RADEON_DRM_WINSYS
 if HAVE_GALLIUM_R300
 AM_CPPFLAGS += -D_EGL_PIPE_R300=1
 egl_gallium_la_LIBADD += \
-	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-	$(top_builddir)/src/gallium/drivers/r300/libr300.la \
-	$(RADEON_LIBS)
+	$(top_builddir)/src/gallium/drivers/r300/libr300.la
 endif
-
 if HAVE_GALLIUM_R600
 AM_CPPFLAGS += -D_EGL_PIPE_R600=1
 egl_gallium_la_LIBADD += \
-	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
-	$(RADEON_LIBS)
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la
 endif
-
 if HAVE_GALLIUM_RADEONSI
 AM_CPPFLAGS += -D_EGL_PIPE_RADEONSI=1
 egl_gallium_la_LIBADD += \
+	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la
+if !HAVE_GALLIUM_R600
+egl_gallium_la_LIBADD += \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la
+endif
+endif
+egl_gallium_la_LIBADD += \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
 	$(RADEON_LIBS)
 endif
 
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index e6772b8..3e8b8aa 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -103,6 +103,7 @@ pipe_r600_la_LIBADD = \
 	$(PIPE_LIBS) \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(LIBDRM_LIBS) \
 	$(RADEON_LIBS)
 pipe_r600_la_LDFLAGS = -no-undefined -avoid-version -module
@@ -121,6 +122,7 @@ pipe_radeonsi_la_LIBADD = \
 	$(PIPE_LIBS) \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(LIBDRM_LIBS) \
 	$(RADEON_LIBS)
 pipe_radeonsi_la_LDFLAGS = -no-undefined -avoid-version -module
diff --git a/src/gallium/targets/vdpau-r600/Makefile.am b/src/gallium/targets/vdpau-r600/Makefile.am
index f6b82de..4bc39ed 100644
--- a/src/gallium/targets/vdpau-r600/Makefile.am
+++ b/src/gallium/targets/vdpau-r600/Makefile.am
@@ -46,6 +46,7 @@ libvdpau_r600_la_LDFLAGS = \
 libvdpau_r600_la_LIBADD = \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
diff --git a/src/gallium/targets/vdpau-radeonsi/Makefile.am b/src/gallium/targets/vdpau-radeonsi/Makefile.am
index beae309..d79cd51 100644
--- a/src/gallium/targets/vdpau-radeonsi/Makefile.am
+++ b/src/gallium/targets/vdpau-radeonsi/Makefile.am
@@ -47,6 +47,7 @@ libvdpau_radeonsi_la_LDFLAGS = \
 libvdpau_radeonsi_la_LIBADD = \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
diff --git a/src/gallium/targets/xorg-r600/Makefile.am b/src/gallium/targets/xorg-r600/Makefile.am
index 1a21655..fc6e56e 100644
--- a/src/gallium/targets/xorg-r600/Makefile.am
+++ b/src/gallium/targets/xorg-r600/Makefile.am
@@ -47,6 +47,7 @@ r600g_drv_la_LIBADD = \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/state_trackers/xorg/libxorgtracker.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
diff --git a/src/gallium/targets/xorg-radeonsi/Makefile.am b/src/gallium/targets/xorg-radeonsi/Makefile.am
index 5ca1056..51d9612 100644
--- a/src/gallium/targets/xorg-radeonsi/Makefile.am
+++ b/src/gallium/targets/xorg-radeonsi/Makefile.am
@@ -48,6 +48,7 @@ radeonsi_drv_la_LIBADD = \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/state_trackers/xorg/libxorgtracker.la \
 	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
diff --git a/src/gallium/targets/xvmc-r600/Makefile.am b/src/gallium/targets/xvmc-r600/Makefile.am
index b337c7e..68d8150 100644
--- a/src/gallium/targets/xvmc-r600/Makefile.am
+++ b/src/gallium/targets/xvmc-r600/Makefile.am
@@ -46,6 +46,7 @@ libXvMCr600_la_LDFLAGS = \
 libXvMCr600_la_LIBADD = \
 	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
 	$(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
 	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
-- 
1.8.1.4



More information about the mesa-dev mailing list