Ruby headers?

C. Florian Ebeling florian.ebeling at gmail.com
Sat May 9 02:51:12 PDT 2009


On Fri, May 8, 2009 at 9:09 PM, Daniel J. Luke <dluke at geeklair.net> wrote:
> On May 8, 2009, at 2:14 PM, Darren Weber wrote:
>>
>> Where are the ruby headers?
>>
>> There's $prefix/lib/libruby* but no headers in $prefix/include or
>> $prefix/Library/Frameworks/
>>
>> I have
>> ruby @1.8.7-p160_1+thread_hooks (active)
>
>
> I don't know which headers you're specifically looking for, but perhaps port
> can help you find them?
>
> % port contents ruby | grep ruby.h
>  /opt/local/lib/ruby/1.8/i686-darwin9/ruby.h

Yes, this is the one you usually use for extensions.
The location path contains the architecture to be able to keep more
than one architecture in the same image or file system.

On a linux machine this might be:
/usr/lib/ruby/1.8/i486-linux/ruby.h

This location is determined during (autoconf) configure phase of the
package. The location is named the 'archdir' of the package,
and you can examine it from within ruby because it is saved
in a require-able file, rbconfig.rb. This shell line gives you the
value in a shell script:

  ruby -r rbconfig -e 'puts Config::CONFIG["archdir"]'

So if you write a build script you might want to reference
it using this variable, to make it usable on systems other
the your current one.

Florian

-- 
Florian Ebeling
Twitter: febeling
florian.ebeling at gmail.com


More information about the macports-dev mailing list