Ruby extconf.rb and autoconf (in?)compatibility

R

Rudi Cilibrasi

I have made a software packagae, complearn-0.6.2.tar.gz ,
that uses autoconf and automake to manage system configuration. One of
the standard options is:
../configure --prefix=$HOME/wherever/placetoinstall

In many autoconf or automake enabled software packages written in C
(such as GNU / FSF utilities) this creates subdirectories like
$HOME/wherever/placetoinstall/bin for executables
$HOME/wherever/placetoinstall/lib for libraries
$HOME/wherever/placetoinstall/man for manual_pages

and so on for many common naming conventions.

Unfortunately I cannot understand how to correctly pass this option on
to ruby mkmf:
ruby extconf.rb
make

I have seen that there is an option to make using
a DESTDIR variable such as:
make DESTDIR=$HOME/wherever/placetoinstall

but then this creates deep directory structure
$HOME/wherever/placetoinstall/usr/local/lib/site_ruby/1.8/CompLearnLib

and to me it seems that the /usr/local portion of the above path
structure is redundant. Is there a way to remove it in the ruby mkmf
extconf.rb structure? The best I can come up with so far is to use an
mv and then an rm command to correct things, and this seems somewhat
complicated and error-prone.

Is there a better solution to this problem?

Thanks for any help you can provide,

Rudi
 
T

Tim Hunter

Rudi said:
I have made a software packagae, complearn-0.6.2.tar.gz ,
that uses autoconf and automake to manage system configuration. One of
the standard options is:
./configure --prefix=$HOME/wherever/placetoinstall
(snip)

Is there a better solution to this problem?

The RMagick (http://rmagick.rubyforge.org) build process uses the
standard ./configure, make, make install steps. The top-level Makefile,
though, simply calls Minero Aoki's setup.rb
(http://raa.ruby-lang.org/project/setup/) to do the real work. It's
setup.rb that actually calls extconf.rb to make the "real" Makefile, runs
make, and installs the RMagick extension.

The ./configure step generates the top-level Makefile and inserts the value
of any --prefix option into the Makefile such that the value is passed
along to setup.rb via setup.rb's --prefix option. The setup.rb script does
the actual installing.

My explanation is probably too vague to be helpful. It's easier to read the
code than to explain it. RMagick's CVS repository is here:
http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/?cvsroot=rmagick


P.S. Actually, RMagick uses an older version of setup.rb called install.rb,
but the principle is the same.
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top