A
anne001
I got opengl to work in the opengl-0.32g folder using the 1.8.2 default
ruby.
Recently, I "removed" ruby 1.8.2 to avoid conflicts (mod-ruby did not
work with it...)
and now I get an error message and a reference to the /usr/lib/ruby
path in the gcc
in mkmf.log, instead of a reference to /private/opt/local/lib
mkmf.log
"gcc -o conftest -I/Users/anne/Desktop/opengl-0.32g
-I/usr/lib/ruby/1.8/univers\
al-darwin8.0 -arch i386 -arch ppc -g -Os -pipe -fno-common -arch i386
-arch pp\
c -pipe -pipe -fno-common -I.
-I/System/Library/Frameworks/OpenGL.framework/Hea\
ders -I/System/Library/Frameworks/GLUT.framework/Headers conftest.c
-L"/usr/li\
b" -lruby-static -llibGL -lpthread -ldl -lobjc -lruby"
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lruby-static
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lruby-static
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccfx7L7n.out (No such file or
directory)
how do I find what line in extconf.rb creates this gcc line, and change
it?
#---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')
$CFLAGS = '-I. -I/System/Library/Frameworks/OpenGL.framework/Headers
-I/System/Library/Frameworks/GLUT.framework/Headers'
$LDFLAGS = '-L/System/Library/Frameworks/OpenGL.framework/Libraries
-framework GLUT -framework Foundation'
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')
$objs = ['glu.o', 'ogl.o', 'rbogl.o']
create_makefile("opengl")
File.rename('Makefile', 'Makefile.ogl')
$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
}
ruby.
Recently, I "removed" ruby 1.8.2 to avoid conflicts (mod-ruby did not
work with it...)
and now I get an error message and a reference to the /usr/lib/ruby
path in the gcc
in mkmf.log, instead of a reference to /private/opt/local/lib
mkmf.log
"gcc -o conftest -I/Users/anne/Desktop/opengl-0.32g
-I/usr/lib/ruby/1.8/univers\
al-darwin8.0 -arch i386 -arch ppc -g -Os -pipe -fno-common -arch i386
-arch pp\
c -pipe -pipe -fno-common -I.
-I/System/Library/Frameworks/OpenGL.framework/Hea\
ders -I/System/Library/Frameworks/GLUT.framework/Headers conftest.c
-L"/usr/li\
b" -lruby-static -llibGL -lpthread -ldl -lobjc -lruby"
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lruby-static
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lruby-static
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccfx7L7n.out (No such file or
directory)
how do I find what line in extconf.rb creates this gcc line, and change
it?
#---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')
$CFLAGS = '-I. -I/System/Library/Frameworks/OpenGL.framework/Headers
-I/System/Library/Frameworks/GLUT.framework/Headers'
$LDFLAGS = '-L/System/Library/Frameworks/OpenGL.framework/Libraries
-framework GLUT -framework Foundation'
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')
$objs = ['glu.o', 'ogl.o', 'rbogl.o']
create_makefile("opengl")
File.rename('Makefile', 'Makefile.ogl')
$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
}