Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 59 lines (50 sloc) 1.496 kb
1fc7f84e » (no author)
2004-12-08 This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
1 #!./miniruby
2
3 while arg = ARGV[0]
4 break ARGV.shift if arg == '--'
5 /\A--([-\w]+)(?:=(.*))?\z/ =~ arg or break
6 arg, value = $1, $2
7 re = Regexp.new('\A'+arg.gsub(/\w+\b/, '\&\\w*')+'\z', "i")
8 case
9 when re =~ "srcdir"
10 srcdir = value
11 when re =~ "archdir"
12 archdir = value
13 when re =~ "extout"
14 extout = value
15 else
16 break
17 end
18 ARGV.shift
19 end
20
21 srcdir ||= File.dirname(__FILE__)
22 archdir ||= '.'
23
58f4fbce » nobu
2005-06-23 * runruby.rb: should load built rbconfig.rb.
24 abs_archdir = File.expand_path(archdir)
25 $:.unshift(abs_archdir)
26
27 require 'rbconfig'
28 config = Config::CONFIG
29
1fc7f84e » (no author)
2004-12-08 This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
30 ruby = File.join(archdir, config["RUBY_INSTALL_NAME"]+config['EXEEXT'])
31 unless File.exist?(ruby)
32 abort "#{ruby} is not found.\nTry `make' first, then `make test', please.\n"
33 end
34
35 libs = [abs_archdir, File.expand_path("lib", srcdir)]
36 if extout
37 abs_extout = File.expand_path(extout)
38 libs << abs_extout << File.expand_path(RUBY_PLATFORM, abs_extout)
39 end
40 config["bindir"] = abs_archdir
41 ENV["RUBY"] = File.expand_path(ruby)
42 ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
43
44 if e = ENV["RUBYLIB"]
45 libs |= e.split(File::PATH_SEPARATOR)
46 end
47 ENV["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
48
49 libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
50 if File.file?(libruby_so)
51 if e = config['LIBPATHENV'] and !e.empty?
52 ENV[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
53 end
54 if /linux/ =~ RUBY_PLATFORM
55 ENV["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
56 end
57 end
58
59 exec ruby, *ARGV
Something went wrong with that request. Please try again.