diff -ru opengl-0.32g-orig/extconf.rb opengl-0.32g/extconf.rb
--- opengl-0.32g-orig/extconf.rb	2005-10-16 23:21:26.000000000 -0700
+++ opengl-0.32g/extconf.rb	2005-10-16 23:22:05.000000000 -0700
@@ -99,7 +99,10 @@
 install: #{modules}
 #{"\t@$(MAKE) -f Makefile.ogl install" if (ogl_flg)}
 #{"\t@$(MAKE) -f Makefile.glut install" if (glut_flg)}
-
+	mkdir -p ${prefix}/share/doc/opengl-rb18/sample
+	rm sample/aaindex.rb sample/aapoly.rb
+	cp sample/*.rb ${prefix}/share/doc/opengl-rb18/sample
+	
 site-install: #{modules}
 #{"\t@$(MAKE) -f Makefile.ogl site-install" if (ogl_flg)}
 #{"\t@$(MAKE) -f Makefile.glut site-install" if (glut_flg)}
Only in opengl-0.32g: extconf.rb.orig
diff -ru opengl-0.32g-orig/sample/accanti.rb opengl-0.32g/sample/accanti.rb
--- opengl-0.32g-orig/sample/accanti.rb	2005-10-16 23:21:26.000000000 -0700
+++ opengl-0.32g/sample/accanti.rb	2005-10-16 23:21:43.000000000 -0700
@@ -42,6 +42,7 @@
 require "opengl"
 require "glut"
 $LOAD_PATH.push(File.dirname($0))  # Find jitter in script directory
+require "jitter"
 
 #/*  Initialize lighting and other values.
 # */
diff -ru opengl-0.32g-orig/sample/accpersp.rb opengl-0.32g/sample/accpersp.rb
--- opengl-0.32g-orig/sample/accpersp.rb	2005-10-16 23:21:26.000000000 -0700
+++ opengl-0.32g/sample/accpersp.rb	2005-10-16 23:23:21.000000000 -0700
@@ -44,6 +44,7 @@
 require "glut"
 
 $LOAD_PATH.push(File.dirname($0))  # Find jitter in script directory
+require "jitter"
 
 PI_=3.14159265358979323846
 
diff -ur opengl-0.32g/extconf.rb opengl-0.32g.new/extconf.rb
--- opengl-0.32g/extconf.rb	2005-08-26 18:04:19.000000000 +0200
+++ opengl-0.32g.new/extconf.rb	2007-04-26 14:17:07.000000000 +0200
@@ -5,9 +5,9 @@
 
 require "mkmf"
 
-gl_libname = ""
-glu_libname = ""
-glut_libname = ""
+gl_libname = nil
+glu_libname = nil
+glut_libname = nil
 
 modules = ""
 ogl_flg = false
@@ -33,6 +33,12 @@
   glut_libname = "glut32"
 else
   $CPPFLAGS += " -I."
+  if (File.exist? "/System/Library/Frameworks/OpenGL.framework/OpenGL") #looks Applish
+    #FIXME sometimes it is desirable to compile for X11 even on Apple
+    $INCFLAGS = "-FOpenGL -FGLUT " + $INCFLAGS
+    $LDFLAGS = "-framework OpenGL -framework GLUT " + $LDFLAGS 
+    $CPPFLAGS += " -DAPPLE"
+  else
 
   idir, ldir = dir_config("x11", "/usr/X11R6")
 
@@ -43,9 +49,13 @@
   gl_libname = "GL"
   glu_libname = "GLU"
   glut_libname = "glut"
+  end
 end
+
+if gl_libname
 dir_config("opengl", idir, ldir)
 dir_config("glut", idir, ldir)
+end
 
 def have_ogl_library(lib, func = 'main')
   have_library(lib, func) || have_library("Mesa"+lib, func)
@@ -53,7 +63,7 @@
 
 $objs = ["glu.o", "ogl.o", "rbogl.o"]
 #have_library("pthread", "pthread_create")
-if have_ogl_library(gl_libname) && have_ogl_library(glu_libname)
+if !gl_libname || have_ogl_library(gl_libname) && have_ogl_library(glu_libname)
     create_makefile("opengl")
     File.rename("Makefile", "Makefile.ogl")
     modules = modules + "opengl.#{CONFIG['DLEXT']}" 
@@ -64,7 +74,7 @@
 end
 
 $objs = ["glut.o"]
-if have_library(glut_libname)
+if !gl_libname || have_library(glut_libname) 
     create_makefile("glut")
     File.rename("Makefile", "Makefile.glut")
     modules = "glut.#{CONFIG['DLEXT']} " + modules
diff -ur opengl-0.32g/glu.c opengl-0.32g.new/glu.c
--- opengl-0.32g/glu.c	2005-08-26 18:04:19.000000000 +0200
+++ opengl-0.32g.new/glu.c	2007-04-26 14:27:55.000000000 +0200
@@ -5,8 +5,13 @@
 #if defined(WIN32)
 # include "windows.h"
 #endif
-#include "GL/gl.h"
-#include "GL/glu.h"
+#if defined (APPLE)
+# include "OpenGL/gl.h"
+# include "OpenGL/glu.h"
+#else
+# include "GL/gl.h"
+# include "GL/glu.h"
+#endif
 #include "rbogl.h"
 
 #ifdef WIN32
diff -ur opengl-0.32g/glut.c opengl-0.32g.new/glut.c
--- opengl-0.32g/glut.c	2005-08-26 18:04:19.000000000 +0200
+++ opengl-0.32g.new/glut.c	2007-04-26 14:23:53.000000000 +0200
@@ -5,7 +5,11 @@
 #if defined(WIN32)
 # include "windows.h"
 #endif
-#include "GL/glut.h"
+#if defined(APPLE)
+# include "GLUT/glut.h"
+#else
+# include "GL/glut.h"
+#endif
 #include "ruby.h"
 
 static int callId; /* 'call' method id */
diff -ur opengl-0.32g/ogl.c opengl-0.32g.new/ogl.c
--- opengl-0.32g/ogl.c	2005-08-26 18:04:19.000000000 +0200
+++ opengl-0.32g.new/ogl.c	2007-04-26 14:26:23.000000000 +0200
@@ -5,7 +5,11 @@
 #if defined (WIN32)
 # include "windows.h"
 #endif
-#include "GL/gl.h"
+#if defined (APPLE)
+# include "OpenGL/gl.h"
+#else
+# include "GL/gl.h"
+#endif
 #include "rbogl.h"
 
 #if defined __CYGWIN__
diff -ur opengl-0.32g/rbogl.c opengl-0.32g.new/rbogl.c
--- opengl-0.32g/rbogl.c	2005-08-26 18:04:19.000000000 +0200
+++ opengl-0.32g.new/rbogl.c	2007-04-26 14:29:01.000000000 +0200
@@ -5,8 +5,12 @@
 #if defined (WIN32)
 # include "windows.h"
 #endif
+#if defined (APPLE)
+# include "OpenGL/gl.h"
+#else
+# include "GL/gl.h"
+#endif
 #include "rbogl.h"
-#include "GL/gl.h"
 
 #ifdef _NO_NUM2DBL_
 extern double
