[Mesa-dev] [PATCH 6/9] Link dri drivers with mesa or dricore libtool library

2012-07-10 Thread Jon TURNEY
Now mesa/drivers/dri is converted to automake, we want to update DRI_LIB_DEPS
so that we link with the libmesa or libdricore libtool library, as appropriate.

However, this is complicated by the fact that gallium/targets is not (yet)
converted, so we can't share the DRI_LIB_DEPS autoconf variable with that 
anymore.

Add an additional autoconf variable GALLIUM_DRI_LIB_DEPS, whic is now used in
gallium/targets/Makefile.dri, to link with the libdircore or libmesa native 
library.

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 configs/current.in   |1 +
 configure.ac |   11 ---
 src/gallium/targets/Makefile.dri |4 ++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/configs/current.in b/configs/current.in
index ca817c4..e0c0130 100644
--- a/configs/current.in
+++ b/configs/current.in
@@ -148,6 +148,7 @@ GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
 
 # DRI dependencies
 DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
+GALLIUM_DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @GALLIUM_DRI_LIB_DEPS@
 LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
 LIBDRM_LIB = @LIBDRM_LIBS@
 DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
diff --git a/configure.ac b/configure.ac
index ae28007..5724f8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1084,11 +1084,14 @@ GLAPI_LIB_DEPS=-lpthread $SELINUX_LIBS
 AC_SUBST([GLAPI_LIB_DEPS])
 
 
-dnl Setup default DRI CFLAGS
-DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
+dnl dri libraries are linking with mesa
+DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.la'
+GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
 
+dnl ... or dricore?
 if test x$enable_dri = xyes  test x$driglx_direct = xyes ; then
-DRI_LIB_DEPS=-L\$(TOP)/\$(LIB_DIR) -ldricore$VERSION
+DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$VERSION.la'
+GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$VERSION.a'
 HAVE_DRICORE=yes
 fi
 AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes)
@@ -1266,10 +1269,12 @@ if test x$enable_dri = xyes; then
 
 # put all the necessary libs together
 DRI_LIB_DEPS=$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm 
-lpthread $DLOPEN_LIBS
+GALLIUM_DRI_LIB_DEPS=$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS 
$EXPAT_LIB -lm -lpthread $DLOPEN_LIBS
 fi
 AC_SUBST([DRI_DIRS])
 AC_SUBST([EXPAT_INCLUDES])
 AC_SUBST([DRI_LIB_DEPS])
+AC_SUBST([GALLIUM_DRI_LIB_DEPS])
 
 case $DRI_DIRS in
 *i915*|*i965*)
diff --git a/src/gallium/targets/Makefile.dri b/src/gallium/targets/Makefile.dri
index 3abed82..5b6676d 100644
--- a/src/gallium/targets/Makefile.dri
+++ b/src/gallium/targets/Makefile.dri
@@ -73,8 +73,8 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) 
Makefile \
$(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
$(OBJECTS) $(PIPE_DRIVERS) \
 -Wl,--start-group $(MESA_MODULES) -Wl,--end-group \
- $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
-   $(CXX) $(CFLAGS) -o $@.test 
$(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) $(LDFLAGS);
+ $(GALLIUM_DRI_LIB_DEPS) $(DRIVER_EXTRAS)
+   $(CXX) $(CFLAGS) -o $@.test 
$(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(GALLIUM_DRI_LIB_DEPS) 
$(LDFLAGS);
@rm -f $@.test
mv -f $@.tmp $@
 
-- 
1.7.9

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


[Mesa-dev] [PATCH 6/9] Link dri drivers with mesa or dricore libtool library

2012-07-09 Thread Jon TURNEY
Now mesa/drivers/dri is converted to automake, we want to update DRI_LIB_DEPS
so that we link with the libmesa or libdricore libtool library, as appropriate.

However, this is complicated by the fact that gallium/targets is not (yet)
converted, so we can't share the DRI_LIB_DEPS autoconf variable with that 
anymore.

Add an additional autoconf variable GALLIUM_DRI_LIB_DEPS, whic is now used in
gallium/targets/Makefile.dri, to link with the libdircore or libmesa native 
library.
(we also need to link with the dependencies, which libtool follows for us when 
we link with the .la)

Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
---
 configs/current.in   |1 +
 configure.ac |   11 ---
 src/gallium/targets/Makefile.dri |4 ++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/configs/current.in b/configs/current.in
index ca817c4..e0c0130 100644
--- a/configs/current.in
+++ b/configs/current.in
@@ -148,6 +148,7 @@ GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
 
 # DRI dependencies
 DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
+GALLIUM_DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @GALLIUM_DRI_LIB_DEPS@
 LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
 LIBDRM_LIB = @LIBDRM_LIBS@
 DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
diff --git a/configure.ac b/configure.ac
index ae28007..216ec3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1084,11 +1084,14 @@ GLAPI_LIB_DEPS=-lpthread $SELINUX_LIBS
 AC_SUBST([GLAPI_LIB_DEPS])
 
 
-dnl Setup default DRI CFLAGS
-DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
+dnl dri libraries are linking with mesa
+DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.la'
+GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a $(TOP)/src/glsl/libglsl.a'
 
+dnl ... or dricore?
 if test x$enable_dri = xyes  test x$driglx_direct = xyes ; then
-DRI_LIB_DEPS=-L\$(TOP)/\$(LIB_DIR) -ldricore$VERSION
+DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$VERSION.la'
+GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$VERSION.a'
 HAVE_DRICORE=yes
 fi
 AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes)
@@ -1266,10 +1269,12 @@ if test x$enable_dri = xyes; then
 
 # put all the necessary libs together
 DRI_LIB_DEPS=$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm 
-lpthread $DLOPEN_LIBS
+GALLIUM_DRI_LIB_DEPS=$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS 
$EXPAT_LIB -lm -lpthread $DLOPEN_LIBS
 fi
 AC_SUBST([DRI_DIRS])
 AC_SUBST([EXPAT_INCLUDES])
 AC_SUBST([DRI_LIB_DEPS])
+AC_SUBST([GALLIUM_DRI_LIB_DEPS])
 
 case $DRI_DIRS in
 *i915*|*i965*)
diff --git a/src/gallium/targets/Makefile.dri b/src/gallium/targets/Makefile.dri
index 3abed82..5b6676d 100644
--- a/src/gallium/targets/Makefile.dri
+++ b/src/gallium/targets/Makefile.dri
@@ -73,8 +73,8 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) 
Makefile \
$(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
$(OBJECTS) $(PIPE_DRIVERS) \
 -Wl,--start-group $(MESA_MODULES) -Wl,--end-group \
- $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
-   $(CXX) $(CFLAGS) -o $@.test 
$(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS) $(LDFLAGS);
+ $(GALLIUM_DRI_LIB_DEPS) $(DRIVER_EXTRAS)
+   $(CXX) $(CFLAGS) -o $@.test 
$(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(GALLIUM_DRI_LIB_DEPS) 
$(LDFLAGS);
@rm -f $@.test
mv -f $@.tmp $@
 
-- 
1.7.9

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