From d90ebda40743b711d35d9473fd392b447039c745 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Tue, 16 Mar 2010 03:25:52 +0100 Subject: Provide dri shared library building and SDK installation. --- Makefile | 6 +- src/mesa/Makefile | 53 ++++++++++++- src/mesa/drivers/dri/common/Makefile | 88 ++++++++++++++++++++++ src/mesa/drivers/dri/common/libmesadricommon.pc.in | 9 +++ src/mesa/libmesadri.pc.in | 9 +++ src/mesa/sources | 82 ++++++++++++++++++++ 6 files changed, 245 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 f0134e2da1..5acc7d2925 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ TOP = . SUBDIRS = src progs - default: $(TOP)/configs/current @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ @@ -12,6 +11,11 @@ default: $(TOP)/configs/current fi \ done +dri-sdk: + cd src/mesa/ && $(MAKE) dri-sdk + +dri-sdk-install: + cd src/mesa/ && $(MAKE) dri-sdk-install doxygen: (cd doxygen ; make) ; \ diff --git a/src/mesa/Makefile b/src/mesa/Makefile index d0c19f52aa..9c455e1f60 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -10,6 +10,7 @@ GL_MAJOR = 1 GL_MINOR = 5 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) +MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) .SUFFIXES : .cpp @@ -57,6 +58,17 @@ libmesa.a: $(SOLO_OBJECTS) mimeset -f "$@" ; \ fi +libmesadri.so.$(MESA_VERSION): subdirs $(SOLO_OBJECTS) + $(TOP)/bin/mklib -major $(MESA_MAJOR) -minor $(MESA_MINOR) \ + -patch $(MESA_TINY) -o mesadri $(SOLO_OBJECTS) + +libmesadri: libmesadri.so.$(MESA_VERSION) + +libmesadricommon: + (cd drivers/dri/common && $(MAKE)) || exit 1 + +dri-sdk: libmesadri libmesadricommon + linux-solo: depend subdirs libmesa.a cd drivers/dri ; $(MAKE) @@ -162,6 +174,40 @@ subdirs: (cd x86-64 ; $(MAKE)) ; \ fi +INSTALL_INC_DIR = $(INSTALL_DIR)/include/ +INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR) + +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 + $(INSTALL) libmesadri.so.$(MESA_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) libmesadri.so.$(MESA_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) libmesadri.so $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 libmesadri.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig + +dri-sdk-install: install-libmesadri install-libmesadricommon install: default gl.pc $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL @@ -188,7 +234,12 @@ install: default gl.pc 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 diff --git a/src/mesa/drivers/dri/common/Makefile b/src/mesa/drivers/dri/common/Makefile new file mode 100644 index 0000000000..870c0d7aa9 --- /dev/null +++ b/src/mesa/drivers/dri/common/Makefile @@ -0,0 +1,88 @@ +TOP = ../../../../.. +include $(TOP)/configs/current + +MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) +INSTALL_INC_DIR = $(INSTALL_DIR)/include/ +INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR) + +DRIVER_DEFINES = -DIN_DRI_DRIVER + +COMMON_SOURCES = \ + utils.c \ + texmem.c \ + vblank.c \ + dri_util.c \ + xmlconfig.c \ + drirenderbuffer.c \ + ../../common/driverfuncs.c + +LIBMESADRICOMMON_HEADERS = \ + drivers/common/driverfuncs.h \ + drivers/dri/common/depthtmp.h \ + drivers/dri/common/drirenderbuffer.h \ + drivers/dri/common/dri_util.h \ + drivers/dri/common/extension_helper.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 \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/shader + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ + +libmesadricommon.so: $(COMMON_OBJECTS) + $(TOP)/bin/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 + $(INSTALL) libmesadricommon.so.$(MESA_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) libmesadricommon.so.$(MESA_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) 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)) + # dri_interface.h is not installed by any other package in 7.0 + $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal + $(INSTALL) -m 644 $(TOP)/include/GL/internal/dri_interface.h $(DESTDIR)$(INSTALL_INC_DIR)GL/internal + +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 0000000000..3a752af644 --- /dev/null +++ b/src/mesa/drivers/dri/common/libmesadricommon.pc.in @@ -0,0 +1,9 @@ +prefix=@INSTALL_DIR@ +libdir=@INSTALL_LIB_DIR@ +includedir=@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/libmesadri.pc.in b/src/mesa/libmesadri.pc.in new file mode 100644 index 0000000000..16acbf45d6 --- /dev/null +++ b/src/mesa/libmesadri.pc.in @@ -0,0 +1,9 @@ +prefix=@INSTALL_DIR@ +libdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: libmesadri +Description: Core library for Mesa/dri. +Version: @VERSION@ +Libs: -L${libdir} -lmesadri -lpthread +Cflags: -I${includedir}/mesa -DPTHREADS -I${includedir}/mesa/main -I${includedir}/mesa/glapi -I${includedir}/mesa/shader diff --git a/src/mesa/sources b/src/mesa/sources index dbfc01d0ed..46094e0ac9 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -340,3 +340,85 @@ INCLUDE_DIRS = \ -I$(TOP)/src/mesa/shader/slang \ -I$(TOP)/src/mesa/swrast \ -I$(TOP)/src/mesa/swrast_setup + +LIBMESADRI_HEADERS = \ + glapi/dispatch.h \ + glapi/glapi.h \ + glapi/glapitable.h \ + glapi/glthread.h \ + main/api_arrayelt.h \ + main/api_noop.h \ + main/api_validate.h \ + main/bitset.h \ + main/bufferobj.h \ + main/clip.h \ + main/colormac.h \ + main/colortab.h \ + main/config.h \ + main/context.h \ + main/convolve.h \ + main/dd.h \ + main/enums.h \ + main/extensions.h \ + main/fbobject.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/mipmap.h \ + main/mm.h \ + main/mtypes.h \ + main/points.h \ + main/renderbuffer.h \ + main/simple_list.h \ + main/state.h \ + main/texcompress.h \ + main/texformat.h \ + main/teximage.h \ + main/texobj.h \ + main/texstore.h \ + main/vtxfmt.h \ + math/m_matrix.h \ + math/m_translate.h \ + math/m_vector.h \ + math/m_xform.h \ + shader/arbprogparse.h \ + shader/atifragshader.h \ + shader/prog_execute.h \ + shader/prog_instruction.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 -- cgit v1.2.3