Index: trunk/src/VBox/Additions/common/crOpenGL/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/Makefile.kmk	(revision 18174)
+++ trunk/src/VBox/Additions/common/crOpenGL/Makefile.kmk	(revision 18175)
@@ -49,7 +49,5 @@
 if1of ($(KBUILD_TARGET),linux solaris)
  #VBoxOGL_DRI = 1
- ifneq ($(KBUILD_TARGET),solaris)       # temporary
-  VBoxOGL_FAKEDRI = 1
- endif
+ VBoxOGL_FAKEDRI = 1
  VBOX_PATH_MESA_SOURCE = $(VBOX_PATH_X11_ROOT)/mesa-7.2
 endif
@@ -108,19 +106,27 @@
 	glx.c \
 	xfont.c
+
  ifdef VBoxOGL_DRI
   VBoxOGL_SOURCES += \
  	$(VBOX_PATH_CROGL_GENFILES)/DD_gl.c \
- 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm \
  	dri_drv.c
+  VBoxOGL_SOURCES.linux += \
+ 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm
+  VBoxOGL_SOURCES.solaris += \
+ 	$(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm
  else ifdef VBoxOGL_FAKEDRI
   VBoxOGL_SOURCES += \
+ 	fakedri_drv.c
+  VBoxOGL_SOURCES.linux += \
  	$(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm \
- 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm \
- 	fakedri_drv.c
+ 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm
+  VBoxOGL_SOURCES.solaris += \
+ 	$(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm \
+ 	$(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm
  else
+  VBoxOGL_SOURCES.linux += \
+  	$(VBOX_PATH_CROGL_GENFILES)/linux_exports.asm
   VBoxOGL_SOURCES.solaris += \
-	$(VBOX_PATH_CROGL_GENFILES)/sunos_exports.c
- VBoxOGL_SOURCES.linux += \
- 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports.asm
+  	$(VBOX_PATH_CROGL_GENFILES)/solaris_exports.asm
  endif
 endif
@@ -136,8 +142,8 @@
 	$(VBOX_PATH_CROGL_GENFILES)/NULLfuncs.c \
 	$(VBOX_PATH_CROGL_GENFILES)/tsfuncs.c
-if1of ($(KBUILD_TARGET),linux solaris)
- VBoxOGL_CLEAN           += \
+VBoxOGL_CLEAN.linux        += \
 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports.asm
-endif
+VBoxOGL_CLEAN.solaris        += \
+	$(VBOX_PATH_CROGL_GENFILES)/solaris_exports.asm
 VBoxOGL_CLEAN.win      = \
 	$(VBOX_PATH_CROGL_GENFILES)/windows_exports.asm \
@@ -151,6 +157,9 @@
  else ifdef VBoxOGL_FAKEDRI
   VBoxOGL_CLEAN   += \
- 	$(VBOX_PATH_CROGL_GENFILES)/cr_gl.h \
+ 	$(VBOX_PATH_CROGL_GENFILES)/cr_gl.h
+  VBoxOGL_CLEAN.linux   += \
  	$(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm
+  VBoxOGL_CLEAN.solaris   += \
+ 	$(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm
  endif
 endif
@@ -194,6 +203,6 @@
 if !defined(VBoxOGL_DRI) && !defined(VBoxOGL_FAKEDRI)
  ifeq ($(KBUILD_TARGET),solaris)
-$(VBOX_PATH_CROGL_GENFILES)/sunos_exports.c: \
-		$(PATH_SUB_CURRENT)/SunOS_exports.py \
+$(VBOX_PATH_CROGL_GENFILES)/solaris_exports.asm: \
+		$(PATH_SUB_CURRENT)/SunOS_i386_exports.py \
 		$(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
 		| $$(dir $$@)
@@ -213,4 +222,11 @@
 $(VBOX_PATH_CROGL_GENFILES)/DD_gl.c: $(PATH_SUB_CURRENT)/DD_glc.py $(VBOX_CROGL_API_FILES) | $$(dir $$@)
 	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
+ ifeq ($(KBUILD_TARGET),solaris)
+$(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm: \
+		$(PATH_SUB_CURRENT)/SunOS_i386_exports_dri.py \
+		$(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
+		| $$(dir $$@)
+	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) 
+ else
 $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \
 		$(PATH_SUB_CURRENT)/Linux_i386_exports_dri.py \
@@ -218,7 +234,17 @@
 		| $$(dir $$@)
 	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
+ endif
 else ifdef VBoxOGL_FAKEDRI
 $(VBOX_PATH_CROGL_GENFILES)/cr_gl.h: $(PATH_SUB_CURRENT)/cr_gl.py $(VBOX_CROGL_API_FILES) | $$(dir $$@)
 	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
+ ifeq ($(KBUILD_TARGET),solaris)
+$(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm: \
+		$(PATH_SUB_CURRENT)/SunOS_i386_exports_dri.py \
+		$(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
+		| $$(dir $$@)
+	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
+$(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm: $(PATH_SUB_CURRENT)/SunOS_i386_glxapi_exports.py | $$(dir $$@)
+	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
+ else
 $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \
 		$(PATH_SUB_CURRENT)/Linux_i386_exports_dri.py \
@@ -228,4 +254,5 @@
 $(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm: $(PATH_SUB_CURRENT)/Linux_i386_glxapi_exports.py | $$(dir $$@)
 	$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
+ endif
 endif
 endif
Index: trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py	(revision 18175)
+++ trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py	(revision 18175)
@@ -0,0 +1,98 @@
+#
+# Copyright (C) 2009 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+# Clara, CA 95054 USA or visit http://www.sun.com if you need
+# additional information or have any questions.
+
+import sys
+
+import apiutil
+
+
+def GenerateEntrypoints():
+
+    #apiutil.CopyrightC()
+
+    # Get sorted list of dispatched functions.
+    # The order is very important - it must match cr_opcodes.h
+    # and spu_dispatch_table.h
+    print '%include "iprt/asmdefs.mac"'
+    print ""
+    print "%ifdef RT_ARCH_AMD64"
+    print "extern glim"
+    print "%else ; X86"
+    print "extern glim"
+    print "%endif"
+    print ""
+
+    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+    for index in range(len(keys)):
+        func_name = keys[index]
+        if apiutil.Category(func_name) == "Chromium":
+            continue
+
+        print "BEGINPROC_EXPORTED gl%s" % func_name
+        print "%ifdef RT_ARCH_AMD64"
+        print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
+        print "%else ; X86"
+        print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (4*index)
+        print "%endif"
+        print "ENDPROC gl%s" % func_name
+        print ""
+
+
+    print ';'
+    print '; Aliases'
+    print ';'
+
+    # Now loop over all the functions and take care of any aliases
+    allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
+    for func_name in allkeys:
+        if "omit" in apiutil.ChromiumProps(func_name):
+            continue
+
+        if func_name in keys:
+            # we already processed this function earlier
+            continue
+
+        # alias is the function we're aliasing
+        alias = apiutil.Alias(func_name)
+        if alias:
+            # this dict lookup should never fail (raise an exception)!
+            index = keys.index(alias)
+            print "BEGINPROC_EXPORTED gl%s" % func_name
+            print "%ifdef RT_ARCH_AMD64"
+            print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
+            print "%else ; X86"
+            print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (4*index)
+            print "%endif"
+            print "ENDPROC gl%s" % func_name
+            print ""
+
+
+    print ';'
+    print '; No-op stubs'
+    print ';'
+
+    # Now generate no-op stub functions
+    for func_name in allkeys:
+        if "stub" in apiutil.ChromiumProps(func_name):
+            print "BEGINPROC_EXPORTED gl%s" % func_name
+            print "\tleave"
+            print "\tret"
+            print "ENDPROC gl%s" % func_name
+            print ""
+
+
+GenerateEntrypoints()
+
Index: trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports_dri.py
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports_dri.py	(revision 18175)
+++ trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports_dri.py	(revision 18175)
@@ -0,0 +1,98 @@
+#
+# Copyright (C) 2009 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+# Clara, CA 95054 USA or visit http://www.sun.com if you need
+# additional information or have any questions.
+
+import sys
+
+import apiutil
+
+
+def GenerateEntrypoints():
+
+    #apiutil.CopyrightC()
+
+    # Get sorted list of dispatched functions.
+    # The order is very important - it must match cr_opcodes.h
+    # and spu_dispatch_table.h
+    print '%include "iprt/asmdefs.mac"'
+    print ""
+    print "%ifdef RT_ARCH_AMD64"
+    print "extern glim"
+    print "%else ; X86"
+    print "extern glim"
+    print "%endif"
+    print ""
+
+    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+    for index in range(len(keys)):
+        func_name = keys[index]
+        if apiutil.Category(func_name) == "Chromium":
+            continue
+
+        print "BEGINPROC_EXPORTED cr_gl%s" % func_name
+        print "%ifdef RT_ARCH_AMD64"
+        print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
+        print "%else ; X86"
+        print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (4*index)
+        print "%endif"
+        print "ENDPROC cr_gl%s" % func_name
+        print ""
+
+
+    print ';'
+    print '; Aliases'
+    print ';'
+
+    # Now loop over all the functions and take care of any aliases
+    allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
+    for func_name in allkeys:
+        if "omit" in apiutil.ChromiumProps(func_name):
+            continue
+
+        if func_name in keys:
+            # we already processed this function earlier
+            continue
+
+        # alias is the function we're aliasing
+        alias = apiutil.Alias(func_name)
+        if alias:
+            # this dict lookup should never fail (raise an exception)!
+            index = keys.index(alias)
+            print "BEGINPROC_EXPORTED cr_gl%s" % func_name
+            print "%ifdef RT_ARCH_AMD64"
+            print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
+            print "%else ; X86"
+            print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (4*index)
+            print "%endif"
+            print "ENDPROC cr_gl%s" % func_name
+            print ""
+
+
+    print ';'
+    print '; No-op stubs'
+    print ';'
+
+    # Now generate no-op stub functions
+    for func_name in allkeys:
+        if "stub" in apiutil.ChromiumProps(func_name):
+            print "BEGINPROC_EXPORTED cr_gl%s" % func_name
+            print "\tleave"
+            print "\tret"
+            print "ENDPROC cr_gl%s" % func_name
+            print ""
+
+
+GenerateEntrypoints()
+
Index: trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_glxapi_exports.py
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_glxapi_exports.py	(revision 18175)
+++ trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_glxapi_exports.py	(revision 18175)
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2009 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+# Clara, CA 95054 USA or visit http://www.sun.com if you need
+# additional information or have any questions.
+
+import sys
+
+#Note, this should match the fakedri_glxfuncsList.h order
+glx_functions = [
+"CopyContext",
+"UseXFont",
+#"GetDriverConfig",
+"GetProcAddress",
+"FreeMemoryMESA",
+"QueryExtension",
+"IsDirect",
+"DestroyGLXPbufferSGIX",
+"QueryGLXPbufferSGIX",
+"CreateGLXPixmap",
+"CreateGLXPixmapWithConfigSGIX",
+"QueryContext",
+"CreateContextWithConfigSGIX",
+"SwapBuffers",
+"CreateNewContext",
+"SelectEventSGIX",
+"QueryContextInfoEXT",
+"GetCurrentDrawable",
+"ChooseFBConfig",
+"WaitGL",
+"GetFBConfigs",
+"CreatePixmap",
+"GetSelectedEventSGIX",
+"GetCurrentReadDrawable",
+"ImportContextEXT",
+"GetContextIDEXT",
+"GetCurrentDisplay",
+"QueryServerString",
+"CreateWindow",
+"SelectEvent",
+"GetVisualFromFBConfigSGIX",
+"MakeCurrentReadSGI",
+"GetFBConfigFromVisualSGIX",
+"QueryDrawable",
+"CreateContext",
+"GetConfig",
+"CreateGLXPbufferSGIX",
+"AllocateMemoryMESA",
+"GetMemoryOffsetMESA",
+"CreatePbuffer",
+"ChooseFBConfigSGIX",
+"WaitX",
+"GetVisualFromFBConfig",
+"CreateGLXPixmapMESA",
+#"GetScreenDriver",
+"GetFBConfigAttrib",
+"GetCurrentContext",
+"GetClientString",
+"GetCurrentDisplayEXT",
+"DestroyPixmap",
+"MakeCurrent",
+"DestroyContext",
+"GetProcAddressARB",
+"GetSelectedEvent",
+"FreeContextEXT",
+"DestroyPbuffer",
+"DestroyWindow",
+"DestroyGLXPixmap",
+"QueryVersion",
+"ChooseVisual",
+"MakeContextCurrent",
+"QueryExtensionsString",
+"GetFBConfigAttribSGIX"
+];
+
+print '%include "iprt/asmdefs.mac"'
+print ""
+print "%ifdef RT_ARCH_AMD64"
+print "extern glxim"
+print "%else ; X86"
+print "extern glxim"
+print "%endif"
+print ""
+
+for index in range(len(glx_functions)):
+    func_name = glx_functions[index]
+
+    print "BEGINPROC_EXPORTED vbox_glX%s" % func_name
+    print "%ifdef RT_ARCH_AMD64"
+    print "\tjmp \t[glxim+%d wrt rip wrt ..gotpcrel]" % (8*index)
+    print "%else ; X86"
+    print "\tjmp \t[glxim+%d wrt rip wrt ..gotpcrel]" % (4*index)
+    print "%endif"
+    print "ENDPROC vbox_glX%s" % func_name
+    print ""
+
