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

**URL:** <https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935>\
**Category:** Ruby\
**Created:** [November 15, 2005, 7:33am UTC](https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935 "2005-11-15T07:33:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![duane.johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ccd318/32.png) [@duane.johnson](https://www.ruby-forum.com/u/duane.johnson)\
**Post date:** [November 15, 2005, 7:33am UTC](https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935/1 "2005-11-15T07:33:43Z")

</div>

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/](http://raa.ruby-lang.org/project/ruby-sdl/)  
[2] [http://tadpoles.rubyforge.org/](http://tadpoles.rubyforge.org/)  
[3] [http://www.rubygarden.org/ruby?RuDL](http://www.rubygarden.org/ruby?RuDL)

---

<div class="post-metadata">

**Author:** ![duane.johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ccd318/32.png) [@duane.johnson](https://www.ruby-forum.com/u/duane.johnson)\
**Post date:** [November 15, 2005, 10:52am UTC](https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935/2 "2005-11-15T10:52:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![duane.johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ccd318/32.png) [@duane.johnson](https://www.ruby-forum.com/u/duane.johnson)\
**Post date:** [November 15, 2005, 4:24pm UTC](https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935/3 "2005-11-15T16:24:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![duane.johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ccd318/32.png) [@duane.johnson](https://www.ruby-forum.com/u/duane.johnson)\
**Post date:** [November 15, 2005, 5:09pm UTC](https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935/4 "2005-11-15T17:09:14Z")

</div>

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/ext/tk/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 J.  
(canadaduane)

---

<div class="post-metadata">

**Author:** ![duane.johnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ccd318/32.png) [@duane.johnson](https://www.ruby-forum.com/u/duane.johnson)\
**Post date:** [November 15, 2005, 5:00pm UTC](https://www.ruby-forum.com/t/has-anyone-written-an-extconf-rb-that-depends-on-a-mac-os-fr/47935/5 "2005-11-15T17:00:12Z")

</div>

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](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/extconf.rb?rev=1.12;content-type=text%2Fplain)
