Syndicate: [full] [short]
2 of 2 articles
Ruby Haiku 137
25 Jan 05    [print link all ]

class Array
  def scramble() dup.scramble! end                          # scramble v. 0.15
  def swap(i,j) self[i],self[j] = at(j),at(i) end           # by cilibrar
  def scramble!() each_index() { |i| swap(i,i+rand(size-i)) } end
end
Ruby extconf.rb compatilibity with autoconf
28 Dec 04    [print link all ]

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?