Mesa (master): glapi: Always build libglapi.a.

Brian Paul brianp at kemper.freedesktop.org
Fri Oct 23 15:10:48 UTC 2009


Module: Mesa
Branch: master
Commit: 6e99e6ddbf488f6955e34ef0bc438fdcb4d90f74
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e99e6ddbf488f6955e34ef0bc438fdcb4d90f74

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Fri Oct 16 16:04:06 2009 +0800

glapi: Always build libglapi.a.

This is made possible by making glapioffsets.h and glapidispatch.h
internal headers of glapi.  They should only be included indirectly
through dispatch.h by mesa.

Signed-off-by: Chia-I Wu <olvaffe at gmail.com>

---

 src/mesa/Makefile              |    6 +-----
 src/mesa/glapi/dispatch.h      |    5 +++++
 src/mesa/glapi/gl_offsets.py   |    7 +++++--
 src/mesa/glapi/gl_table.py     |    6 ++++--
 src/mesa/glapi/glapidispatch.h |    6 ++++--
 src/mesa/glapi/glapioffsets.h  |    6 ++++--
 src/mesa/glapi/remap_helper.py |    1 -
 src/mesa/main/api_arrayelt.c   |    1 -
 src/mesa/main/context.c        |    1 -
 src/mesa/main/dispatch.c       |    2 +-
 src/mesa/main/remap_helper.h   |    1 -
 src/mesa/main/vtxfmt_tmp.h     |    1 -
 12 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 8300b30..6f58ad6 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -39,11 +39,7 @@ libmesagallium.a: $(MESA_GALLIUM_OBJECTS)
 
 # Make archive of gl* API dispatcher functions only
 libglapi.a: $(GLAPI_OBJECTS)
-	@if [ "${WINDOW_SYSTEM}" = "dri" ] ; then \
-		touch libglapi.a ; \
-	else \
-		$(MKLIB) -o glapi -static $(GLAPI_OBJECTS) ; \
-	fi
+	$(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
 
 ######################################################################
 # Device drivers
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index dafcf3e..6623d52 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -26,7 +26,12 @@
 #ifndef _DISPATCH_H
 #define _DISPATCH_H
 
+#ifdef IN_DRI_DRIVER
+#define _GLAPI_USE_REMAP_TABLE
+#endif
+
 #include "glapitable.h"
+#include "glapioffsets.h"
 #include "glapidispatch.h"
 
 #endif /* _DISPATCH_H */
diff --git a/src/mesa/glapi/gl_offsets.py b/src/mesa/glapi/gl_offsets.py
index 59f8d37..ca6c90f 100644
--- a/src/mesa/glapi/gl_offsets.py
+++ b/src/mesa/glapi/gl_offsets.py
@@ -43,6 +43,9 @@ class PrintGlOffsets(gl_XML.gl_print_base):
 	def printBody(self, api):
 		abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
 
+		print '/* this file should not be included directly in mesa */'
+		print ''
+
 		functions = []
 		abi_functions = []
 		count = 0
@@ -60,7 +63,7 @@ class PrintGlOffsets(gl_XML.gl_print_base):
 			last_static = f.offset
 
 		print ''
-		print '#if !defined(IN_DRI_DRIVER)'
+		print '#if !defined(_GLAPI_USE_REMAP_TABLE)'
 		print ''
 
 		for [f, index] in functions:
@@ -76,7 +79,7 @@ class PrintGlOffsets(gl_XML.gl_print_base):
 			print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name)
 
 		print ''
-		print '#endif /* !defined(IN_DRI_DRIVER) */'
+		print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */'
 
 		return
 
diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py
index 6cf26f8..0e05b34 100644
--- a/src/mesa/glapi/gl_table.py
+++ b/src/mesa/glapi/gl_table.py
@@ -79,6 +79,8 @@ class PrintRemapTable(gl_XML.gl_print_base):
 
 	def printRealHeader(self):
 		print """
+/* this file should not be included directly in mesa */
+
 /**
  * \\file glapidispatch.h
  * Macros for handling GL dispatch tables.
@@ -132,7 +134,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
 
 
 		print ''
-		print '#if !defined(IN_DRI_DRIVER)'
+		print '#if !defined(_GLAPI_USE_REMAP_TABLE)'
 		print ''
 
 		for [f, index] in functions:
@@ -162,7 +164,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
 
 
 		print ''
-		print '#endif /* !defined(IN_DRI_DRIVER) */'
+		print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */'
 		return
 
 
diff --git a/src/mesa/glapi/glapidispatch.h b/src/mesa/glapi/glapidispatch.h
index 1d26dfb..d6ba928 100644
--- a/src/mesa/glapi/glapidispatch.h
+++ b/src/mesa/glapi/glapidispatch.h
@@ -29,6 +29,8 @@
 #  define _GLAPI_DISPATCH_H_
 
 
+/* this file should not be included directly in mesa */
+
 /**
  * \file glapidispatch.h
  * Macros for handling GL dispatch tables.
@@ -1281,7 +1283,7 @@
 #define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB)
 #define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn)
 
-#if !defined(IN_DRI_DRIVER)
+#if !defined(_GLAPI_USE_REMAP_TABLE)
 
 #define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters
 #define GET_AttachShader(disp) ((disp)->AttachShader)
@@ -4000,6 +4002,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 #define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index])
 #define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn)
 
-#endif /* !defined(IN_DRI_DRIVER) */
+#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */
 
 #endif /* !defined( _GLAPI_DISPATCH_H_ ) */
diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h
index a380774..3d10260 100644
--- a/src/mesa/glapi/glapioffsets.h
+++ b/src/mesa/glapi/glapioffsets.h
@@ -29,6 +29,8 @@
 #if !defined( _GLAPI_OFFSETS_H_ )
 #  define _GLAPI_OFFSETS_H_
 
+/* this file should not be included directly in mesa */
+
 #define _gloffset_NewList 0
 #define _gloffset_EndList 1
 #define _gloffset_CallList 2
@@ -438,7 +440,7 @@
 #define _gloffset_MultiTexCoord4sARB 406
 #define _gloffset_MultiTexCoord4svARB 407
 
-#if !defined(IN_DRI_DRIVER)
+#if !defined(_GLAPI_USE_REMAP_TABLE)
 
 #define _gloffset_AttachShader 408
 #define _gloffset_CreateProgram 409
@@ -1219,6 +1221,6 @@
 #define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]
 #define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]
 
-#endif /* !defined(IN_DRI_DRIVER) */
+#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */
 
 #endif /* !defined( _GLAPI_OFFSETS_H_ ) */
diff --git a/src/mesa/glapi/remap_helper.py b/src/mesa/glapi/remap_helper.py
index 7e68a90..e47583a 100644
--- a/src/mesa/glapi/remap_helper.py
+++ b/src/mesa/glapi/remap_helper.py
@@ -65,7 +65,6 @@ class PrintGlRemap(gl_XML.gl_print_base):
 
 	def printRealHeader(self):
 		print '#include "glapi/dispatch.h"'
-		print '#include "glapi/glapioffsets.h"'
 		print ''
 		return
 
diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index a058227..469b452 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -32,7 +32,6 @@
 #include "context.h"
 #include "imports.h"
 #include "macros.h"
-#include "glapi/glapioffsets.h"
 #include "glapi/dispatch.h"
 
 typedef void (GLAPIENTRY *array_func)( const void * );
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ea820d7..c57d7c1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -133,7 +133,6 @@
 #include "viewport.h"
 #include "vtxfmt.h"
 #include "glapi/glthread.h"
-#include "glapi/glapioffsets.h"
 #include "glapi/glapitable.h"
 #include "shader/program.h"
 #include "shader/prog_print.h"
diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c
index bf1a013..97d213e 100644
--- a/src/mesa/main/dispatch.c
+++ b/src/mesa/main/dispatch.c
@@ -43,6 +43,7 @@
 #include "main/compiler.h"
 #include "glapi/glapi.h"
 #include "glapi/glapitable.h"
+#include "glapi/glapidispatch.h"
 #include "glapi/glthread.h"
 
 
@@ -88,7 +89,6 @@
 #define GLAPIENTRY
 #endif
 
-#include "glapi/dispatch.h"
 #include "glapi/glapitemp.h"
 
 #endif /* USE_X86_ASM */
diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h
index 89192d3..3886f41 100644
--- a/src/mesa/main/remap_helper.h
+++ b/src/mesa/main/remap_helper.h
@@ -26,7 +26,6 @@
  */
 
 #include "glapi/dispatch.h"
-#include "glapi/glapioffsets.h"
 
 struct gl_function_remap {
    GLint func_index;
diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h
index d56a2bb..ae636fb 100644
--- a/src/mesa/main/vtxfmt_tmp.h
+++ b/src/mesa/main/vtxfmt_tmp.h
@@ -30,7 +30,6 @@
 #endif
 
 #include "glapi/dispatch.h"
-#include "glapi/glapioffsets.h"
 
 static void GLAPIENTRY TAG(ArrayElement)( GLint i )
 {




More information about the mesa-commit mailing list