Has anyone written an extconf.rb that depends on a Mac OS Fr

I once built a game with Ruby/SDL [1] called Tadpoles [2]. (SDL is a
powerful cross-platform Simple DirectMedia Library that’s ideal for
making fast graphics as in 2-D games). That was back in my Linux
days. When I moved back to Windows (temporarily) I found that Ruby/
SDL was far too difficult to install for me. So I learned about RUDL
[3] and found that it was much easier to install for Windows and
actually featured some pretty nice Rubyesqueness.

With the rest of the geek world, I’ve since made the switch to Mac OS
X (yeah, I know some of you are still holding back). Now, I’d like
to be able to write SDL-based apps for the Mac, but neither library
seems ideal.

So, I’m attempting to make RUDL work on the Mac–but I need some help
understanding how to make Ruby’s extconf.rb / mkmf stuff work in
conjunction with the Mac “Framework” style of distributing
libraries. Specifically, I’ve compiled SDL.framework which resides
in /Library/Frameworks and need to the linker to know about that
folder. Unfortunately, when I run extconf.rb, it seems that the
linker expects to find the libraries in the usual Unix style and in
the usual Unix locations, using the “-lsdl” linker flag.

So, has anyone built an extconf.rb file that depends on a Mac OS
Framework that I might investigate? If not, how can I get extconf.rb
to compile files like this, according to the SDL’s Mac OS README:

“gcc -I/Library/Frameworks/SDL.framework/Headers MyProgram.c
SDLmain.m -framework SDL -framework Cocoa”

Thanks,
Duane J.
(canadaduane)

[1] http://raa.ruby-lang.org/project/ruby-sdl/
[2] http://tadpoles.rubyforge.org/
[3] http://www.rubygarden.org/ruby?RuDL

Hi,

At Tue, 15 Nov 2005 15:31:45 +0900,
Duane J. wrote in [ruby-talk:165831]:

So, has anyone built an extconf.rb file that depends on a Mac OS
Framework that I might investigate? If not, how can I get extconf.rb
to compile files like this, according to the SDL’s Mac OS README:

“gcc -I/Library/Frameworks/SDL.framework/Headers MyProgram.c
SDLmain.m -framework SDL -framework Cocoa”

See ext/tk/extconf.rb.

Thanks for your reply, Nobu Nakada.

The file you mention is only four lines long:

require 'mkmf'
$preload = ["tcltklib"]
($INSTALLFILES||=[]) << ["lib/tkextlib/SUPPORT_STATUS", "$

(RUBYLIBDIR)", “lib”]
create_makefile(“tkutil”)

I don’t see how it’s compiling using a Framework… ?

Duane J.

On Nov 15, 2005, at 8:59 AM, [email protected] wrote:

create_makefile(“tkutil”)

I don’t see how it’s compiling using a Framework… ?

It’s older ext/tkutil/extconf.rb.

http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/extconf.rb?
rev=1.12;content-type=text%2Fplain

AWESOME!! Thanks, Nobu Nakada. I’ll go digest this for a while on
my own :slight_smile:

Duane J.
(canadaduane)

Hi,

At Wed, 16 Nov 2005 00:21:34 +0900,
Duane J. wrote in [ruby-talk:165892]:

The file you mention is only four lines long:

require ‘mkmf’
$preload = [“tcltklib”]
($INSTALLFILES||=[]) << [“lib/tkextlib/SUPPORT_STATUS”, “$(RUBYLIBDIR)”, “lib”]
create_makefile(“tkutil”)

I don’t see how it’s compiling using a Framework… ?

It’s older ext/tkutil/extconf.rb.

http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/extconf.rb?rev=1.12;content-type=text%2Fplain