ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11]
OBJ_DIR = "obj"
SO_DIR = "sfml"
DOC_DIR = "doc"
EXT_DIR = "ext"
INST_DIR = "/opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml" (found)
SFML_INC = "include" (found)
SFML_LIB = "lib" (found)
RUBY_INC = "/opt/local/include/ruby-1.9.1" (found)
RUBY_LIB = "/opt/local/lib" (found)
RUBY_LINK = "-lruby.1.9.1"
CXX = "/usr/bin/clang++"
CXXFLAGS = "-pipe -O2 -Iinclude -Iext -I/opt/local/include/ruby-1.9.1 -I/opt/local/include/ruby-1.9.1/x86_64-darwin11 -Wall -Wextra "
LINK = "/usr/bin/clang++ -dynamic -bundle"
LINK_FLAGS = "-Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -L. -L/opt/local/lib -arch x86_64 -L/usr/local/lib -Llib -L/opt/local/lib -lruby.1.9.1"
There are several options that I never used and some that look weird.
- Especially "-Wl,-undefined,dynamic_lookup" that tells the linker not to complain if there are undefined symbols, and look for them at runtime. This is weak linking, but I don't know why it's needed here.
- As for -multiply_defined, it's obsolete.
- -pipe is unknown to both Clang and ld. Only GCC knows it.
- And I don't know why -bundle is used. I'd rather expect -dynamiclib.
I changed the Rakefile with what you gave except some options (that do not exist with Apple's GCC) :
CXX = "g++"
CXXFLAGS = "-O3 -g -I#{SFML_INC} -I#{EXT_DIR} -I#{RUBY_INC} -I#{RUBY_INC}/#{CONFIG['arch']}"
LINK = "g++ -dynamiclib"
LINK_FLAGS = "-L. -L#{SFML_LIB} -L#{RUBY_LIB} #{RUBY_LINK}"
Which now gives
[ ceylo ceylo-pc ~/Desktop/rbSFML ] file /opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml/graphics.so
/opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml/graphics.so: Mach-O 64-bit dynamically linked shared library x86_64
instead of
[ ceylo ceylo-pc ~/Desktop/rbSFML ] file /opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml/system.so
/opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml/system.so: Mach-O 64-bit bundle x86_64
But I don't know a lot about Ruby or bundles so I don't know whether this change is useful.
Anyway, I still get the same error message when trying to launch Steel.