From: rickhg12hs Date: 2006-03-09T05:23:41+09:00 Subject: Re: Adding a compile rule to mkmf.rb Don't know how you could extend mkmf.rb as you describe, but you could take the approach that SWIG offers. In the installation of SWIG, you'll find Makefile.swig and extconf.rb skeletons (in /usr/share/swig/1.3.25/ruby/ for my installation). Makefile.swig has rules for creating the SWIG wrapper (generates a C or C++ source file wrapper using swig) and also for creating the Makefile (using ruby,mkmf.rb, and your extconf.rb). Your extconf.rb will typically check for your library, etc., so that it will be linked into your extension. [from Makefile.swig] # File : Makefile.swig # Makefile for a SWIG module. Use this file if you are # producing a Ruby extension for general use or distribution. # # 1. Prepare extconf.rb. # 2. Modify this file as appropriate. # 3. Type 'make -f Makefile.swig' to generate wrapper code and Makefile. # 4. Type 'make' to build your extension. # 5. Type 'make install' to install your extension. Perhaps you could create an appropriate Makefile.whatever and an extconf.rb that will create your extension. Good luck!