Re: [Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-24 Thread Keith Whitwell
On Fri, Dec 24, 2010 at 4:12 AM, Christopher James Halse Rogers
christopher.halse.rog...@canonical.com wrote:
 On Tue, 2010-12-21 at 08:58 +, Keith Whitwell wrote:
 This promotes a private interface to a public one, right?  If so that
 isn't really doing us any favours as next people will complain when that
 newly public interface varies between releases.

 Not really; the new libraries are private (contained within
 $DRI_INSTALL_DIR, so /usr/lib/dri by default) and unversioned.  This is
 not significantly different to, say, the shared objects in /usr/lib/egl
 which have come and gone without complaint.

 This patch does *not* expose any additional interfaces in the public
 libGL, GLES, etc libraries.  Where objects need to be built with default
 visibility, they're built twice; once with -fvisibility=hidden for the
 code destined for the public libraries, once without for the shared,
 private libraries.


 If you want to save disk space by sharing components, what about an
 alternate approach -- investigate methods for building all the DRI
 drivers into a single binary?  That would keep the internal interface
 private  possibly share more space than this approach.

 It would indeed save a bit more space, and also apply more easily to the
 gallium drivers.  It'd require a much larger patch though - we'd need to
 change the libGL←→dri driver interface and patch X to keep up, right?

 If that's the direction you'd prefer to go, I could look at doing that.
 I think it'd be substantially more invasive, though, and more difficult
 to make optional.

I don't think my concerns are sufficient to hold this up -- if others
aren't concerned then guess I'm ok with this as an optional mechanism
for environments where version skew is unlikely, such as live cds.

Keith
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-23 Thread Eric Anholt
On Tue, 21 Dec 2010 08:58:24 +, Keith Whitwell kei...@vmware.com wrote:
 This promotes a private interface to a public one, right?  If so that
 isn't really doing us any favours as next people will complain when that
 newly public interface varies between releases.
 
 If you want to save disk space by sharing components, what about an
 alternate approach -- investigate methods for building all the DRI
 drivers into a single binary?  That would keep the internal interface
 private  possibly share more space than this approach.
 
 Keith

The point of being optional was that distros that have a clue and know
that these are private interfaces for the drivers built against that
shared core could save disk space (and us driver developers could save
build time, too).  Note that there is no version number on the library
-- ABI stability is very much not guaranteed, and you have to ship them
all as one big package (which is no big deal once you've gone to shared
core).


pgpe5C0IO16uz.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-23 Thread Christopher James Halse Rogers
On Tue, 2010-12-21 at 08:58 +, Keith Whitwell wrote:
 This promotes a private interface to a public one, right?  If so that
 isn't really doing us any favours as next people will complain when that
 newly public interface varies between releases.

Not really; the new libraries are private (contained within
$DRI_INSTALL_DIR, so /usr/lib/dri by default) and unversioned.  This is
not significantly different to, say, the shared objects in /usr/lib/egl
which have come and gone without complaint.

This patch does *not* expose any additional interfaces in the public
libGL, GLES, etc libraries.  Where objects need to be built with default
visibility, they're built twice; once with -fvisibility=hidden for the
code destined for the public libraries, once without for the shared,
private libraries.

 
 If you want to save disk space by sharing components, what about an
 alternate approach -- investigate methods for building all the DRI
 drivers into a single binary?  That would keep the internal interface
 private  possibly share more space than this approach.
 
It would indeed save a bit more space, and also apply more easily to the
gallium drivers.  It'd require a much larger patch though - we'd need to
change the libGL←→dri driver interface and patch X to keep up, right?

If that's the direction you'd prefer to go, I could look at doing that.
I think it'd be substantially more invasive, though, and more difficult
to make optional.

 Keith
 
 On Mon, 2010-12-20 at 20:34 -0800, Christopher James Halse Rogers wrote:
  This an adds --enable-shared-dricore option to configure.  When enabled,
  DRI modules will link against a shared copy of the common mesa routines
  rather than statically linking these.
  
  This saves about 30MB on disc with a full complement of classic DRI
  drivers.
  ---
  
  Resending as it seems to have been ignored the first time.
  We've applied this in Ubuntu as we are (as always) scrabbling for
  CD space on the LiveCDs, but Fedora had a similar patch in the dim
  distant past.
  
  This seems to be something that distros generally will be interested
  in.
  
   configs/autoconf.in|8 -
   configs/default|3 ++
   configs/freebsd-dri|4 ++-
   configs/linux-dri  |4 ++-
   configs/linux-dri-xcb  |4 ++-
   configs/linux-egl  |4 ++-
   configs/linux-indirect |3 +-
   configure.ac   |   32 +-
   src/glsl/Makefile  |   20 ++-
   src/mesa/Makefile  |   57 
  +++
   src/mesa/drivers/dri/Makefile.template |   12 +++
   src/mesa/drivers/osmesa/Makefile   |2 +-
   src/mesa/x86/read_rgba_span_x86.S  |8 
   13 files changed, 136 insertions(+), 25 deletions(-)
  
  diff --git a/configs/autoconf.in b/configs/autoconf.in
  index e2d70c6..37a137d 100644
  --- a/configs/autoconf.in
  +++ b/configs/autoconf.in
  @@ -33,6 +33,8 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
   LLVM_LIBS = @LLVM_LIBS@
   GLW_CFLAGS = @GLW_CFLAGS@
   GLUT_CFLAGS = @GLUT_CFLAGS@
  +DRI_CFLAGS = @DRI_CFLAGS@
  +DRI_CXXFLAGS = @DRI_CXXFLAGS@
  
   TALLOC_LIBS = @TALLOC_LIBS@
   TALLOC_CFLAGS = @TALLOC_CFLAGS@
  @@ -103,7 +105,10 @@ GALLIUM_AUXILIARIES = 
  $(TOP)/src/gallium/auxiliary/libgallium.a
   GALLIUM_DRIVERS = $(foreach 
  DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
  
   # Driver specific build vars
  -DRI_DIRS = @DRI_DIRS@
  +DRI_DIRS = @DRI_DIRS@
  +DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
  +DRICORE_LIBS = @DRICORE_LIBS@
  +DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
   EGL_PLATFORMS = @EGL_PLATFORMS@
   EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
  
  @@ -131,6 +136,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
   VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
  
   # DRI dependencies
  +MESA_MODULES = @MESA_MODULES@
   DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
   LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
   LIBDRM_LIB = @LIBDRM_LIBS@
  diff --git a/configs/default b/configs/default
  index 0301345..1feeb97 100644
  --- a/configs/default
  +++ b/configs/default
  @@ -85,6 +85,9 @@ VG_LIB_GLOB = $(VG_LIB_NAME)*
   TALLOC_LIBS = `pkg-config --libs talloc`
   TALLOC_CFLAGS = `pkg-config --cflags talloc`
  
  +DRI_CFLAGS = $(CFLAGS)
  +DRI_CXXFLAGS = $(CXXFLAGS)
  +
   # Optional assembly language optimization files for libGL
   MESA_ASM_SOURCES =
  
  diff --git a/configs/freebsd-dri b/configs/freebsd-dri
  index a4aa82e..23cf58a 100644
  --- a/configs/freebsd-dri
  +++ b/configs/freebsd-dri
  @@ -30,9 +30,11 @@ ASM_SOURCES =
   MESA_ASM_SOURCES =
  
   # Library/program dependencies
  +MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
  +
   LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
   LIBDRM_LIB = `pkg-config --libs libdrm`
  -DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
  +DRI_LIB_DEPS = 

Re: [Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-21 Thread Keith Whitwell
This promotes a private interface to a public one, right?  If so that
isn't really doing us any favours as next people will complain when that
newly public interface varies between releases.

If you want to save disk space by sharing components, what about an
alternate approach -- investigate methods for building all the DRI
drivers into a single binary?  That would keep the internal interface
private  possibly share more space than this approach.

Keith

On Mon, 2010-12-20 at 20:34 -0800, Christopher James Halse Rogers wrote:
 This an adds --enable-shared-dricore option to configure.  When enabled,
 DRI modules will link against a shared copy of the common mesa routines
 rather than statically linking these.
 
 This saves about 30MB on disc with a full complement of classic DRI
 drivers.
 ---
 
 Resending as it seems to have been ignored the first time.
 We've applied this in Ubuntu as we are (as always) scrabbling for
 CD space on the LiveCDs, but Fedora had a similar patch in the dim
 distant past.
 
 This seems to be something that distros generally will be interested
 in.
 
  configs/autoconf.in|8 -
  configs/default|3 ++
  configs/freebsd-dri|4 ++-
  configs/linux-dri  |4 ++-
  configs/linux-dri-xcb  |4 ++-
  configs/linux-egl  |4 ++-
  configs/linux-indirect |3 +-
  configure.ac   |   32 +-
  src/glsl/Makefile  |   20 ++-
  src/mesa/Makefile  |   57 +++
  src/mesa/drivers/dri/Makefile.template |   12 +++
  src/mesa/drivers/osmesa/Makefile   |2 +-
  src/mesa/x86/read_rgba_span_x86.S  |8 
  13 files changed, 136 insertions(+), 25 deletions(-)
 
 diff --git a/configs/autoconf.in b/configs/autoconf.in
 index e2d70c6..37a137d 100644
 --- a/configs/autoconf.in
 +++ b/configs/autoconf.in
 @@ -33,6 +33,8 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
  LLVM_LIBS = @LLVM_LIBS@
  GLW_CFLAGS = @GLW_CFLAGS@
  GLUT_CFLAGS = @GLUT_CFLAGS@
 +DRI_CFLAGS = @DRI_CFLAGS@
 +DRI_CXXFLAGS = @DRI_CXXFLAGS@
 
  TALLOC_LIBS = @TALLOC_LIBS@
  TALLOC_CFLAGS = @TALLOC_CFLAGS@
 @@ -103,7 +105,10 @@ GALLIUM_AUXILIARIES = 
 $(TOP)/src/gallium/auxiliary/libgallium.a
  GALLIUM_DRIVERS = $(foreach 
 DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
 
  # Driver specific build vars
 -DRI_DIRS = @DRI_DIRS@
 +DRI_DIRS = @DRI_DIRS@
 +DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
 +DRICORE_LIBS = @DRICORE_LIBS@
 +DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
  EGL_PLATFORMS = @EGL_PLATFORMS@
  EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
 
 @@ -131,6 +136,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
  VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
 
  # DRI dependencies
 +MESA_MODULES = @MESA_MODULES@
  DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
  LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
  LIBDRM_LIB = @LIBDRM_LIBS@
 diff --git a/configs/default b/configs/default
 index 0301345..1feeb97 100644
 --- a/configs/default
 +++ b/configs/default
 @@ -85,6 +85,9 @@ VG_LIB_GLOB = $(VG_LIB_NAME)*
  TALLOC_LIBS = `pkg-config --libs talloc`
  TALLOC_CFLAGS = `pkg-config --cflags talloc`
 
 +DRI_CFLAGS = $(CFLAGS)
 +DRI_CXXFLAGS = $(CXXFLAGS)
 +
  # Optional assembly language optimization files for libGL
  MESA_ASM_SOURCES =
 
 diff --git a/configs/freebsd-dri b/configs/freebsd-dri
 index a4aa82e..23cf58a 100644
 --- a/configs/freebsd-dri
 +++ b/configs/freebsd-dri
 @@ -30,9 +30,11 @@ ASM_SOURCES =
  MESA_ASM_SOURCES =
 
  # Library/program dependencies
 +MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
 +
  LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
  LIBDRM_LIB = `pkg-config --libs libdrm`
 -DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
 +DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat 
 $(LIBDRM_LIB)
  GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
 -lm -pthread $(LIBDRM_LIB)
 
 diff --git a/configs/linux-dri b/configs/linux-dri
 index 64fc407..caf0406 100644
 --- a/configs/linux-dri
 +++ b/configs/linux-dri
 @@ -43,9 +43,11 @@ MESA_ASM_SOURCES =
  # Library/program dependencies
  EXTRA_LIB_PATH=-L/usr/X11R6/lib
 
 +MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
 +
  LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
  LIBDRM_LIB = $(shell pkg-config --libs libdrm)
 -DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc 
 $(LIBDRM_LIB)
 +DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
 -ltalloc $(LIBDRM_LIB)
  GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
 -lm -lpthread -ldl $(LIBDRM_LIB)
 
 diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb
 index 8092a04..7518080 100644
 --- a/configs/linux-dri-xcb
 +++ b/configs/linux-dri-xcb
 @@ -41,9 +41,11 @@ MESA_ASM_SOURCES =
  # 

Re: [Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-21 Thread Dan Nicholson
On Mon, Dec 20, 2010 at 8:34 PM, Christopher James Halse Rogers
christopher.halse.rog...@canonical.com wrote:
 This an adds --enable-shared-dricore option to configure.  When enabled,
 DRI modules will link against a shared copy of the common mesa routines
 rather than statically linking these.

 This saves about 30MB on disc with a full complement of classic DRI
 drivers.
 ---

 Resending as it seems to have been ignored the first time.
 We've applied this in Ubuntu as we are (as always) scrabbling for
 CD space on the LiveCDs, but Fedora had a similar patch in the dim
 distant past.

 This seems to be something that distros generally will be interested
 in.

  configs/autoconf.in                    |    8 -
  configs/default                        |    3 ++
  configs/freebsd-dri                    |    4 ++-
  configs/linux-dri                      |    4 ++-
  configs/linux-dri-xcb                  |    4 ++-
  configs/linux-egl                      |    4 ++-
  configs/linux-indirect                 |    3 +-
  configure.ac                           |   32 +-
  src/glsl/Makefile                      |   20 ++-
  src/mesa/Makefile                      |   57 +++
  src/mesa/drivers/dri/Makefile.template |   12 +++
  src/mesa/drivers/osmesa/Makefile       |    2 +-
  src/mesa/x86/read_rgba_span_x86.S      |    8 
  13 files changed, 136 insertions(+), 25 deletions(-)

 diff --git a/configs/autoconf.in b/configs/autoconf.in
 index e2d70c6..37a137d 100644
 --- a/configs/autoconf.in
 +++ b/configs/autoconf.in
 @@ -33,6 +33,8 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
  LLVM_LIBS = @LLVM_LIBS@
  GLW_CFLAGS = @GLW_CFLAGS@
  GLUT_CFLAGS = @GLUT_CFLAGS@
 +DRI_CFLAGS = @DRI_CFLAGS@
 +DRI_CXXFLAGS = @DRI_CXXFLAGS@

  TALLOC_LIBS = @TALLOC_LIBS@
  TALLOC_CFLAGS = @TALLOC_CFLAGS@
 @@ -103,7 +105,10 @@ GALLIUM_AUXILIARIES = 
 $(TOP)/src/gallium/auxiliary/libgallium.a
  GALLIUM_DRIVERS = $(foreach 
 DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)

  # Driver specific build vars
 -DRI_DIRS = @DRI_DIRS@
 +DRI_DIRS = @DRI_DIRS@
 +DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
 +DRICORE_LIBS = @DRICORE_LIBS@
 +DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
  EGL_PLATFORMS = @EGL_PLATFORMS@
  EGL_CLIENT_APIS = @EGL_CLIENT_APIS@

 @@ -131,6 +136,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
  VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@

  # DRI dependencies
 +MESA_MODULES = @MESA_MODULES@
  DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
  LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
  LIBDRM_LIB = @LIBDRM_LIBS@
 diff --git a/configs/default b/configs/default
 index 0301345..1feeb97 100644
 --- a/configs/default
 +++ b/configs/default
 @@ -85,6 +85,9 @@ VG_LIB_GLOB = $(VG_LIB_NAME)*
  TALLOC_LIBS = `pkg-config --libs talloc`
  TALLOC_CFLAGS = `pkg-config --cflags talloc`

 +DRI_CFLAGS = $(CFLAGS)
 +DRI_CXXFLAGS = $(CXXFLAGS)
 +
  # Optional assembly language optimization files for libGL
  MESA_ASM_SOURCES =

 diff --git a/configs/freebsd-dri b/configs/freebsd-dri
 index a4aa82e..23cf58a 100644
 --- a/configs/freebsd-dri
 +++ b/configs/freebsd-dri
 @@ -30,9 +30,11 @@ ASM_SOURCES =
  MESA_ASM_SOURCES =

  # Library/program dependencies
 +MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
 +
  LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
  LIBDRM_LIB = `pkg-config --libs libdrm`
 -DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
 +DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat 
 $(LIBDRM_LIB)
  GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
        -lm -pthread $(LIBDRM_LIB)

 diff --git a/configs/linux-dri b/configs/linux-dri
 index 64fc407..caf0406 100644
 --- a/configs/linux-dri
 +++ b/configs/linux-dri
 @@ -43,9 +43,11 @@ MESA_ASM_SOURCES =
  # Library/program dependencies
  EXTRA_LIB_PATH=-L/usr/X11R6/lib

 +MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
 +
  LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
  LIBDRM_LIB = $(shell pkg-config --libs libdrm)
 -DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc 
 $(LIBDRM_LIB)
 +DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
 -ltalloc $(LIBDRM_LIB)
  GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
                -lm -lpthread -ldl $(LIBDRM_LIB)

 diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb
 index 8092a04..7518080 100644
 --- a/configs/linux-dri-xcb
 +++ b/configs/linux-dri-xcb
 @@ -41,9 +41,11 @@ MESA_ASM_SOURCES =
  # Library/program dependencies
  EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)

 +MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
 +
  LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
  LIBDRM_LIB = $(shell pkg-config --libs libdrm)
 -DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
 +DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
 $(LIBDRM_LIB)
  GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 

[Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.

2010-12-20 Thread Christopher James Halse Rogers
This an adds --enable-shared-dricore option to configure.  When enabled,
DRI modules will link against a shared copy of the common mesa routines
rather than statically linking these.

This saves about 30MB on disc with a full complement of classic DRI
drivers.
---

Resending as it seems to have been ignored the first time.
We've applied this in Ubuntu as we are (as always) scrabbling for
CD space on the LiveCDs, but Fedora had a similar patch in the dim
distant past.

This seems to be something that distros generally will be interested
in.

 configs/autoconf.in|8 -
 configs/default|3 ++
 configs/freebsd-dri|4 ++-
 configs/linux-dri  |4 ++-
 configs/linux-dri-xcb  |4 ++-
 configs/linux-egl  |4 ++-
 configs/linux-indirect |3 +-
 configure.ac   |   32 +-
 src/glsl/Makefile  |   20 ++-
 src/mesa/Makefile  |   57 +++
 src/mesa/drivers/dri/Makefile.template |   12 +++
 src/mesa/drivers/osmesa/Makefile   |2 +-
 src/mesa/x86/read_rgba_span_x86.S  |8 
 13 files changed, 136 insertions(+), 25 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index e2d70c6..37a137d 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -33,6 +33,8 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
 LLVM_LIBS = @LLVM_LIBS@
 GLW_CFLAGS = @GLW_CFLAGS@
 GLUT_CFLAGS = @GLUT_CFLAGS@
+DRI_CFLAGS = @DRI_CFLAGS@
+DRI_CXXFLAGS = @DRI_CXXFLAGS@
 
 TALLOC_LIBS = @TALLOC_LIBS@
 TALLOC_CFLAGS = @TALLOC_CFLAGS@
@@ -103,7 +105,10 @@ GALLIUM_AUXILIARIES = 
$(TOP)/src/gallium/auxiliary/libgallium.a
 GALLIUM_DRIVERS = $(foreach 
DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
 
 # Driver specific build vars
-DRI_DIRS = @DRI_DIRS@ 
+DRI_DIRS = @DRI_DIRS@
+DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
+DRICORE_LIBS = @DRICORE_LIBS@
+DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
 EGL_PLATFORMS = @EGL_PLATFORMS@
 EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
 
@@ -131,6 +136,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
 VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
 
 # DRI dependencies
+MESA_MODULES = @MESA_MODULES@
 DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
 LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
 LIBDRM_LIB = @LIBDRM_LIBS@
diff --git a/configs/default b/configs/default
index 0301345..1feeb97 100644
--- a/configs/default
+++ b/configs/default
@@ -85,6 +85,9 @@ VG_LIB_GLOB = $(VG_LIB_NAME)*
 TALLOC_LIBS = `pkg-config --libs talloc`
 TALLOC_CFLAGS = `pkg-config --cflags talloc`
 
+DRI_CFLAGS = $(CFLAGS)
+DRI_CXXFLAGS = $(CXXFLAGS)
+
 # Optional assembly language optimization files for libGL
 MESA_ASM_SOURCES = 
 
diff --git a/configs/freebsd-dri b/configs/freebsd-dri
index a4aa82e..23cf58a 100644
--- a/configs/freebsd-dri
+++ b/configs/freebsd-dri
@@ -30,9 +30,11 @@ ASM_SOURCES =
 MESA_ASM_SOURCES = 
 
 # Library/program dependencies
+MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
+
 LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
 LIBDRM_LIB = `pkg-config --libs libdrm`
-DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
+DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat 
$(LIBDRM_LIB)
 GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
 
diff --git a/configs/linux-dri b/configs/linux-dri
index 64fc407..caf0406 100644
--- a/configs/linux-dri
+++ b/configs/linux-dri
@@ -43,9 +43,11 @@ MESA_ASM_SOURCES =
 # Library/program dependencies
 EXTRA_LIB_PATH=-L/usr/X11R6/lib
 
+MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
+
 LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
 LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc 
$(LIBDRM_LIB)
+DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
-ltalloc $(LIBDRM_LIB)
 GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
 
diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb
index 8092a04..7518080 100644
--- a/configs/linux-dri-xcb
+++ b/configs/linux-dri-xcb
@@ -41,9 +41,11 @@ MESA_ASM_SOURCES =
 # Library/program dependencies
 EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
 
+MESA_MODULES  = $(TOP)/src/mesa/libmesa.a
+
 LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
 LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
+DRI_LIB_DEPS  = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl 
$(LIBDRM_LIB)
 GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
 $(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell 
pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
 
diff --git a/configs/linux-egl