[Mesa-dev] [PATCH 14/21] gallium/drivers: Build libs -shared.

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


---
 configure.ac                                     | 20 +++++++++++++++++
 src/gallium/drivers/Makefile.am                  | 28 +++++++++++++++++++-----
 src/gallium/drivers/freedreno/Makefile.am        | 10 ++++++---
 src/gallium/drivers/freedreno/freedreno_screen.c |  2 ++
 src/gallium/drivers/galahad/glhd_screen.c        |  2 ++
 src/gallium/drivers/i915/Makefile.am             |  8 ++++++-
 src/gallium/drivers/i915/i915_debug.c            |  3 ++-
 src/gallium/drivers/i915/i915_screen.c           |  3 +++
 src/gallium/drivers/identity/id_screen.c         |  2 ++
 src/gallium/drivers/ilo/Makefile.am              | 22 +++++++++++++++++++
 src/gallium/drivers/ilo/ilo_screen.c             |  3 +++
 src/gallium/drivers/llvmpipe/Makefile.am         | 10 +++++++--
 src/gallium/drivers/noop/noop_pipe.c             |  2 ++
 src/gallium/drivers/nouveau/Makefile.am          |  8 ++++++-
 src/gallium/drivers/nouveau/nv30/nv30_screen.c   |  3 +++
 src/gallium/drivers/nouveau/nv50/nv50_screen.c   |  2 ++
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   |  2 ++
 src/gallium/drivers/r300/Makefile.am             | 13 ++++++++++-
 src/gallium/drivers/r300/r300_screen.c           |  4 ++++
 src/gallium/drivers/r600/Makefile.am             | 17 ++++++++++++--
 src/gallium/drivers/r600/r600_pipe.c             |  2 ++
 src/gallium/drivers/radeonsi/Makefile.am         | 16 ++++++++++++--
 src/gallium/drivers/radeonsi/radeonsi_pipe.c     |  2 ++
 src/gallium/drivers/rbug/Makefile.am             | 13 ++++++++---
 src/gallium/drivers/rbug/rbug_screen.c           |  2 ++
 src/gallium/drivers/softpipe/Makefile.am         |  8 ++++++-
 src/gallium/drivers/svga/Makefile.am             |  9 +++++---
 src/gallium/drivers/svga/svga_screen.c           |  4 ++++
 src/gallium/drivers/trace/Makefile.am            | 11 +++++++---
 src/gallium/drivers/trace/tr_screen.c            |  3 +++
 src/gallium/targets/dri-freedreno/Makefile.am    |  7 ++----
 src/gallium/targets/dri-r600/Makefile.am         |  2 --
 src/gallium/targets/dri-radeonsi/Makefile.am     |  2 --
 src/gallium/targets/dri-swrast/Makefile.am       |  4 +++-
 src/gallium/targets/egl-static/Makefile.am       |  9 +-------
 src/gallium/targets/pipe-loader/Makefile.am      |  4 ----
 src/gallium/targets/vdpau-r300/Makefile.am       |  3 ---
 src/gallium/targets/vdpau-r600/Makefile.am       |  3 ---
 src/gallium/targets/vdpau-radeonsi/Makefile.am   |  5 -----
 src/gallium/targets/vdpau-softpipe/Makefile.am   |  6 ++---
 src/gallium/targets/xorg-r600/Makefile.am        |  2 --
 src/gallium/targets/xorg-radeonsi/Makefile.am    |  2 --
 src/gallium/targets/xvmc-r600/Makefile.am        |  2 --
 src/gallium/targets/xvmc-softpipe/Makefile.am    |  3 ++-
 44 files changed, 216 insertions(+), 72 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1a98626..383150a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1838,6 +1838,16 @@ if test "x$ac_cv_lib__llvm_one_shared_lib" = xyes; then
     if test -n "$LLVM_GALLIUM_COMPONENTS"; then
         LLVM_GALLIUM_LIBS="-l$LLVM_SO_NAME"
     fi
+    if test -n "$LLVM_OPENCL_COMPONENTS"; then
+        LLVM_OPENCL_LIBS="-l$LLVM_SO_NAME"
+    fi
+    if test -n "$LLVM_RADEON_COMPONENTS"; then
+        LLVM_RADEON_LIBS="-l$LLVM_SO_NAME"
+    fi
+    if test -n "$LLVM_R600_COMPONENTS"; then
+        LLVM_R600_LIBS="-l$LLVM_SO_NAME"
+    fi
+    LLVM_LLVMPIPE_LIBS="-l$LLVM_SO_NAME"
 else
     if test -n "$LLVM_GALLIUM_COMPONENTS"; then
         LLVM_GALLIUM_LIBS=`$LLVM_CONFIG --libs $LLVM_GALLIUM_COMPONENTS`
