[Mesa-dev] [PATCH Resend] mesa: Optionally build a dricore support library.
Christopher James Halse Rogers
christopher.halse.rogers at canonical.com
Thu Dec 23 20:57:14 PST 2010
On Tue, 2010-12-21 at 06:30 -0800, Dan Nicholson wrote:
> On Mon, Dec 20, 2010 at 8:34 PM, Christopher James Halse Rogers
> <christopher.halse.rogers at 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 -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 b/configs/linux-egl
> > index 6393e94..216bcba 100644
> > --- a/configs/linux-egl
> > +++ b/configs/linux-egl
> > @@ -38,9 +38,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 $(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 -lXdamage -lXfixes \
> > -lm -lpthread -ldl \
> > $(LIBDRM_LIB)
> > diff --git a/configs/linux-indirect b/configs/linux-indirect
> > index 272d34e..507382a 100644
> > --- a/configs/linux-indirect
> > +++ b/configs/linux-indirect
> > @@ -42,7 +42,8 @@ MESA_ASM_SOURCES =
> > # Library/program dependencies
> > EXTRA_LIB_PATH=-L/usr/X11R6/lib
> >
> > -DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
> > +MESA_MODULES = $(TOP)/src/mesa/libmesa.a
> > +DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
> > GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
> >
> >
> > diff --git a/configure.ac b/configure.ac
> > index bd81775..028c548 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -796,6 +796,34 @@ AC_SUBST([GLESv2_LIB_DEPS])
> > AC_SUBST([GLESv2_PC_LIB_PRIV])
> >
> >
> > +AC_ARG_ENABLE([shared-dricore],
> > + [AS_HELP_STRING([--enable-shared-dricore],
> > + [link DRI modules with shared core DRI routines @<:@default=disabled@:>@])],
> > + [enable_dricore="$enableval"],
> > + [enable_dricore=no])
> > +if test "$mesa_driver" = dri ; then
> > + if test "$enable_dricore" = yes ; then
> > + DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
> > + DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
> > + DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
> > + DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
> > + DRI_CFLAGS='$(filter-out -fvisibility=hidden,$(CFLAGS)) -DUSE_DRICORE'
> > + DRI_CXXFLAGS='$(filter-out -fvisibility=hidden,$(CXXFLAGS)) -DUSE_DRICORE'
>
> This is a little hacky.
>
> 1. -Wl,-R isn't portable, and unfortunately bin/mklib doesn't handle
> rpath on its own. This would work for gcc, though.
Urgh. I'm not terribly interested in the !gcc case :). Would failing
with an error here for non-gcc compilers be acceptable?
>
> 2. I hope there's a better way to handle this than just filtering out
> -fvisibility=hidden.
I could re-jig the way CFLAGS are built up. I did it this way in an
attempt at a minimal diff, but now I think of it it's probably not that
hard to do in a nicer way.
>
> > + MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
> > + else
> > + DRI_CFLAGS='$(CFLAGS)'
> > + DRI_CXXFLAGS='$(CXXFLAGS)'
> > + DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
> > + MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
> > + fi
> > +fi
> > +AC_SUBST([DRICORE_LIBS])
> > +AC_SUBST([DRICORE_GLSL_LIBS])
> > +AC_SUBST([DRICORE_LIB_DEPS])
> > +AC_SUBST([DRI_CXXFLAGS])
> > +AC_SUBST([DRI_CFLAGS])
> > +AC_SUBST([MESA_MODULES])
> > +
> > AC_SUBST([HAVE_XF86VIDMODE])
> >
> > PKG_CHECK_MODULES([LIBDRM_RADEON],
> > @@ -963,8 +991,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
> > [AC_MSG_ERROR([Expat required for DRI.])])
> > fi
> >
> > - # put all the necessary libs together
> > - DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS $TALLOC_LIBS"
> > + # put all the necessary libs together, including possibly libdricore
> > + DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS $TALLOC_LIBS"
> > fi
> > AC_SUBST([DRI_DIRS])
> > AC_SUBST([EXPAT_INCLUDES])
> > diff --git a/src/glsl/Makefile b/src/glsl/Makefile
> > index 86a577e..f7162ff 100644
> > --- a/src/glsl/Makefile
> > +++ b/src/glsl/Makefile
> > @@ -112,6 +112,9 @@ OBJECTS = \
> > $(C_SOURCES:.c=.o) \
> > $(CXX_SOURCES:.cpp=.o)
> >
> > +DRICORE_OBJ_DIR = obj-visible
> > +OBJECTS_DRICORE = $(addprefix $(DRICORE_OBJ_DIR)/,$(OBJECTS))
> > +
> > INCLUDES = \
> > $(TALLOC_CFLAGS) \
> > -I. \
> > @@ -128,7 +131,14 @@ ALL_SOURCES = \
> >
> > ##### TARGETS #####
> >
> > -default: depend lib$(LIBNAME).a $(APPS)
> > +default: depend lib$(LIBNAME).a $(APPS) $(DRICORE_GLSL_LIBS)
> > +
> > +libglsl.so : $(OBJECTS_DRICORE) Makefile
> > + $(MKLIB) -cplusplus -noprefix -o $@ $(OBJECTS_DRICORE)
> > +
> > +$(TOP)/$(LIB_DIR)/libglsl.so: libglsl.so
> > + $(INSTALL) -d $(TOP)/$(LIB_DIR)
> > + $(INSTALL) -m 755 libglsl.so $(TOP)/$(LIB_DIR)
>
> This also turns glsl into a shared library? However, it doesn't seem
> that your not installing libglsl.so. Did this actually work?
>
It gets installed in src/mesa/Makefile, in the dricore install target.
In hindhsight, it would probably be more obvious to install it in
src/glsl/Makefile.
> >
> > lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template
> > $(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS)
> > @@ -162,6 +172,14 @@ glcpp/glcpp: $(GLCPP_OBJECTS) libglsl.a
> > .c.o:
> > $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
> >
> > +$(DRICORE_OBJ_DIR)/%.o : %.cpp
> > + @mkdir -p $(dir $@)
> > + $(CXX) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DEFINES) $< -o $@
> > +
> > +$(DRICORE_OBJ_DIR)/%.o : %.c
> > + @mkdir -p $(dir $@)
> > + $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DEFINES) $< -o $@
> > +
> > glsl_lexer.cpp: glsl_lexer.lpp
> > flex --nounistd -o$@ $<
> >
> > diff --git a/src/mesa/Makefile b/src/mesa/Makefile
> > index 8b0756b..0f33304 100644
> > --- a/src/mesa/Makefile
> > +++ b/src/mesa/Makefile
> > @@ -15,6 +15,7 @@ endif
> > MESA_OBJ_DIR := .
> > ES1_OBJ_DIR := objs-es1
> > ES2_OBJ_DIR := objs-es2
> > +DRICORE_OBJ_DIR := objs-dricore
> >
> >
> > include sources.mak
> > @@ -23,6 +24,7 @@ include sources.mak
> > ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_OBJECTS))
> > ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_OBJECTS))
> > MESA_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_OBJECTS))
> > +DRICORE_OBJECTS := $(addprefix $(DRICORE_OBJ_DIR)/, $(MESA_OBJECTS))
> >
> > ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
> > ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
> > @@ -32,6 +34,7 @@ MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
> > MESA_CPPFLAGS := $(API_DEFINES) $(DEFINES)
> > ES1_CPPFLAGS := -DFEATURE_ES1=1 $(DEFINES)
> > ES2_CPPFLAGS := -DFEATURE_ES2=1 $(DEFINES)
> > +DRICORE_CPPFLAGS = $(MESA_CPPFLAGS)
> >
> > # append include dirs
> > MESA_CPPFLAGS += $(INCLUDE_DIRS) $(TALLOC_CFLAGS)
> > @@ -43,18 +46,24 @@ CFLAGS := $(filter-out $(DEFINES), $(CFLAGS))
> > CXXFLAGS := $(filter-out $(DEFINES), $(CXXFLAGS))
> >
> > # LLVM is needed for the state tracker
> > -MESA_CFLAGS := $(LLVM_CFLAGS)
> > -ES1_CFLAGS := $(LLVM_CFLAGS)
> > -ES2_CFLAGS := $(LLVM_CFLAGS)
> > +MESA_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS)
> > +ES1_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS)
> > +ES2_CFLAGS := $(LLVM_CFLAGS) $(CFLAGS)
> > +DRICORE_CFLAGS := $(LLVM_CFLAGS) $(DRI_CFLAGS)
> > +
> > +MESA_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS)
> > +ES1_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS)
> > +ES2_CXXFLAGS := $(LLVM_CFLAGS) $(CXXFLAGS)
> > +DRICORE_CXXFLAGS := $(LLVM_CFLAGS) $(DRI_CXXFLAGS)
> >
> > define mesa-cc-c
> > @mkdir -p $(dir $@)
> > - $(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS) $(CFLAGS)
> > + $(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS)
> > endef
> >
> > define mesa-cxx-c
> > @mkdir -p $(dir $@)
> > - $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS) $(CXXFLAGS)
> > + $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_CFLAGS)
> > endef
> >
> > $(MESA_OBJ_DIR)/%.o: %.c
> > @@ -84,11 +93,20 @@ $(ES2_OBJ_DIR)/%.o: %.cpp
> > $(ES2_OBJ_DIR)/%.o: %.S
> > $(call mesa-cc-c,ES2)
> >
> > +$(DRICORE_OBJ_DIR)/%.o: %.c
> > + $(call mesa-cc-c,DRICORE)
> > +
> > +$(DRICORE_OBJ_DIR)/%.o: %.cpp
> > + $(call mesa-cxx-c,DRICORE)
> > +
> > +$(DRICORE_OBJ_DIR)/%.o: %.S
> > + $(call mesa-cc-c,DRICORE)
> > +
> >
> > # Default: build dependencies, then asm_subdirs, GLSL built-in lib,
> > # then convenience libs (.a) and finally the device drivers:
> > default: $(DEPENDS) asm_subdirs \
> > - $(MESA_LIBS) $(ES1_LIBS) $(ES2_LIBS) driver_subdirs
> > + $(MESA_LIBS) $(ES1_LIBS) $(ES2_LIBS) $(DRICORE_LIBS) driver_subdirs
> >
> > main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
> > $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
> > @@ -109,6 +127,15 @@ libes1.a: $(ES1_OBJECTS) $(GLSL_LIBS)
> > libes2.a: $(ES2_OBJECTS) $(GLSL_LIBS)
> > @$(MKLIB) -o es2 -static $(ES2_OBJECTS) $(GLSL_LIBS)
> >
> > +# Shared dricore library for classic DRI drivers
> > +libdricore.so: $(DRICORE_OBJECTS) $(DRICORE_GLSL_LIBS)
> > + @$(MKLIB) -o libdricore.so -noprefix -cplusplus \
> > + $(DRICORE_LIB_DEPS) $(DRICORE_OBJECTS)
>
> When creating shared libraries, you have to pass some more options to
> mklib so that it works appropriately on all platforms. See
> src/glx/Makefile for example. Also, -noprefix is for when you don't
> want a "lib" prefix on the library.
>
-noprefix also removes all the versioning information, and as these are
private libraries we don't want them to have an unversioned SONAME.
> > +
> > +$(TOP)/$(LIB_DIR)/libdricore.so: libdricore.so
> > + @$(INSTALL) -d $(TOP)/$(LIB_DIR)
> > + @$(INSTALL) -m 755 libdricore.so $(TOP)/$(LIB_DIR)
> > +
> > # Make archive of subset of core mesa object files for gallium
> > libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
> > @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
> > @@ -165,9 +192,12 @@ depend.es2: $(ALL_SOURCES)
> > new_install:
> > (cd drivers && $(MAKE) install)
> >
> > +ifneq (,$(DRICORE_LIBS))
> > +DRICORE_INSTALL_TARGET = install-dricore
> > +endif
> >
> > # XXX replace this with new_install above someday
> > -install: default
> > +install: default $(DRICORE_INSTALL_TARGET)
> > @for driver in $(DRIVER_DIRS) ; do \
> > case "$$driver" in \
> > osmesa) if [ "$(DRIVER_DIRS)" = osmesa ]; then \
> > @@ -229,6 +259,12 @@ install-dri: default
> > cd drivers/dri && $(MAKE) install
> >
> >
> > +install-dricore: default
> > + $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
> > + $(INSTALL) -m 755 $(DRICORE_LIBS) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
> > + $(INSTALL) -m 755 $(DRICORE_GLSL_LIBS) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR$)
>
> Typo on the last line. $(DRI_DRIVER_INSTALL_DIR$). Clearly running
> installed was not tested. :)
>
Oh, snap. I missed this because we don't actually use the install
target for the Ubuntu packages. Running installed was tested, just not
in an applicable way :).
> > +
> > +
> >
> > # Emacs tags
> > tags:
> > @@ -244,7 +280,12 @@ clean-es2:
> > -rm -rf $(ES2_OBJ_DIR)
> > -rm -f depend.es2 depend.es2.bak
> >
> > -clean: clean-es1 clean-es2
> > +clean-dricore:
> > + -rm -f libdricore.so
> > + -rm -f $(DRICORE_LIBS)
> > + -rm -rf $(DRICORE_OBJ_DIR)
> > +
> > +clean: clean-es1 clean-es2 clean-dricore
> > -rm -f */*.o
> > -rm -f */*/*.o
> > -rm -f depend depend.bak libmesa.a libmesagallium.a
> > diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template
> > index 4ecddbc..6ba4431 100644
> > --- a/src/mesa/drivers/dri/Makefile.template
> > +++ b/src/mesa/drivers/dri/Makefile.template
> > @@ -1,7 +1,5 @@
> > # -*-makefile-*-
> >
> > -MESA_MODULES = $(TOP)/src/mesa/libmesa.a
> > -
> > COMMON_GALLIUM_SOURCES = \
> > ../common/utils.c \
> > ../common/vblank.c \
> > @@ -39,13 +37,13 @@ CXXFLAGS += $(API_DEFINES)
> > ##### RULES #####
> >
> > .c.o:
> > - $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
> > + $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@
> >
> > .cpp.o:
> > - $(CC) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
> > + $(CC) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
> >
> > .S.o:
> > - $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
> > + $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DRIVER_DEFINES) $< -o $@
> >
> >
> > ##### TARGETS #####
> > @@ -57,10 +55,10 @@ default: subdirs lib
> > lib: symlinks subdirs depend
> > @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
> >
> > -$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) Makefile \
> > +$(LIBNAME): $(OBJECTS) $(EXTRA_MODULES) $(MESA_MODULES) Makefile \
This diff is a result of me removing MESA_MODULES, then re-adding it to
fix parallel builds. I'll re-order the dependencies to match the order
in HEAD.
> > $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o
> > $(MKLIB) -o $@.tmp -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
> > - $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
> > + $(OBJECTS) $(EXTRA_MODULES) $(DRI_LIB_DEPS)
>
> Is this related?
It is; MESA_MODULES is required in the dependencies, but DRI_LIB_DEPS
contain the required commands to link to MESA_MODULES.
I'll add a comment to that effect.
>
> > $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS)
> > @rm -f $@.test
> > mv -f $@.tmp $@
> > diff --git a/src/mesa/drivers/osmesa/Makefile b/src/mesa/drivers/osmesa/Makefile
> > index 50dd452..d65128c 100644
> > --- a/src/mesa/drivers/osmesa/Makefile
> > +++ b/src/mesa/drivers/osmesa/Makefile
> > @@ -40,7 +40,7 @@ $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) $(CORE_MESA)
> > -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
> > -install $(TOP)/$(LIB_DIR) -cplusplus $(MKLIB_OPTIONS) \
> > -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \
> > - $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) $(TALLOC_LIBS)
> > + $(OSMESA_LIB_DEPS) $(TALLOC_LIBS) $(OBJECTS) $(CORE_MESA)
>
> What about this?
This is indeed unrelated. Whoops.
>
> >
> >
> >
> > diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S
> > index 3886a51..90d7cc3 100644
> > --- a/src/mesa/x86/read_rgba_span_x86.S
> > +++ b/src/mesa/x86/read_rgba_span_x86.S
> > @@ -77,7 +77,9 @@
> > */
> >
> > .globl _generic_read_RGBA_span_BGRA8888_REV_MMX
> > +#ifndef USE_DRICORE
> > .hidden _generic_read_RGBA_span_BGRA8888_REV_MMX
> > +#endif
> > .type _generic_read_RGBA_span_BGRA8888_REV_MMX, @function
> > _generic_read_RGBA_span_BGRA8888_REV_MMX:
> > pushl %ebx
> > @@ -172,7 +174,9 @@ _generic_read_RGBA_span_BGRA8888_REV_MMX:
> > */
> >
> > .globl _generic_read_RGBA_span_BGRA8888_REV_SSE
> > +#ifndef USE_DRICORE
> > .hidden _generic_read_RGBA_span_BGRA8888_REV_SSE
> > +#endif
> > .type _generic_read_RGBA_span_BGRA8888_REV_SSE, @function
> > _generic_read_RGBA_span_BGRA8888_REV_SSE:
> > pushl %esi
> > @@ -335,7 +339,9 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE:
> >
> > .text
> > .globl _generic_read_RGBA_span_BGRA8888_REV_SSE2
> > +#ifndef USE_DRICORE
> > .hidden _generic_read_RGBA_span_BGRA8888_REV_SSE2
> > +#endif
> > .type _generic_read_RGBA_span_BGRA8888_REV_SSE2, @function
> > _generic_read_RGBA_span_BGRA8888_REV_SSE2:
> > pushl %esi
> > @@ -494,7 +500,9 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2:
> >
> > .text
> > .globl _generic_read_RGBA_span_RGB565_MMX
> > +#ifndef USE_DRICORE
> > .hidden _generic_read_RGBA_span_RGB565_MMX
> > +#endif
> > .type _generic_read_RGBA_span_RGB565_MMX, @function
> >
> > _generic_read_RGBA_span_RGB565_MMX:
>
> This seems like it could be useful, but I think it needs some
> discussion about the details and the implication of dropping these
> libraries out there.
Agreed. I'll refrain from major updates to the patch until there's
consensus on the direction to take it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20101224/199cc71e/attachment-0001.pgp>
More information about the mesa-dev
mailing list