On 9/13/06, John Gabriele <jmg3000 / gmail.com> wrote:

> Thanks for the explanation Lyle. I'm sorry, but perhaps I was unclear
> (and also still not understanding this). I'm looking to find out the
> mechanism at work *at link-edit time*, when you're building the
> extension module. I mean, what are the args necessary to pass to gcc
> to tell it that, when your code makes those rb_foo calls, those calls
> are actually supposed to bind to something besides a .so file sitting
> on your harddisk?

Oh, OK. Well, I can't tell you the *specific* arguments because
they're highly platform-dependent. But the easiest way (IMO) to find
out what they should be is to write an extconf.rb script (a standard
fixture for any Ruby extension) and then run that. I won't go into
detail about the contents of an extconf.rb script, because that's
covered in a number of places (including "Programming Ruby" by Dave
Thomas et al). But the bottom line is that running extconf.rb will
produce a platform-specific Makefile for compiling and linking your
extension module. And once you have that Makefile, you can presumably
back-out the command line arguments that it's using to compile and
link your C code into a shared library.