From b3a23c28679952e9fd04b8ce570c304e27b7bbdc Mon Sep 17 00:00:00 2001 From: Johannes Obermayr Date: Mon, 28 Jan 2013 20:18:40 +0100 Subject: [PATCH] radeon: Build and use libradeon the right way. 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 | 5 +++++ src/gallium/targets/dri-radeonsi/Makefile.am | 4 +++- src/gallium/targets/egl-static/Makefile.am | 24 ++++++++++++-------- src/gallium/targets/pipe-loader/Makefile.am | 8 ++++++- src/gallium/targets/vdpau-r600/Makefile.am | 5 +++++ src/gallium/targets/vdpau-radeonsi/Makefile.am | 4 +++- src/gallium/targets/xorg-r600/Makefile.am | 5 +++++ src/gallium/targets/xorg-radeonsi/Makefile.am | 4 +++- src/gallium/targets/xvmc-r600/Makefile.am | 5 +++++ 13 files changed, 59 insertions(+), 49 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..45a7467 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 \ @@ -60,6 +61,10 @@ r600_dri_la_LIBADD = \ $(LIBDRM_LIBS) \ $(RADEON_LIBS) +if NEED_RADEON_LLVM +r600_dri_la_LIBADD += $(ELF_LIB) +endif + nodist_EXTRA_r600_dri_la_SOURCES = dummy.cpp if HAVE_MESA_LLVM diff --git a/src/gallium/targets/dri-radeonsi/Makefile.am b/src/gallium/targets/dri-radeonsi/Makefile.am index f7d87a6..686f5bb 100644 --- a/src/gallium/targets/dri-radeonsi/Makefile.am +++ b/src/gallium/targets/dri-radeonsi/Makefile.am @@ -52,13 +52,15 @@ 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 \ $(top_builddir)/src/gallium/drivers/rbug/librbug.la \ $(top_builddir)/src/gallium/drivers/noop/libnoop.la \ $(GALLIUM_DRI_LIB_DEPS) \ - $(RADEON_LIBS) + $(RADEON_LIBS) \ + $(ELF_LIB) if HAVE_MESA_LLVM radeonsi_dri_la_LDFLAGS += $(LLVM_LDFLAGS) diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am index 0b30aeb..e4b177a 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,28 +174,34 @@ 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) +if NEED_RADEON_LLVM +egl_gallium_la_LIBADD += \ + $(ELF_LIB) +endif endif if HAVE_GALLIUM_SVGA diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am index e6772b8..f125aeb 100644 --- a/src/gallium/targets/pipe-loader/Makefile.am +++ b/src/gallium/targets/pipe-loader/Makefile.am @@ -103,9 +103,13 @@ 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 +if NEED_RADEON_LLVM +pipe_r600_la_LIBADD += $(ELF_LIB) +endif if HAVE_MESA_LLVM nodist_EXTRA_pipe_r600_la_SOURCES = dummy.cpp pipe_r600_la_LIBADD += $(LLVM_LIBS) @@ -121,8 +125,10 @@ 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) + $(RADEON_LIBS) \ + $(ELF_LIB) pipe_radeonsi_la_LDFLAGS = -no-undefined -avoid-version -module if HAVE_MESA_LLVM pipe_radeonsi_la_LIBADD += $(LLVM_LIBS) diff --git a/src/gallium/targets/vdpau-r600/Makefile.am b/src/gallium/targets/vdpau-r600/Makefile.am index f6b82de..22db575 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 \ @@ -54,6 +55,10 @@ libvdpau_r600_la_LIBADD = \ $(LIBDRM_LIBS) \ $(RADEON_LIBS) +if NEED_RADEON_LLVM +libvdpau_r600_la_LIBADD += $(ELF_LIB) +endif + if HAVE_MESA_LLVM libvdpau_r600_la_LINK = $(CXXLINK) $(libvdpau_r600_la_LDFLAGS) # Mention a dummy pure C++ file to trigger generation of the $(LINK) variable diff --git a/src/gallium/targets/vdpau-radeonsi/Makefile.am b/src/gallium/targets/vdpau-radeonsi/Makefile.am index beae309..b8c5d69 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 \ @@ -55,7 +56,8 @@ libvdpau_radeonsi_la_LIBADD = \ $(GALLIUM_DRI_LIB_DEPS) \ $(VDPAU_LIBS) \ $(LIBDRM_LIBS) \ - $(RADEON_LIBS) + $(RADEON_LIBS) \ + $(ELF_LIB) if HAVE_MESA_LLVM libvdpau_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS) diff --git a/src/gallium/targets/xorg-r600/Makefile.am b/src/gallium/targets/xorg-r600/Makefile.am index 1a21655..b4e201f 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 \ @@ -56,6 +57,10 @@ r600g_drv_la_LIBADD = \ $(LIBKMS_XORG_LIBS) \ $(RADEON_LIBS) +if NEED_RADEON_LLVM +r600g_drv_la_LIBADD += $(ELF_LIB) +endif + if HAVE_MESA_LLVM r600g_drv_la_LINK = $(CXXLINK) $(r600g_drv_la_LDFLAGS) # Mention a dummy pure C++ file to trigger generation of the $(LINK) variable diff --git a/src/gallium/targets/xorg-radeonsi/Makefile.am b/src/gallium/targets/xorg-radeonsi/Makefile.am index 5ca1056..ac97b83 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 \ @@ -55,7 +56,8 @@ radeonsi_drv_la_LIBADD = \ $(GALLIUM_DRI_LIB_DEPS) \ $(LIBDRM_XORG_LIBS) \ $(LIBKMS_XORG_LIBS) \ - $(RADEON_LIBS) + $(RADEON_LIBS) \ + $(ELF_LIB) if HAVE_MESA_LLVM AM_CFLAGS += $(LLVM_CFLAGS) diff --git a/src/gallium/targets/xvmc-r600/Makefile.am b/src/gallium/targets/xvmc-r600/Makefile.am index b337c7e..308c163 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 \ @@ -54,6 +55,10 @@ libXvMCr600_la_LIBADD = \ $(LIBDRM_LIBS) \ $(RADEON_LIBS) +if NEED_RADEON_LLVM +libXvMCr600_la_LIBADD += $(ELF_LIB) +endif + if HAVE_MESA_LLVM libXvMCr600_la_LINK = $(CXXLINK) $(libXvMCr600_la_LDFLAGS) # Mention a dummy pure C++ file to trigger generation of the $(LINK) variable -- 1.8.1.4