Patch cherry-picked from my dri-sdk-7.8 branch against current head 
(edb5253dfa). An earlier full build through of all drivers (except 
nouveau, i will play with its expansive libdrm dependencies later) 
showed it to be an exact match still.

This patch, while not harming or hampering anything or anyone, gives us 
the ability to maintain and build DRI drivers out of tree for those so 
inclined. Build system additions only. No adverse effects. Everybody 
wins.

I intend to provide changes as needed, I hope to at least manage to 
maintain released versions in the long term.

For those wanting a test run, please check out the 7.8 version of the 
SDK and the drivers in my cgit.freedesktop.org repos.

Luc Verhaegen.
>From f78a2a3983152b6656220bcdc67165e70468c054 Mon Sep 17 00:00:00 2001
From: Luc Verhaegen <l...@skynet.be>
Date: Tue, 16 Mar 2010 21:44:23 +0100
Subject: [PATCH] Provide dri shared library building and SDK installation.

Signed-off-by: Luc Verhaegen <l...@skynet.be>
---
 Makefile                                           |   13 +++
 src/mesa/Makefile                                  |   61 +++++++++++-
 src/mesa/drivers/dri/common/Makefile               |   80 +++++++++++++++
 src/mesa/drivers/dri/common/libmesadricommon.pc.in |    9 ++
 src/mesa/drivers/dri/swrast/Makefile               |   10 ++
 src/mesa/libmesadri.pc.in                          |    9 ++
 src/mesa/sources.mak                               |  103 ++++++++++++++++++++
 7 files changed, 283 insertions(+), 2 deletions(-)
 create mode 100644 src/mesa/drivers/dri/common/Makefile
 create mode 100644 src/mesa/drivers/dri/common/libmesadricommon.pc.in
 create mode 100644 src/mesa/libmesadri.pc.in

diff --git a/Makefile b/Makefile
index 411130b..5c20b77 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,19 @@ default: $(TOP)/configs/current
 all: default
 
 
+dri-sdk:
+	cd src/mesa/ && $(MAKE) dri-sdk
+
+dri-sdk-install:
+	cd src/mesa/ && $(MAKE) dri-sdk-install
+
+dri-swrast:
+	cd src/mesa/drivers/dri/swrast && $(MAKE) dri-swrast
+
+dri-swrast-install:
+	cd src/mesa/drivers/dri/swrast && $(MAKE) dri-swrast-install
+
+
 doxygen:
 	cd doxygen && $(MAKE)
 
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 8c0ebf8..9f5aec4 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -36,6 +36,17 @@ libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS)
 libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
 	@ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
 
+libmesadri.so.$(MESA_VERSION): asm_subdirs glsl_builtin $(MESA_OBJECTS)
+	$(MKLIB) -major $(MESA_MAJOR) -minor $(MESA_MINOR) \
+	-patch $(MESA_TINY) -o mesadri $(MESA_OBJECTS)
+
+libmesadri: libmesadri.so.$(MESA_VERSION)
+
+libmesadricommon:
+	(cd drivers/dri/common && $(MAKE)) || exit 1
+
+dri-sdk: libmesadri libmesadricommon
+
 # Make archive of gl* API dispatcher functions only
 libglapi.a: $(GLAPI_OBJECTS)
 	@ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
@@ -60,7 +71,17 @@ asm_subdirs:
 
 ######################################################################
 # GLSL built-in library
-glsl_builtin:
+
+../glsl/pp/libglslpp.a:
+	(cd ../glsl/pp/ && $(MAKE)) || exit 1 ;
+
+../glsl/cl/libglslcl.a:
+	(cd ../glsl/cl/ && $(MAKE)) || exit 1 ;
+
+../glsl/apps/compile: ../glsl/pp/libglslpp.a ../glsl/cl/libglslcl.a ../glsl/apps/compile.c
+	(cd ../glsl/apps/ && $(MAKE) compile) || exit 1 ;
+
+glsl_builtin: ../glsl/apps/compile
 	(cd shader/slang/library && $(MAKE)) || exit 1 ;
 
 
