--- zruby.org.rb Tue Sep 17 22:15:18 2002 +++ zruby.rb Sat Sep 21 00:11:14 2002 @@ -1,7 +1,12 @@ #!/bin/env ruby -def fetch() - `cvs -z4 -d :pserver:anonymous:anonymous@cvs.ruby-lang.org:/src co ruby` +$BaseDir = './ruby' + +def setbase() + if ARGV[0] + return $BaseDir = ARGV[0] + end + return false end def setArmEnv() @@ -31,9 +36,10 @@ def compile() puts "*** STARTING COMPILATION ***" - Dir.chdir("ruby") + olddir = Dir.pwd + Dir.chdir($BaseDir) system "autoconf" - system "./configure --build=arm-linux --disable-ipv6 --prefix=/tmp/zruby" + system "./configure --build=arm-linux --target=arm-linux --disable-ipv6 --prefix=/tmp/zruby" setArmEnv() @@ -50,8 +56,9 @@ system "make" puts "*** MAKE TEMP INSTALL ***" + system "rm -rf /tmp/zruby" system "make install" - Dir.chdir(".."); + Dir.chdir(olddir); end def strip() @@ -60,9 +67,9 @@ system "rm -r man" system "arm-linux-strip bin/ruby" - system "arm-linux-strip lib/ruby/1.7/arm-linux/*.so" - system "arm-linux-strip lib/ruby/1.7/arm-linux/*.a" - system "arm-linux-strip lib/ruby/1.7/arm-linux/*/*.so" + system "arm-linux-strip lib/ruby/1.?/arm-linux/*.so" + system "arm-linux-strip lib/ruby/1.?/arm-linux/*.a" + system "arm-linux-strip lib/ruby/1.?/arm-linux/*/*.so" Dir.chdir(olddir) end @@ -77,7 +84,10 @@ Dir.chdir(olddir) end -fetch() -compile() -strip() -package() +if (setbase()) + compile() + strip() + package() +else + puts("usage:\n#{$0} ") +end