[from now] 2013/08/17 17:06:00

diff --git a/src/OMakefile b/src/OMakefile
index 89214e0..ffbcd67 100644
--- a/src/OMakefile
+++ b/src/OMakefile
@@ -43,7 +43,7 @@ if $(not $(OCAMLFIND_EXISTS))
 #
 # Include path
 #
-OCAMLINCLUDES += ../lib/baselib ../lib/vecmath
+OCAMLINCLUDES +=

 #
 # Compile native or byte code?
@@ -116,8 +116,8 @@ OCAMLFLAGS    += -annot -bin-annot -g
 		export
 	export

-INCLUDES += ../include
-CFLAGS += $(SDL_CONFIGURE) -std=c99 -fPIC
+INCLUDES += ../include $(shella $(OCAMLC) -config | grep standard_library: | cut -d' ' -f 2)
+CFLAGS += $(SDL_CONFIGURE) -std=c99 -fPIC -fnested-functions -framework OpenGL
 # %$(EXT_OBJ): %.c :scanner: scan-c-%.c
 # 	$(OCamlC) -ccopt "-std=c99 $(SDL_CONFIGURE) $(CFLAGS)" -o $@ -c $<

@@ -138,7 +138,7 @@ SUB_FILES = $(ls *.inc)
 LIBRARY_NAME = sdlcaml

 #
-# OCAML_LIBS += ../lib/extlib -custom
+# OCAML_LIBS += -custom
 # OCAML_CLIBS +=
 # OCAML_OTHER_LIBS += camlidl
 # OCAML_LIB_FLAGS += -cclib -lsdlcaml
diff --git a/src/enums/OMakefile b/src/enums/OMakefile
index 0475c27..7e1938d 100644
--- a/src/enums/OMakefile
+++ b/src/enums/OMakefile
@@ -92,7 +92,7 @@ enums.ml ../enums.ml: $(PROGRAM) enum_list.xml
 	cp ./enums.ml ../

 #
-# OCAML_LIBS += ../lib/extlib -custom
+# OCAML_LIBS += -custom
 # OCAML_CLIBS +=
 # OCAML_OTHER_LIBS += camlidl
 # OCAML_LIB_FLAGS += -cclib -lsdlcaml
diff --git a/src/gl.afx.h b/src/gl.afx.h
index 6852c4c..eb8829c 100644
--- a/src/gl.afx.h
+++ b/src/gl.afx.h
@@ -2,13 +2,19 @@
 #define __GL_AFX_H__

 #if defined(__APPLE__) && !defined(VMDMESA)
+#if defined(GL3_ENABLE)
+#include <OpenGL/gl3.h>
+#else
 #include <OpenGL/gl.h>
+#endif  /* deifned(GL3_ENABLE) */
 #else
 #include <GL/gl.h>
-#endif
+#include <GL/glext.h>
+#include <GL/glx.h>
+#include <GL/glxext.h>
+#endif /* if defined(__APPLE__) && !defined(VDMESA) */
 #if defined(GL3_ENABLE)
-// #define GLCOREARB_PROTOTYPES
 #include "glcorearb.h"
-#endif
+#endif  // defined(GL3_ENABLE)

 #endif
diff --git a/src/gl_vbo_enable.inc b/src/gl_vbo_enable.inc
index 04f7655..a562dfb 100644
--- a/src/gl_vbo_enable.inc
+++ b/src/gl_vbo_enable.inc
@@ -14,7 +14,7 @@
     else func##_is_loaded = 1; \
   }
 #else  /* for MacOS X */
-#if defined(__APPLE__) && !defined(VMDMESA)
+#if !defined(__APPLE__) && defined(VMDMESA)
 #include <mach-o/dyld.h>
 #include <string.h>

@@ -36,16 +36,12 @@ void * MyNSGLGetProcAddress (const char* name) {
   static proto func = NULL; \
   static unsigned int func##_is_loaded = 0; \
   if (!func##_is_loaded) { \
-    func = (proto) NSIsSymbolNameDefined(#func); \
+    func = (proto) MyNSGLGetProcAddress(#func); \
     if (func == NULL) { caml_failwith("Unable to load " #func);} \
     else func##_is_loaded = 1; \
   }
 #else /* for *nix. */

-#include <GL/glext.h>
-#include <GL/glx.h>
-#include <GL/glxext.h>
-
 /* If using nVidia, do not this need? */
 #define CHECK_FUNC(func, proto) \
   static proto func = NULL; \
Fix to use OpenGL 3.0.