On Thu, Jan 21, 2010 at 9:53 PM, Dan Nicholson <dbn.li...@gmail.com> wrote:
> On Thu, Jan 21, 2010 at 2:29 AM, Chia-I Wu <olva...@gmail.com> wrote:
>> This is one of the changes I want to do for a while.  GLX was built specially
>> and before Mesa core because libglapi.a could not be built with IN_DRI_DRIVER
>> defined.  This is no longer the case for a while.
>
> Interesting. I never knew that was the reason why. Two comments:
>
> 1. You changed CORE_DIRS to SRC_DIRS in configure.ac. What effect does
> that have? I think you need to keep it CORE_DIRS to make sure it
> builds before glew.
GLX doesn't seem to depend on GLW, does it?

CORE_DIRS is added by the opengl-es-v2 branch.  It is never exported and its
value will be prepended to SRC_DIRS.  Its value, for example, may be something
like "glsl mesa mesa/es".  The purpose is to insert "mesa/es" to SRC_DIRS at a
position after "glsl" and before "gallium" when OpenGL ES is enabled.
> 2. The glapi.a target in glx/x11/Makefile will normally not be used,
> but it should use $(MAKE) instead of make. And it should suppress the
> command with @.
I've updated the patch to use @$(MAKE) and -C.  Please have a look.
> I haven't tested it, but it looks solid otherwise.
From e3f322d24aa0bd1ef2d2aa5bf076e679b0d0336c Mon Sep 17 00:00:00 2001
From: Chia-I Wu <olva...@gmail.com>
Date: Thu, 21 Jan 2010 17:58:28 +0800
Subject: [PATCH] glx: Build GLX normally.

GLX was built specially and before Mesa core because libglapi.a could
not be built with IN_DRI_DRIVER defined.  This is no longer the case
since 6e99e6ddbf488f6955e34ef0bc438fdcb4d90f74.
---
 configure.ac         |    2 +-
 src/glx/x11/Makefile |   21 +++++++++------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 619ed47..91ccc08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -445,7 +445,7 @@ xlib)
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
     ;;
 dri)
-    CORE_DIRS="glx/x11 $CORE_DIRS"
+    SRC_DIRS="$SRC_DIRS glx/x11"
     DRIVER_DIRS="dri"
     WINDOW_SYSTEM="dri"
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile
index 86d84d4..e681be8 100644
--- a/src/glx/x11/Makefile
+++ b/src/glx/x11/Makefile
@@ -1,7 +1,7 @@
 TOP = ../../..
 include $(TOP)/configs/current
 
-EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER \
+EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT \
                 -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"
 
 SOURCES = \
@@ -39,13 +39,9 @@ SOURCES = \
 	  dri2_glx.c \
 	  dri2.c
 
-include $(TOP)/src/mesa/sources.mak
+GLAPI_LIB = $(TOP)/src/mesa/libglapi.a
 
-MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES))
-MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES))
-MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS))
-
-OBJECTS = $(SOURCES:.c=.o) $(MESA_GLAPI_OBJECTS)
+OBJECTS = $(SOURCES:.c=.o)
 
 INCLUDES = -I. \
 	-I$(TOP)/include \
@@ -70,18 +66,19 @@ INCLUDES = -I. \
 default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 
 # Make libGL
-$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME):  $(OBJECTS) Makefile
+$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(GLAPI_LIB) Makefile
 	$(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
 		-major 1 -minor 2 $(MKLIB_OPTIONS) \
 		-install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
-		$(GL_LIB_DEPS) $(OBJECTS)
+		$(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB)
 
+$(GLAPI_LIB):
+	@$(MAKE) -C $(TOP)/src/mesa libglapi.a
 
-depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile
+depend: $(SOURCES) Makefile
 	rm -f depend
 	touch depend
-	$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \
-		$(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) 
+	$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES)
 
 
 # Emacs tags
-- 
1.6.5

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to