--- /dev/null 2006-03-19 15:11:53.646034648 +0200 +++ configs/linux-softgl 2006-03-17 06:45:53.000000000 +0200 @@ -0,0 +1,45 @@ +# Configuration for linux Xorg softgl module -*- makefile -*- + +include $(TOP)/configs/default + +CONFIG_NAME = linux-softgl + +# Compiler and flags +CC = gcc +CXX = g++ + +OPT_FLAGS = -O3 -g +PIC_FLAGS = -fPIC + +# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. + +ARCH_FLAGS ?= + +# Normally the DEFINES would come from dix-config.h (-DHAVE_DIX_CONFIG_H): + +# #define _POSIX_SOURCE 1 +# #define _BSD_SOURCE 1 +# #define _XOPEN_SOURCE 500 +# # +# #define NO_LIBCWRAPPER 1 + +# XGL also uses: +# -DXGLServer /* not really necessary ... */ +# -DUSE_MGL_NAMESPACE +# -D_XSERVER64 /* linux-softgl-x86-64 */ + +LINUX_SOURCE = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ + -D_BSD_SOURCE -D_GNU_SOURCE + +DEFINES = $(LINUX_SOURCE) \ + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER + +CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \ + $(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math + +CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + + +SRC_DIRS = mesa +DRIVER_DIRS = x11 +PROGRAM_DIRS = --- /dev/null 2006-03-19 15:11:53.646034648 +0200 +++ configs/linux-softgl-x86 2006-03-17 03:33:22.000000000 +0200 @@ -0,0 +1,16 @@ +# + +include $(TOP)/configs/linux-softgl + +CONFIG_NAME = linux-softgl-x86 + +# Unnecessary on x86, generally. +PIC_FLAGS = + +# Add -m32 to CFLAGS: +ARCH_FLAGS = -m32 + +ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM +ASM_SOURCES = $(X86_SOURCES) +ASM_API = $(X86_API) + --- /dev/null 2006-03-19 15:11:53.646034648 +0200 +++ src/mesa/drivers/x11/Makefile 2006-03-18 19:47:51.000000000 +0200 @@ -0,0 +1,81 @@ +# src/mesa/drivers/softgl/Makefile + +TOP = ../../../.. +include $(TOP)/configs/current + +SOFTGL = softgl.so + +MESA_MODULES = $(TOP)/src/mesa/libmesa.a + +SOFTGL_SOURCES = \ + ../common/driverfuncs.c \ + ../dri/common/utils.c \ + xm_api.c \ + xm_buffer.c \ + xm_dd.c \ + xm_line.c \ + xm_span.c \ + xm_tri.c \ + xorg_glx_util.c \ + xorg_glx.c + +SOFTGL_OBJECTS = $(SOFTGL_SOURCES:.c=.o) + +### Include directories +XORG_CFLAGS = $(shell pkg-config --cflags xorg-server) +DRM_CFLAGS = $(shell pkg-config --cflags libdrm) + +INCLUDES = \ + -I$(TOP)/src/mesa/drivers/dri/common \ + $(DRM_CFLAGS) \ + -I$(TOP)/include \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/shader + +DEFINES += $(XORG_CFLAGS) -DNO_LIBCWRAPPER + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ + +##### TARGETS ##### + +default: depend $(SOFTGL) $(LIB_DIR)/$(SOFTGL) + + +$(SOFTGL): $(SOFTGL_OBJECTS) $(MESA_MODULES) Makefile + $(TOP)/bin/mklib -noprefix -o $@ \ + $(SOFTGL_OBJECTS) $(MESA_MODULES) + + +$(LIB_DIR)/$(SOFTGL): $(SOFTGL) + install $(SOFTGL) $(LIB_DIR) + + +.PHONY: depend +depend: $(SOFTGL_SOURCES) + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(SOFTGL_SOURCES) \ + > /dev/null + +clean: + -rm -rf *.o *.so + -rm -f depend depend.bak + +XORG_MODULEDIR = $(shell pkg-config --variable=moduledir xorg-server) + +install: + @if test -d $(XORG_MODULEDIR); then \ + echo "Installing Xorg softgl module."; \ + else \ + echo "*** Failed to determine Xorgs module directory."; \ + echo "*** Installation aborted."; \ + exit 1; \ + fi; + test -d $(XORG_MODULEDIR) || mkdir $(XORG_MODULEDIR) + install -m 755 $(SOFTGL) $(XORG_MODULEDIR) + +include depend --- /dev/null 2006-03-19 15:11:53.646034648 +0200 +++ src/mesa/drivers/x11/xorg_glx.c 2006-03-18 05:20:42.000000000 +0200 @@ -0,0 +1,21 @@ + +#define _NEED_GLCORE_IF +#include +#include "xmesaP.h" +#include + +__GLcoreModule glcore = { + .XMesaCreateVisual = XMesaCreateVisual, + .XMesaDestroyVisual = XMesaDestroyVisual, + .XMesaCreateContext = XMesaCreateContext, + .XMesaDestroyContext = XMesaDestroyContext, + .XMesaCopyContext = XMesaCopyContext, + .XMesaForceCurrent = XMesaForceCurrent, + .XMesaLoseCurrent = XMesaLoseCurrent, + .XMesaCreateWindowBuffer = XMesaCreateWindowBuffer, + .XMesaCreatePixmapBuffer = XMesaCreatePixmapBuffer, + .XMesaDestroyBuffer = XMesaDestroyBuffer, + .XMesaMakeCurrent2 = XMesaMakeCurrent2, + .XMesaSwapBuffers = XMesaSwapBuffers, + .XMesaResizeBuffers = XMesaResizeBuffers +};