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

D

Duane Johnson

--Apple-Mail-1--889723477
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

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 Johnson
(canadaduane)

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

nobuyoshi nakada

Hi,

At Tue, 15 Nov 2005 15:31:45 +0900,
Duane Johnson 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.
 
D

Duane Johnson

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 Johnson

Hi,

At Tue, 15 Nov 2005 15:31:45 +0900,
Duane Johnson 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.
 
N

nobu.nokada

D

Duane Johnson

Hi,

At Wed, 16 Nov 2005 00:21:34 +0900,
Duane Johnson 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

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

Duane Johnson
(canadaduane)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top