How do I get rake to compile native extension during gem installation?

J

jyzhang

Hi, I have a little problem and I don't know how to solve.

I created a little native extension that I want to package as a gem.
The problem is that because of the nature of the extension, I created a
custom Rakefile to compile it, instead of using mkmf (extconf.rb) like
the example in the pickaxe book. The rake script will fail to compile
if a special tool isn't available on the system (which is the desired
outcome).

Now, the problem is that I want to package the whole thing as a gem,
and during gem install, I want this Rakefile to run and build on the
target system.

My files look something like this:

/directory-of-gem
/ext
source_files.c
other_files
Rakefile

Now, I couldn't figure out how to package the gem so that I get to run
the Rakefile inside the /ext directory. Is this even possible to do?

Thanks,

J.Y.Z.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top