@@ -1855,6 +1865,7 @@ else
             LLVM_R600_LIBS=`strip_llvm_libs "$LLVM_GALLIUM_LIBS" "$LLVM_CONFIG --libs $LLVM_R600_COMPONENTS"`
         fi
     fi
+    LLVM_LLVMPIPE_LIBS=`$LLVM_CONFIG --libs core`
 fi
 fi
 
@@ -1862,6 +1873,7 @@ AC_SUBST([LLVM_GALLIUM_LIBS])
 AC_SUBST([LLVM_OPENCL_LIBS])
 AC_SUBST([LLVM_RADEON_LIBS])
 AC_SUBST([LLVM_R600_LIBS])
+AC_SUBST([LLVM_LLVMPIPE_LIBS])
 
 AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
@@ -1914,6 +1926,14 @@ 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)
+dnl Whether libr300-helper must be built
+NEED_R300_HELPER=no
+if test true && (echo "$GALLIUM_TARGET_DIRS" | \
+	grep -e "pipe-loader" -e "vdpau-r300" -e "xorg-r300" -e "xvmc-r300"); then
+    NEED_R300_HELPER=yes
+fi
+AM_CONDITIONAL(NEED_R300_HELPER, test x$NEED_R300_HELPER = 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/Makefile.am b/src/gallium/drivers/Makefile.am
index 171d102..7b0808b 100644
--- a/src/gallium/drivers/Makefile.am
+++ b/src/gallium/drivers/Makefile.am
@@ -7,41 +7,57 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/drivers \
 	$(DEFINES)
 
-AM_CFLAGS = $(VISIBILITY_CFLAGS)
-
-noinst_LTLIBRARIES =
+mesalib_LTLIBRARIES =
 
 SUBDIRS = . trace rbug
 
 ################################################################################
 
-noinst_LTLIBRARIES += galahad/libgalahad.la
+mesalib_LTLIBRARIES += galahad/libgalahad.la
+
+galahad_libgalahad_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+
+galahad_libgalahad_la_CFLAGS = $(VISIBILITY_CFLAGS)
 
 galahad_libgalahad_la_SOURCES = \
 	galahad/glhd_objects.c \
 	galahad/glhd_context.c \
 	galahad/glhd_screen.c
 
+galahad_libgalahad_la_LIBADD = $(top_builddir)/src/gallium/auxiliary/libgallium.la
+
 ################################################################################
 
-noinst_LTLIBRARIES += identity/libidentity.la
+mesalib_LTLIBRARIES += identity/libidentity.la
+
+identity_libidentity_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+
+identity_libidentity_la_CFLAGS = $(VISIBILITY_CFLAGS)
 
 identity_libidentity_la_SOURCES = \
 	identity/id_objects.c \
 	identity/id_context.c \
 	identity/id_screen.c
 
+identity_libidentity_la_LIBADD = $(top_builddir)/src/gallium/auxiliary/libgallium.la
+
 ################################################################################
 
 # Meta-driver which combines whichever software rasterizers have been
 # built into a single convenience library.
 
-noinst_LTLIBRARIES += noop/libnoop.la
+mesalib_LTLIBRARIES += noop/libnoop.la
+
+noop_libnoop_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+
+noop_libnoop_la_CFLAGS = $(VISIBILITY_CFLAGS)
 
 noop_libnoop_la_SOURCES = \
 	noop/noop_pipe.c \
 	noop/noop_state.c
 
+noop_libnoop_la_LIBADD = $(top_builddir)/src/gallium/auxiliary/libgallium.la
+
 ################################################################################
 
 if HAVE_GALLIUM_R600
diff --git a/src/gallium/drivers/freedreno/Makefile.am b/src/gallium/drivers/freedreno/Makefile.am
index b6dbbd1..414eed5 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -1,6 +1,6 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libfreedreno.la
+mesalib_LTLIBRARIES = libfreedreno.la
 
 AM_CFLAGS = \
 	-Wno-packed-bitfield-compat \
@@ -13,6 +13,9 @@ AM_CFLAGS = \
 
 SUBDIRS = a2xx a3xx
 
+libfreedreno_la_LDFLAGS = \
+	-Wl,--no-undefined -shared -avoid-version
+
 libfreedreno_la_SOURCES = \
 	freedreno_util.c \
 	freedreno_fence.c \
@@ -27,5 +30,6 @@ libfreedreno_la_SOURCES = \
 
 libfreedreno_la_LIBADD = \
 	a3xx/libfd3xx.la \
-	a2xx/libfd2xx.la
-
+	a2xx/libfd2xx.la \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(FREEDRENO_LIBS)
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index 36ef8b0..5f54be6 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -27,6 +27,7 @@
  */
 
 
+#include "pipe/p_compiler.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
@@ -360,6 +361,7 @@ fd_screen_bo_from_handle(struct pipe_screen *pscreen,
 	return bo;
 }
 
+PUBLIC
 struct pipe_screen *
 fd_screen_create(struct fd_device *dev)
 {
diff --git a/src/gallium/drivers/galahad/glhd_screen.c b/src/gallium/drivers/galahad/glhd_screen.c
index 16a5ff1..7344718 100644
--- a/src/gallium/drivers/galahad/glhd_screen.c
+++ b/src/gallium/drivers/galahad/glhd_screen.c
@@ -27,6 +27,7 @@
  **************************************************************************/
 
 
+#include "pipe/p_compiler.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
 #include "util/u_memory.h"
@@ -334,6 +335,7 @@ galahad_screen_get_timestamp(struct pipe_screen *_screen)
    return screen->get_timestamp(screen);
 }
 
+PUBLIC
 struct pipe_screen *
 galahad_screen_create(struct pipe_screen *screen)
 {
diff --git a/src/gallium/drivers/i915/Makefile.am b/src/gallium/drivers/i915/Makefile.am
index 4e6f464..cb60516 100644
--- a/src/gallium/drivers/i915/Makefile.am
+++ b/src/gallium/drivers/i915/Makefile.am
@@ -23,7 +23,11 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libi915.la
+mesalib_LTLIBRARIES = libi915.la
+
+libi915_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+
+AM_CFLAGS = $(VISIBILITY_CFLAGS)
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/drivers \
@@ -31,3 +35,5 @@ AM_CPPFLAGS = \
 	$(GALLIUM_CFLAGS)
 
 libi915_la_SOURCES = $(C_SOURCES)
+
+libi915_la_LIBADD = $(top_builddir)/src/gallium/auxiliary/libgallium.la
diff --git a/src/gallium/drivers/i915/i915_debug.c b/src/gallium/drivers/i915/i915_debug.c
index b072031..07ec680 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -33,6 +33,7 @@
 #include "i915_batch.h"
 #include "util/u_debug.h"
 
+#include "pipe/p_compiler.h"
 
 
 static const struct debug_named_value debug_options[] = {
@@ -895,7 +896,7 @@ static boolean i915_debug_packet( struct debug_stream *stream )
 }
 
 
-
+PUBLIC
 void
 i915_dump_batchbuffer( struct i915_winsys_batchbuffer *batch )
 {
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 556dda8..8b4ac64 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -41,6 +41,8 @@
 #include "i915_winsys.h"
 #include "i915_public.h"
 
+#include "pipe/p_compiler.h"
+
 
 /*
  * Probe functions
@@ -443,6 +445,7 @@ i915_destroy_screen(struct pipe_screen *screen)
 /**
  * Create a new i915_screen object
  */
+PUBLIC
 struct pipe_screen *
 i915_screen_create(struct i915_winsys *iws)
 {
diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c
index 26df7f6..ffa699e 100644
--- a/src/gallium/drivers/identity/id_screen.c
+++ b/src/gallium/drivers/identity/id_screen.c
@@ -26,6 +26,7 @@
  **************************************************************************/
 
 
+#include "pipe/p_compiler.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
 #include "util/u_memory.h"
@@ -251,6 +252,7 @@ identity_screen_get_timestamp(struct pipe_screen *_screen)
    return screen->get_timestamp(screen);
 }
 
+PUBLIC
 struct pipe_screen *
 identity_screen_create(struct pipe_screen *screen)
 {
diff --git a/src/gallium/drivers/ilo/Makefile.am b/src/gallium/drivers/ilo/Makefile.am
index 33f2045..1f11b7d 100644
--- a/src/gallium/drivers/ilo/Makefile.am
+++ b/src/gallium/drivers/ilo/Makefile.am
@@ -24,8 +24,26 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
+# TODO:
+# libilo currently depends on functions from winsys/intel:
+
+# intel_bo_clear_relocs, intel_bo_emit_reloc, intel_bo_exec, intel_bo_get_offset,
+# intel_bo_get_reloc_count, intel_bo_get_size, intel_bo_get_virtual,
+# intel_bo_map, intel_bo_map_gtt, intel_bo_map_unsynchronized, intel_bo_pwrite,
+# intel_bo_reference, intel_bo_references, intel_bo_unmap, intel_bo_unreference,
+# intel_bo_wait, intel_winsys_alloc_buffer, intel_winsys_alloc_texture,
+# intel_winsys_check_aperture_space, intel_winsys_create_context,
+# intel_winsys_decode_commands, intel_winsys_destroy,
+# intel_winsys_destroy_context, intel_winsys_enable_reuse,
+# intel_winsys_export_handle, intel_winsys_get_info, intel_winsys_import_handle,
+# intel_winsys_read_reg
+
+# Either we move functions to here or we build winsys before drivers and LIBADD
+
 noinst_LTLIBRARIES = libilo.la
 
+#libilo_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/drivers/ilo/include \
 	-I$(top_srcdir)/src/gallium/winsys/intel \
@@ -35,3 +53,7 @@ AM_CFLAGS = \
 	$(VISIBILITY_CFLAGS)
 
 libilo_la_SOURCES = $(C_SOURCES)
+
+#libilo_la_LIBADD = \
+#	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+#	$(INTEL_LIBS)
diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c
index 3f8d431..6ff7344 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -38,6 +38,8 @@
 #include "ilo_public.h"
 #include "ilo_screen.h"
 
+/* When we build libilo shared: #include "pipe/p_compiler.h" */
+
 int ilo_debug;
 
 static const struct debug_named_value ilo_debug_flags[] = {
@@ -705,6 +707,7 @@ init_dev(struct ilo_dev_info *dev, const struct intel_winsys_info *info)
    return true;
 }
 
+/* When we build libilo shared this must be PUBLIC */
 struct pipe_screen *
 ilo_screen_create(struct intel_winsys *ws)
 {
diff --git a/src/gallium/drivers/llvmpipe/Makefile.am b/src/gallium/drivers/llvmpipe/Makefile.am
index e99a2b8..810d7c8 100644
--- a/src/gallium/drivers/llvmpipe/Makefile.am
+++ b/src/gallium/drivers/llvmpipe/Makefile.am
@@ -29,7 +29,10 @@ AM_CPPFLAGS = \
 AM_CFLAGS = $(LLVM_CFLAGS)
 AM_CXXFLAGS= $(LLVM_CXXFLAGS)
 
-noinst_LTLIBRARIES = libllvmpipe.la
+mesalib_LTLIBRARIES = libllvmpipe.la
+
+libllvmpipe_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version \
+	$(LLVM_LDFLAGS)
 
 libllvmpipe_la_SOURCES = \
 	lp_bld_alpha.c \
@@ -74,7 +77,10 @@ libllvmpipe_la_SOURCES = \
 	lp_tex_sample.c \
 	lp_texture.c
 
-libllvmpipe_la_LDFLAGS = $(LLVM_LDFLAGS)
+libllvmpipe_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(LLVM_LLVMPIPE_LIBS) \
+	-lm
 
 check_PROGRAMS = \
 	lp_test_format	\
diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c
index ac837b1..f0571de 100644
--- a/src/gallium/drivers/noop/noop_pipe.c
+++ b/src/gallium/drivers/noop/noop_pipe.c
@@ -22,6 +22,7 @@
  */
 #include <stdio.h>
 #include <errno.h>
+#include "pipe/p_compiler.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_state.h"
 #include "pipe/p_context.h"
@@ -349,6 +350,7 @@ static void noop_destroy_screen(struct pipe_screen *screen)
 	FREE(screen);
 }
 
+PUBLIC
 struct pipe_screen *noop_screen_create(struct pipe_screen *oscreen)
 {
 	struct noop_pipe_screen *noop_screen;
diff --git a/src/gallium/drivers/nouveau/Makefile.am b/src/gallium/drivers/nouveau/Makefile.am
index c4b51d9..cd9bc6a 100644
--- a/src/gallium/drivers/nouveau/Makefile.am
+++ b/src/gallium/drivers/nouveau/Makefile.am
@@ -23,7 +23,9 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libnouveau.la
+mesalib_LTLIBRARIES = libnouveau.la
+
+libnouveau_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/drivers/nouveau/include \
@@ -39,3 +41,7 @@ libnouveau_la_SOURCES = \
 	$(NV50_C_SOURCES) \
 	$(NVC0_CODEGEN_SOURCES) \
 	$(NVC0_C_SOURCES)
+
+libnouveau_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(NOUVEAU_LIBS)
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 50ddfec..22c1a91 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -23,8 +23,10 @@
  *
  */
 
+
 #include "util/u_format.h"
 #include "util/u_format_s3tc.h"
+#include "pipe/p_compiler.h"
 
 #include "nv_object.xml.h"
 #include "nv_m2mf.xml.h"
@@ -325,6 +327,7 @@ nv30_screen_destroy(struct pipe_screen *pscreen)
       return NULL;                                    \
    } while(0)
 
+PUBLIC
 struct pipe_screen *
 nv30_screen_create(struct nouveau_device *dev)
 {
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index f454ec7..b72d659 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -22,6 +22,7 @@
 
 #include "util/u_format.h"
 #include "util/u_format_s3tc.h"
+#include "pipe/p_compiler.h"
 #include "pipe/p_screen.h"
 
 #include "nv50/nv50_context.h"
@@ -605,6 +606,7 @@ int nv50_tls_realloc(struct nv50_screen *screen, unsigned tls_space)
    return 1;
 }
 
+PUBLIC
 struct pipe_screen *
 nv50_screen_create(struct nouveau_device *dev)
 {
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index ff7890b..0cd8d06 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -22,6 +22,7 @@
 
 #include "util/u_format.h"
 #include "util/u_format_s3tc.h"
+#include "pipe/p_compiler.h"
 #include "pipe/p_screen.h"
 
 #include "vl/vl_decoder.h"
@@ -531,6 +532,7 @@ nvc0_screen_resize_tls_area(struct nvc0_screen *screen,
       return NULL;                                    \
    } while(0)
 
+PUBLIC
 struct pipe_screen *
 nvc0_screen_create(struct nouveau_device *dev)
 {
diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am
index 14aaf03..e052c70 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -1,7 +1,14 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libr300.la libr300-helper.la
+mesalib_LTLIBRARIES = libr300.la
+libr300_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+
+if NEED_R300_HELPER
+mesalib_LTLIBRARIES += libr300-helper.la
+libr300_helper_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+endif
+
 check_PROGRAMS = r300_compiler_tests
 testdir = compiler/tests
 TESTS = r300_compiler_tests
@@ -32,6 +39,10 @@ r300_compiler_tests_SOURCES = \
 
 libr300_la_SOURCES = $(C_SOURCES)
 
+libr300_la_LIBADD = \
+	$(LIBMESAGALLIUM_LIBS) \
+	-lm
+
 # 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
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 063bc09..eaef221 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -21,6 +21,9 @@
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
+
+#include "pipe/p_compiler.h"
+
 #include "util/u_format.h"
 #include "util/u_format_s3tc.h"
 #include "util/u_memory.h"
@@ -592,6 +595,7 @@ static boolean r300_fence_finish(struct pipe_screen *screen,
     return TRUE;
 }
 
+PUBLIC
 struct pipe_screen* r300_screen_create(struct radeon_winsys *rws)
 {
     struct r300_screen *r300screen = CALLOC_STRUCT(r300_screen);
diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
index d8dc816..8b28328 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -1,7 +1,9 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libr600.la
+mesalib_LTLIBRARIES = libr600.la
+
+libr600_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
 AM_CFLAGS = \
 	-I$(top_srcdir)/src/gallium/drivers \
@@ -22,13 +24,24 @@ libr600_la_SOURCES = \
 	$(C_SOURCES) \
 	$(CXX_SOURCES)
 
+libr600_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(LLVM_R600_LIBS) \
+	-lm
+
 if NEED_RADEON_LLVM
 libr600_la_SOURCES += \
 	$(LLVM_C_SOURCES)
 
+libr600_la_LIBADD += $(ELF_LIB)
+
+libr600_la_LDFLAGS += \
+	$(LLVM_LDFLAGS)
+
 AM_CFLAGS += \
 	$(LLVM_CFLAGS) \
-	-I$(top_srcdir)/src/gallium/drivers/radeon/
+	-I$(top_srcdir)/src/gallium/drivers/radeon
 endif
 
 if USE_R600_LLVM_COMPILER
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index aa5cadf..b05791c 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -29,6 +29,7 @@
 #include "sb/sb_public.h"
 
 #include <errno.h>
+#include "pipe/p_compiler.h"
 #include "pipe/p_shader_tokens.h"
 #include "util/u_blitter.h"
 #include "util/u_debug.h"
@@ -1193,6 +1194,7 @@ static int r600_get_driver_query_info(struct pipe_screen *screen,
 	return 1;
 }
 
+PUBLIC
 struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
 {
 	struct r600_screen *rscreen = CALLOC_STRUCT(r600_screen);
diff --git a/src/gallium/drivers/radeonsi/Makefile.am b/src/gallium/drivers/radeonsi/Makefile.am
index ac75231..9ea33a9 100644
--- a/src/gallium/drivers/radeonsi/Makefile.am
+++ b/src/gallium/drivers/radeonsi/Makefile.am
@@ -23,7 +23,10 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libradeonsi.la
+mesalib_LTLIBRARIES = libradeonsi.la
+
+libradeonsi_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version \
+	$(LLVM_LDFLAGS)
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/drivers/radeon \
@@ -31,6 +34,15 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
 	$(GALLIUM_CFLAGS) \
 	$(RADEON_CFLAGS)
-AM_CFLAGS = $(LLVM_CFLAGS)
+
+AM_CFLAGS = \
+	$(LLVM_CFLAGS) \
+	$(VISIBILITY_CFLAGS)
 
 libradeonsi_la_SOURCES = $(C_SOURCES)
+
+libradeonsi_la_LIBADD = \
+	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(LLVM_RADEON_LIBS) \
+	$(ELF_LIB)
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
index 6ca138f..9589b63 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
@@ -22,6 +22,7 @@
  */
 #include <stdio.h>
 #include <errno.h>
+#include "pipe/p_compiler.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_state.h"
 #include "pipe/p_context.h"
@@ -814,6 +815,7 @@ static uint64_t r600_get_timestamp(struct pipe_screen *screen)
 		rscreen->b.info.r600_clock_crystal_freq;
 }
 
+PUBLIC
 struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
 {
 	struct r600_screen *rscreen = CALLOC_STRUCT(r600_screen);
diff --git a/src/gallium/drivers/rbug/Makefile.am b/src/gallium/drivers/rbug/Makefile.am
index 3c1a8b5..841a2cb 100644
--- a/src/gallium/drivers/rbug/Makefile.am
+++ b/src/gallium/drivers/rbug/Makefile.am
@@ -22,20 +22,27 @@
 
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = librbug.la
+mesalib_LTLIBRARIES = librbug.la
+
+librbug_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
 # GALLIUM_CFLAGS must appear before src/gallium/drivers
 # because there are stupidly two rbug_context.h files in
 # different directories, and which one is included by the
 # preprocessor is determined by the ordering of the -I flags.
 AM_CFLAGS = \
-	$(GALLIUM_CFLAGS) \
 	$(VISIBILITY_CFLAGS) \
+	$(GALLIUM_CFLAGS) \
 	-I$(top_srcdir)/src/gallium/drivers \
-	-I$(top_srcdir)/include
+	-I$(top_srcdir)/include \
+	$(PTHREAD_CFLAGS)
 
 librbug_la_SOURCES = \
 	rbug_core.c \
 	rbug_context.c \
 	rbug_objects.c \
 	rbug_screen.c
+
+librbug_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(PTHREAD_LIBS)
diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c
index 2471fdb..0434186 100644
--- a/src/gallium/drivers/rbug/rbug_screen.c
+++ b/src/gallium/drivers/rbug/rbug_screen.c
@@ -26,6 +26,7 @@
  **************************************************************************/
 
 
+#include "pipe/p_compiler.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
 #include "util/u_memory.h"
@@ -246,6 +247,7 @@ rbug_enabled()
    return debug_get_option_rbug();
 }
 
+PUBLIC
 struct pipe_screen *
 rbug_screen_create(struct pipe_screen *screen)
 {
diff --git a/src/gallium/drivers/softpipe/Makefile.am b/src/gallium/drivers/softpipe/Makefile.am
index 52ce958..328e004 100644
--- a/src/gallium/drivers/softpipe/Makefile.am
+++ b/src/gallium/drivers/softpipe/Makefile.am
@@ -27,7 +27,9 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
 	$(GALLIUM_CFLAGS)
 
-noinst_LTLIBRARIES = libsoftpipe.la
+mesalib_LTLIBRARIES = libsoftpipe.la
+
+libsoftpipe_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
 libsoftpipe_la_SOURCES = \
 	sp_fs_exec.c \
@@ -59,3 +61,7 @@ libsoftpipe_la_SOURCES = \
 	sp_tex_tile_cache.c \
 	sp_tile_cache.c \
 	sp_surface.c
+
+libsoftpipe_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	-lm
diff --git a/src/gallium/drivers/svga/Makefile.am b/src/gallium/drivers/svga/Makefile.am
index 7eacd90..5647b12 100644
--- a/src/gallium/drivers/svga/Makefile.am
+++ b/src/gallium/drivers/svga/Makefile.am
@@ -29,11 +29,14 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
 	$(GALLIUM_CFLAGS)
 
-AM_CFLAGS = $(VISIBILITY_CFLAGS)
-
 #On some systems -std= must be added to CFLAGS to be the last -std=
 CFLAGS += -std=gnu99
 
-noinst_LTLIBRARIES = libsvga.la
+mesalib_LTLIBRARIES = libsvga.la
+
+libsvga_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
 libsvga_la_SOURCES = $(C_SOURCES)
+
+libsvga_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 40b35cc..e5d3d51 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -23,6 +23,9 @@
  *
  **********************************************************/
 
+
+#include "pipe/p_compiler.h"
+
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
 #include "util/u_string.h"
@@ -539,6 +542,7 @@ svga_destroy_screen( struct pipe_screen *screen )
 /**
  * Create a new svga_screen object
  */
+PUBLIC
 struct pipe_screen *
 svga_screen_create(struct svga_winsys_screen *sws)
 {
diff --git a/src/gallium/drivers/trace/Makefile.am b/src/gallium/drivers/trace/Makefile.am
index 984ead4..9345df7 100644
--- a/src/gallium/drivers/trace/Makefile.am
+++ b/src/gallium/drivers/trace/Makefile.am
@@ -1,10 +1,12 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-	$(GALLIUM_CFLAGS) \
-	$(VISIBILITY_CFLAGS)
+	$(VISIBILITY_CFLAGS) \
+	$(GALLIUM_CFLAGS)
 
-noinst_LTLIBRARIES = libtrace.la
+mesalib_LTLIBRARIES = libtrace.la
+
+libtrace_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
 libtrace_la_SOURCES = \
 	tr_context.c \
@@ -12,3 +14,6 @@ libtrace_la_SOURCES = \
 	tr_dump_state.c \
 	tr_screen.c \
 	tr_texture.c
+
+libtrace_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 5281ba8..1131ee8 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -25,6 +25,7 @@
  *
  **************************************************************************/
 
+
 #include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_simple_list.h"
@@ -36,6 +37,7 @@
 #include "tr_screen.h"
 #include "tr_public.h"
 
+#include "pipe/p_compiler.h"
 #include "pipe/p_format.h"
 
 
@@ -450,6 +452,7 @@ trace_enabled(void)
    return trace;
 }
 
+PUBLIC
 struct pipe_screen *
 trace_screen_create(struct pipe_screen *screen)
 {
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am b/src/gallium/targets/dri-freedreno/Makefile.am
index b549ec1..6df6db2 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -42,9 +42,6 @@ dri_LTLIBRARIES = kgsl_dri.la msm_dri.la
 COMMON_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 COMMON_LIBADD = \
-	$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
-	$(top_builddir)/src/mesa/libmesagallium.la \
-	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
 	$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
 	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
 	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
@@ -52,8 +49,8 @@ COMMON_LIBADD = \
 	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
 	$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
 	$(GALLIUM_DRI_LIB_DEPS) \
-	$(LIBDRM_LIBS) \
-	$(FREEDRENO_LIBS)
+	$(DRICOMMON_LIB) \
+	$(LIBMESAGALLIUM_LIBS)
 
 if HAVE_MESA_LLVM
 COMMON_LDFLAGS += $(LLVM_LDFLAGS)
diff --git a/src/gallium/targets/dri-r600/Makefile.am b/src/gallium/targets/dri-r600/Makefile.am
index 2ad460f..5d17f91 100644
--- a/src/gallium/targets/dri-r600/Makefile.am
+++ b/src/gallium/targets/dri-r600/Makefile.am
@@ -46,13 +46,11 @@ r600_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 r600_dri_la_LIBADD = \
 	$(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 \
 	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
 	$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
-	$(LLVM_R600_LIBS) \
 	$(DRICOMMON_LIB) \
 	$(LIBMESAGALLIUM_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
diff --git a/src/gallium/targets/dri-radeonsi/Makefile.am b/src/gallium/targets/dri-radeonsi/Makefile.am
index ab104c8..a3f1fb0 100644
--- a/src/gallium/targets/dri-radeonsi/Makefile.am
+++ b/src/gallium/targets/dri-radeonsi/Makefile.am
@@ -46,13 +46,11 @@ radeonsi_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 radeonsi_dri_la_LIBADD = \
 	$(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 \
-	$(LLVM_RADEON_LIBS) \
 	$(DRICOMMON_LIB) \
 	$(LIBMESAGALLIUM_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
diff --git a/src/gallium/targets/dri-swrast/Makefile.am b/src/gallium/targets/dri-swrast/Makefile.am
index 471c36a..33d9448 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -26,6 +26,7 @@ AM_CFLAGS = \
 	$(GALLIUM_CFLAGS) \
 	$(PTHREAD_CFLAGS) \
 	$(LIBDRM_CFLAGS)
+
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/winsys/sw/dri \
 	-I$(top_srcdir)/src/gallium/drivers \
@@ -47,7 +48,8 @@ swrast_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
 
-swrast_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
+swrast_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared \
+	$(LLVM_LDFLAGS)
 
 swrast_dri_la_LIBADD = \
 	$(top_builddir)/src/gallium/state_trackers/dri/sw/libdrisw.la \
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 5b000f2..015133c 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -159,19 +159,12 @@ endif
 if HAVE_GALLIUM_R600
 AM_CPPFLAGS += -D_EGL_PIPE_R600=1
 egl_gallium_la_LIBADD += \
-	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
-	$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
-	$(LLVM_R600_LIBS)
+	$(top_builddir)/src/gallium/drivers/r600/libr600.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 \
-	$(LLVM_RADEON_LIBS)
-endif
 endif
 egl_gallium_la_LIBADD += \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index af668de..a21330f 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -87,8 +87,6 @@ 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 \
-	$(LLVM_R600_LIBS) \
 	$(LIBDRM_LIBS) \
 	$(RADEON_LIBS)
 pipe_r600_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
@@ -101,8 +99,6 @@ 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 \
-	$(LLVM_RADEON_LIBS) \
 	$(LIBDRM_LIBS) \
 	$(RADEON_LIBS)
 pipe_radeonsi_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
diff --git a/src/gallium/targets/vdpau-r300/Makefile.am b/src/gallium/targets/vdpau-r300/Makefile.am
index c22448c..5e124b0 100644
--- a/src/gallium/targets/vdpau-r300/Makefile.am
+++ b/src/gallium/targets/vdpau-r300/Makefile.am
@@ -50,9 +50,6 @@ libvdpau_r300_la_LIBADD = \
 	$(top_builddir)/src/gallium/drivers/r300/libr300.la \
 	$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
 	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
-	$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
 	$(GALLIUM_DRI_LIB_DEPS) \
 	$(VDPAU_LIBS) \
 	$(LIBDRM_LIBS) \
diff --git a/src/gallium/targets/vdpau-r600/Makefile.am b/src/gallium/targets/vdpau-r600/Makefile.am
index 14298a0..527edd6 100644
--- a/src/gallium/targets/vdpau-r600/Makefile.am
+++ b/src/gallium/targets/vdpau-r600/Makefile.am
@@ -46,11 +46,8 @@ 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 \
-	$(LLVM_R600_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
 	$(VDPAU_LIBS) \
 	$(LIBDRM_LIBS) \
diff --git a/src/gallium/targets/vdpau-radeonsi/Makefile.am b/src/gallium/targets/vdpau-radeonsi/Makefile.am
index 0777044..073c885 100644
--- a/src/gallium/targets/vdpau-radeonsi/Makefile.am
+++ b/src/gallium/targets/vdpau-radeonsi/Makefile.am
@@ -47,13 +47,8 @@ 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 \
-	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-	$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
-	$(LLVM_RADEON_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
 	$(VDPAU_LIBS) \
 	$(LIBDRM_LIBS) \
diff --git a/src/gallium/targets/vdpau-softpipe/Makefile.am b/src/gallium/targets/vdpau-softpipe/Makefile.am
index 2b59cfe..20ffb6e 100644
--- a/src/gallium/targets/vdpau-softpipe/Makefile.am
+++ b/src/gallium/targets/vdpau-softpipe/Makefile.am
@@ -33,6 +33,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/gallium/winsys/sw/dri
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
+
 vdpau_LTLIBRARIES = libvdpau_softpipe.la
 
 libvdpau_softpipe_la_SOURCES = \
@@ -54,9 +55,8 @@ libvdpau_softpipe_la_LIBADD = \
 	$(VDPAU_LIBS) \
 	$(DLOPEN_LIBS) \
 	$(LIBDRM_LIBS) \
-	-lXext
-
-nodist_EXTRA_libvdpau_softpipe_la_SOURCES = dummy.cpp
+	-lXext \
+	-lm
 
 if HAVE_MESA_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
diff --git a/src/gallium/targets/xorg-r600/Makefile.am b/src/gallium/targets/xorg-r600/Makefile.am
index 00ab315..2be5d11 100644
--- a/src/gallium/targets/xorg-r600/Makefile.am
+++ b/src/gallium/targets/xorg-r600/Makefile.am
@@ -47,12 +47,10 @@ 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 \
 	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-	$(LLVM_R600_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
 	$(LIBDRM_XORG_LIBS) \
 	$(LIBKMS_XORG_LIBS) \
diff --git a/src/gallium/targets/xorg-radeonsi/Makefile.am b/src/gallium/targets/xorg-radeonsi/Makefile.am
index f322afd..49aa036 100644
--- a/src/gallium/targets/xorg-radeonsi/Makefile.am
+++ b/src/gallium/targets/xorg-radeonsi/Makefile.am
@@ -48,12 +48,10 @@ 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 \
 	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-	$(LLVM_RADEON_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
 	$(LIBDRM_XORG_LIBS) \
 	$(LIBKMS_XORG_LIBS) \
diff --git a/src/gallium/targets/xvmc-r600/Makefile.am b/src/gallium/targets/xvmc-r600/Makefile.am
index 6ea4cf4..15526d8 100644
--- a/src/gallium/targets/xvmc-r600/Makefile.am
+++ b/src/gallium/targets/xvmc-r600/Makefile.am
@@ -46,11 +46,9 @@ 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 \
-	$(LLVM_R600_LIBS) \
 	$(GALLIUM_DRI_LIB_DEPS) \
 	$(XVMC_LIBS) \
 	$(LIBDRM_LIBS) \
diff --git a/src/gallium/targets/xvmc-softpipe/Makefile.am b/src/gallium/targets/xvmc-softpipe/Makefile.am
index e466f46..ffc448a 100644
--- a/src/gallium/targets/xvmc-softpipe/Makefile.am
+++ b/src/gallium/targets/xvmc-softpipe/Makefile.am
@@ -50,7 +50,8 @@ libXvMCsoftpipe_la_LIBADD = \
 	$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
 	$(XVMC_LIBS) \
 	$(DLOPEN_LIBS) \
-	$(LIBDRM_LIBS)
+	$(LIBDRM_LIBS) \
+	-lXext
 
 if HAVE_MESA_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
-- 
1.8.1.4



More information about the mesa-dev mailing list