From: Vincent Isambart Date: 2004-09-11T02:50:57+09:00 Subject: Re: OpenGL on MacOS X (again) Hi, The previous version of Ruby/OpenGL was not working with Ruby/GtkGLExt, only with GLUT. Here comes a better version of extconf.rb that will correct this problem. Forget the previous version - use this one ^o^ Vincent Isambart #-------extconf.rb require 'mkmf' File.unlink('Makefile') if File.exist?('Makefile') File.unlink('Makefile.ogl') if File.exist?('Makefile.ogl') File.unlink('Makefile.glut') if File.exist?('Makefile.glut') Dir.mkdir('GL') unless File.exist?('GL') File.symlink('/System/Library/Frameworks/OpenGL.framework/Headers/ gl.h', 'GL/gl.h') unless File.exist?('GL/gl.h') File.symlink('/System/Library/Frameworks/OpenGL.framework/Headers/ glu.h', 'GL/glu.h') unless File.exist?('GL/glu.h') File.symlink('/System/Library/Frameworks/GLUT.framework/Headers/ glut.h', 'GL/glut.h') unless File.exist?('GL/glut.h') $CFLAGS = '-I. -I/System/Library/Frameworks/OpenGL.framework/Headers -I/System/Library/Frameworks/GLUT.framework/Headers' $LDFLAGS = '-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL -lGLU' $objs = ['glu.o', 'ogl.o', 'rbogl.o'] create_makefile("opengl") File.rename('Makefile', 'Makefile.ogl') $LDFLAGS = '-L/System/Library/Frameworks/OpenGL.framework/Libraries -framework GLUT -framework Foundation' $objs = ['glut.o'] create_makefile("glut") File.rename('Makefile', 'Makefile.glut') modules = "glut.#{CONFIG['DLEXT']} opengl.#{CONFIG['DLEXT']}" open('Makefile', 'w') {|f| v = $nmake ? '{$(srcdir)}' : '' f.write <<"MAKEFILE" SHELL = /bin/sh srcdir = #{$srcdir} VPATH = $(srcdir) all: #{modules} opengl.#{CONFIG['DLEXT']}: #{v}rbogl.c #{v}ogl.c #{v}glu.c #{v}rbogl.h @echo Now Making opengl extend module @$(MAKE) -f Makefile.ogl glut.#{CONFIG['DLEXT']}: #{v}glut.c @echo Now Making glut extend module @$(MAKE) -f Makefile.glut clean: @$(MAKE) -f Makefile.ogl clean @$(MAKE) -f Makefile.glut clean distclean: @$(MAKE) -f Makefile.ogl distclean @$(MAKE) -f Makefile.glut distclean install: #{modules} @$(MAKE) -f Makefile.ogl install @$(MAKE) -f Makefile.glut install site-install: #{modules} @$(MAKE) -f Makefile.ogl site-install @$(MAKE) -f Makefile.glut site-install MAKEFILE }