@@ -145,13 +166,49 @@ install-dri: default
 	cd drivers/dri && $(MAKE) install
 
 
+libmesadri_pcedit = sed \
+	-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+	-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
+	-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
+	-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
+
+libmesadri.pc: libmesadri.pc.in
+	$(libmesadri_pcedit) $< > $@
+
+install-libmesadricommon:
+	cd drivers/dri/common && $(MAKE) install
+
+$(DESTDIR)$(INSTALL_INC_DIR)/mesa/%: $(subst $(DESTDIR)$(INSTALL_INC_DIR)/mesa/,,$@)
+	$(INSTALL) -d $(dir $@)
+	$(INSTALL) -m 644 $(subst $(DESTDIR)$(INSTALL_INC_DIR)/mesa/,,$(dir $@))$(notdir $@) $(dir $@)
+
+install-libmesadri-headers: $(addprefix $(DESTDIR)$(INSTALL_INC_DIR)/mesa/,$(LIBMESADRI_HEADERS))
+	# since glproto's internal/glcore.h is vastly out of sync anyway.
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal
+	$(INSTALL) -m 644 $(TOP)/include/GL/internal/glcore.h $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal
+
+install-libmesadri: libmesadri.so libmesadri.pc install-libmesadri-headers
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+	$(MINSTALL) libmesadri.so.$(MESA_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(MINSTALL) libmesadri.so.$(MESA_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(MINSTALL) libmesadri.so $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) -m 644 libmesadri.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+
+dri-sdk-install: install-libmesadri install-libmesadricommon
 
 # Emacs tags
 tags:
 	etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
 
 
-clean:
+libmesadri-clean:
+	-rm -f libmesadri.so*
+	-rm -f libmesadri.pc
+	cd drivers/dri/common && $(MAKE) clean
+
+clean: libmesadri-clean
 	-rm -f */*.o
 	-rm -f */*/*.o
 	-rm -f depend depend.bak libmesa.a libglapi.a libmesagallium.a
diff --git a/src/mesa/drivers/dri/common/Makefile b/src/mesa/drivers/dri/common/Makefile
new file mode 100644
index 0000000..c4db042
--- /dev/null
+++ b/src/mesa/drivers/dri/common/Makefile
@@ -0,0 +1,80 @@
+TOP = ../../../../..
+include $(TOP)/configs/current
+
+DRIVER_DEFINES = -DIN_DRI_DRIVER
+
+COMMON_SOURCES = \
+	utils.c \
+	texmem.c \
+	vblank.c \
+	dri_util.c \
+	xmlconfig.c \
+	drirenderbuffer.c \
+	dri_metaops.c \
+	../../common/driverfuncs.c
+
+LIBMESADRICOMMON_HEADERS = \
+	drivers/common/driverfuncs.h \
+	drivers/common/meta.h \
+	drivers/dri/common/depthtmp.h \
+	drivers/dri/common/dri_metaops.h \
+	drivers/dri/common/drirenderbuffer.h \
+	drivers/dri/common/dri_util.h \
+	drivers/dri/common/mmio.h \
+	drivers/dri/common/spantmp2.h \
+	drivers/dri/common/spantmp_common.h \
+	drivers/dri/common/spantmp.h \
+	drivers/dri/common/stenciltmp.h \
+	drivers/dri/common/texmem.h \
+	drivers/dri/common/utils.h \
+	drivers/dri/common/vblank.h \
+	drivers/dri/common/xmlconfig.h \
+	drivers/dri/common/xmlpool.h \
+	drivers/dri/common/xmlpool/options.h
+
+COMMON_OBJECTS = $(COMMON_SOURCES:.c=.o)
+
+INCLUDES = \
+	-I. \
+	-I$(TOP)/include \
+	-I$(TOP)/src/mesa \
+	-I/usr/include/drm
+
+.c.o:
+	$(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+libmesadricommon.so: $(COMMON_OBJECTS)
+	$(MKLIB) -major $(MESA_MAJOR) -minor $(MESA_MINOR) \
+        -patch $(MESA_TINY) -o mesadricommon $(COMMON_OBJECTS)
+
+pcedit = sed \
+	-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+	-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
+	-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
+	-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
+	-e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_INSTALL_DIR),' \
+	-e 's,@DRI_PC_REQ_PRIV@,$(DRI_PC_REQ_PRIV),'
+
+libmesadricommon.pc: libmesadricommon.pc.in
+	$(pcedit) $< > $@
+
+default: libmesadricommon.so
+
+install: libmesadricommon.so libmesadricommon.pc install-libmesadricommon-headers
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+	$(MINSTALL) libmesadricommon.so.$(MESA_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(MINSTALL) libmesadricommon.so.$(MESA_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(MINSTALL) libmesadricommon.so $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) -m 644 libmesadricommon.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+
+$(DESTDIR)$(INSTALL_INC_DIR)/mesa/%: $(subst $(DESTDIR)$(INSTALL_INC_DIR)/mesa/drivers/,../../,$@)
+	$(INSTALL) -d $(dir $@)
+	$(INSTALL) -m 644 $(subst $(DESTDIR)$(INSTALL_INC_DIR)/mesa/drivers/,../../,$(dir $@))$(notdir $@) $(dir $@)
+
+install-libmesadricommon-headers: $(addprefix $(DESTDIR)$(INSTALL_INC_DIR)/mesa/,$(LIBMESADRICOMMON_HEADERS))
+
+clean:
+	-rm -f *.o
+	-rm -f libmesadricommon.so*
+	-rm -f libmesadricommon.pc
diff --git a/src/mesa/drivers/dri/common/libmesadricommon.pc.in b/src/mesa/drivers/dri/common/libmesadricommon.pc.in
new file mode 100644
index 0000000..3a752af
--- /dev/null
+++ b/src/mesa/drivers/dri/common/libmesadricommon.pc.in
@@ -0,0 +1,9 @@
+pref...@install_dir@
+libd...@install_lib_dir@
+included...@install_inc_dir@
+
+Name: libmesadricommon
+Description: Common dri driver infrastructure for Mesa/dri.
+Version: @VERSION@
+Libs: -L${libdir} -lmesadricommon -lexpat
+Cflags: -I${includedir}/mesa -I${includedir}/mesa/drivers/dri/common
diff --git a/src/mesa/drivers/dri/swrast/Makefile b/src/mesa/drivers/dri/swrast/Makefile
index d2cf6db..c6c400a 100644
--- a/src/mesa/drivers/dri/swrast/Makefile
+++ b/src/mesa/drivers/dri/swrast/Makefile
@@ -24,3 +24,13 @@ SWRAST_COMMON_SOURCES = \
 
 include ../Makefile.template
 
+
+dri-swrast: $(OBJECTS)
+	$(MKLIB) -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+		-o swrast_dri.so -noprefix $(OBJECTS) -lmesadri \
+		$(EXTRA_MODULES) $(DRI_LIB_DEPS)
+
+dri-swrast-install: dri-swrast
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/dri
+	$(MINSTALL) swrast_dri.so $(DESTDIR)$(INSTALL_LIB_DIR)/dri
diff --git a/src/mesa/libmesadri.pc.in b/src/mesa/libmesadri.pc.in
new file mode 100644
index 0000000..0cab4b2
--- /dev/null
+++ b/src/mesa/libmesadri.pc.in
@@ -0,0 +1,9 @@
+pref...@install_dir@
+libd...@install_lib_dir@
+included...@install_inc_dir@
+
+Name: libmesadri
+Description: Core library for Mesa/dri.
+Version: @VERSION@
+Libs: -L${libdir} -lmesadri -lpthread
+Cflags: -I${includedir}/mesa -DPTHREADS
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index f6d52b8..319d303 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -384,3 +384,106 @@ INCLUDE_DIRS = \
 	-I$(TOP)/src/mesa \
 	-I$(TOP)/src/gallium/include \
 	-I$(TOP)/src/gallium/auxiliary
+
+LIBMESADRI_HEADERS = \
+	glapi/glapidispatch.h \
+	glapi/glapi.h \
+	glapi/glapioffsets.h \
+	glapi/glapitable.h \
+	glapi/glthread.h \
+	main/api_arrayelt.h \
+	main/api_noop.h \
+	main/attrib.h \
+	main/bitset.h \
+	main/blend.h \
+	main/bufferobj.h \
+	main/buffers.h \
+	main/clip.h \
+	main/colormac.h \
+	main/colortab.h \
+	main/compiler.h \
+	main/config.h \
+	main/context.h \
+	main/convolve.h \
+	main/dd.h \
+	main/depth.h \
+	main/dispatch.h \
+	main/enable.h \
+	main/enums.h \
+	main/extensions.h \
+	main/fbobject.h \
+	main/formats.h \
+	main/framebuffer.h \
+	main/glheader.h \
+	main/hash.h \
+	main/image.h \
+	main/imports.h \
+	main/light.h \
+	main/macros.h \
+	main/matrix.h \
+	main/mfeatures.h \
+	main/mipmap.h \
+	main/mm.h \
+	main/mtypes.h \
+	main/pixelstore.h \
+	main/points.h \
+	main/polygon.h \
+	main/remap.h \
+	main/remap_helper.h \
+	main/renderbuffer.h \
+	main/simple_list.h \
+	main/state.h \
+	main/texcompress.h \
+	main/texenv.h \
+	main/texformat.h \
+	main/texgetimage.h \
+	main/teximage.h \
+	main/texobj.h \
+	main/texparam.h \
+	main/texrender.h \
+	main/texstate.h \
+	main/texstore.h \
+	main/varray.h \
+	main/viewport.h \
+	math/m_matrix.h \
+	math/m_translate.h \
+	math/m_vector.h \
+	math/m_xform.h \
+	shader/arbprogram.h \
+	shader/atifragshader.h \
+	shader/prog_execute.h \
+	shader/prog_instruction.h \
+	shader/prog_optimize.h \
+	shader/prog_parameter.h \
+	shader/prog_print.h \
+	shader/program.h \
+	shader/programopt.h \
+	shader/prog_statevars.h \
+	shader/shader_api.h \
+	swrast/s_context.h \
+	swrast_setup/ss_context.h \
+	swrast_setup/swrast_setup.h \
+	swrast/s_fog.h \
+	swrast/s_span.h \
+	swrast/swrast.h \
+	tnl_dd/t_dd_dmatmp2.h \
+	tnl_dd/t_dd_dmatmp.h \
+	tnl_dd/t_dd_rendertmp.h \
+	tnl_dd/t_dd_triemit.h \
+	tnl_dd/t_dd_tritmp.h \
+	tnl_dd/t_dd_unfilled.h \
+	tnl_dd/t_dd_vb.c \
+	tnl_dd/t_dd_vbtmp.h \
+	tnl_dd/t_dd_vertex.h \
+	tnl/t_context.h \
+	tnl/tnl.h \
+	tnl/t_pipeline.h \
+	tnl/t_vb_rendertmp.h \
+	tnl/t_vertex.h \
+	tnl/t_vp_build.h \
+	vbo/vbo_attrib.h \
+	vbo/vbo_context.h \
+	vbo/vbo_exec.h \
+	vbo/vbo.h \
+	vbo/vbo_save.h \
+	vbo/vbo_split.h
-- 
1.6.0.2

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to