Subject:
Re: [ruby-ffi] Re: distributing c with gem
From:
Jeremy Voorhis
Date:
4/19/12 5:34 PM
To:
ruby-ffi@googlegroups.com

In reply to mixtli, yes auto tools are really that difficult!

Since then, I merged a pull request from neelance for a new build system implemented with a Rakefile (https://github.com/jvoorhis/ruby-llvm/blob/master/ext/ruby-llvm-support/Rakefile). This is added to the gemspec and everything Just Works. It's great to rely on FFI instead of the Ruby C API but still package library dependencies this way. Perhaps the boilerplate could be more streamlined...

Cheers,

Jeremy Voorhis

On Thursday, April 19, 2012 at 1:01 PM, Hampton Catlin wrote:

I'm also super interested in this. I have a small C library that I'd rather just
bundle in with the gem and allow local compilation.

What mixtli described is what I would assume would work... but I don't know 
how to actually make ffi see the code!

-hampton.

On Sunday, October 23, 2011 6:38:14 PM UTC-7, mixtli wrote:
Wow, is it really that difficult?  I'd have thought it'd just be a
matter of setting up an extconf to build the extension and then
telling ffi somehow about the ext/foo directory as a library path.


On Oct 23, 1:52 pm, Jeremy Voorhis <jvoor...@gmail.com> wrote:
>  I've tried to crack this one as well. After learning that RubyGems will build extensions using configure-make-install in addition to extconf.rb, I have a branch of ruby-llvm that uses the autotools to build and manage a shared library, but unfortunately haven't released it yet because of incompatibilities between autoconf versions on Mac and Ubuntu.
>
> You can see my approach athttps://github.com/jvoorhis/ruby-llvm/tree/support-lib. If anyone is an autotools pro, or has a better idea, please help! :)
>
> Jeremy
>
>
>
>
>
>
>
> On Sunday, October 23, 2011 at 2:49 AM, mixtli wrote:
> >  I want to package up my c source with my gem, and call it from ffi.
> > How can I tell ffi to use a library packaged with the gem instead of
> > looking in the system libraries?