Esoteric Ruby Blog http://cilibrar.com/~cilibrar/erblog.cgi RubLog en-us Ruby Haiku 137 http://cilibrar.com/~cilibrar/erblog.cgi/Details/ArrayHaiku.txl <pre> 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 </pre> Ruby extconf.rb compatilibity with autoconf http://cilibrar.com/~cilibrar/erblog.cgi/Details/ExtconfAndAutoconf.txl <p>I have made a software packagae, <a href="http://prdownloads.sourceforge.net/complearn/complearn-0.6.2.tar.gz?download">complearn-0.6.2.tar.gz</a> , that uses autoconf and automake to manage system configuration. One of the standard options is:</p> <p><code>./configure --prefix=$HOME/wherever/placetoinstall</code></p> <p>In many autoconf or automake enabled software packages written in C (such as <span class="caps">GNU</span> / <span class="caps">FSF</span> utilities) this creates subdirectories like</p> <p><code>$HOME/wherever/placetoinstall/bin</code> for <em>executables</em> <code>$HOME/wherever/placetoinstall/lib</code> for <em>libraries</em> <code>$HOME/wherever/placetoinstall/man</code> for <em>manual_pages</em></p> <p>and so on for many common naming conventions.</p> <p>Unfortunately I cannot understand how to correctly pass this option on to ruby mkmf:</p> <p><code>ruby extconf.rb</code> <code>make</code></p> <p>I have seen that there is an option to make using a <code>DESTDIR</code> variable such as:</p> <p><code>make DESTDIR=$HOME/wherever/placetoinstall</code></p> <p>but then this creates deep directory structure</p> <p><code>$HOME/wherever/placetoinstall/usr/local/lib/site_ruby/1.8/CompLearnLib</code></p> <p>and to me it seems that the <code>/usr/local</code> 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 <code>mv</code> and then an <code>rm</code> command to correct things, and this seems somewhat complicated and error-prone.</p> <p>Is there a better solution to this problem?</p>