Subject:
[ruby-ffi] Re: extconf.rb and libffi on OSX
From:
Simon Chiang
Date:
1/25/10 11:28 AM
To:
ruby-ffi

Ok, rechecked and filed an issue (http://github.com/ffi/ffi/issues/
#issue/26).  Unfortunately you'll see that I really don't have much
help to give in debugging this... I'm not actually building the
library manually; instead I'm making the gem and installing it, so all
the build output is lost.

Let me know if you need any more description of the issue.

- Simon


On Jan 24, 5:19 pm, Wayne Meissner <wmeiss...@gmail.com> wrote:
> I can't reproduce the problem on 10.6.2 (using latest source from github).
>
> Can you recheck it, and file an issue with the output from the build,
> if it still fails?
>
> 2010/1/13 Simon Chiang <simon.a.chi...@gmail.com>:
>
> > I'm trying to use the unreleased 0.6 version of FFI and I'm having an
> > issue that I ultimately tracked back to this part of extconf.rb:
>
> >  unless Config::CONFIG['host_os'] =~ /mswin32|mingw32/
> >    if pkg_config("libffi") || find_header("ffi.h", "/usr/local/
> > include")
>
> >      # We need at least ffi_call and ffi_prep_closure
> >      libffi_ok = have_library("ffi", "ffi_call", [ "ffi.h" ]) &&
> > have_func("ffi_prep_closure")
>
> >      # Check if the raw api is available.
> >      $defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") &&
> > have_func("ffi_prep_raw_closure")
> >    end
> >  end
>
> > Apparently I need to access the raw api and so I think I need -
> > DHAVE_RAW_API to be set. When I modify extconf.rb to enable that flag,
> > everything works on OSX 10.5.8 but it still doesn't work on OSX
> > 10.6.2.
>
> > By looking at the commits where this code was introduced, I gather
> > this code is about detecting a functional libffi. So is libffi broke
> > on OSX or does it vary between 10.5.8 and 10.6.2 in some way that
> > causes FFI problems? Do I need to update libffi?
>
> > Thanks.
>
> > Relevant commits:
>
> >http://github.com/ffi/ffi/commit/8cbc3f54a875a61e1fb67ac88a25b71940a3...
> >http://github.com/ffi/ffi/commit/31e65abbf7e57b9776557227a41e4cd45886...
>
>