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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
duane.johnson (Guest)
on 2005-11-15 08:33
(Received via mailing list)
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
nobuyoshi.nakada (Guest)
on 2005-11-15 11:52
(Received via mailing list)
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.
duane.johnson (Guest)
on 2005-11-15 17:24
(Received via mailing list)
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.
nobu.nokada (Guest)
on 2005-11-15 18:00
(Received via mailing list)
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/e...
duane.johnson (Guest)
on 2005-11-15 18:09
(Received via mailing list)
On Nov 15, 2005, at 8:59 AM, removed_email_address@domain.invalid 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/e...?
> rev=1.12;content-type=text%2Fplain
>

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

Duane J.
(canadaduane)
This topic is locked and can not be replied to.