summaryrefslogtreecommitdiff
path: root/template/fake.rb.in
blob: 7e47c2cec18134233a66c137f3431433cf9828fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
baseruby="@BASERUBY@"
ruby="${RUBY-$baseruby}"
_=
"eval" "{" \
"`expr \"$ruby\" : echo > /dev/null || echo exec`" \
"$ruby" '-r"`expr \"$0\" : / > /dev/null || pwd`/${0#/}" "$@";' \
"}" || "exit" "$?"
_=baseruby
ruby=ruby
class Object
  remove_const :CROSS_COMPILING if defined?(CROSS_COMPILING)
  CROSS_COMPILING = RUBY_PLATFORM
  remove_const :RUBY_PLATFORM
  remove_const :RUBY_VERSION
  remove_const :RUBY_PATCHLEVEL
  remove_const :RUBY_RELEASE_DATE
  remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
  RUBY_PLATFORM = "@arch@"
  RUBY_VERSION = "@RUBY_PROGRAM_VERSION@"
  RUBY_PATCHLEVEL = @PATCHLEVEL@
  RUBY_RELEASE_DATE = "@RUBY_RELEASE_DATE@"
  patchlevel_str = RUBY_PATCHLEVEL == -1 ? "dev" : "p#{RUBY_PATCHLEVEL}"
  RUBY_DESCRIPTION = "ruby #{RUBY_VERSION}#{patchlevel_str} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end
builddir = File.dirname(File.expand_path(__FILE__))
top_srcdir = File.expand_path("@srcdir@", builddir)
$:.unshift(builddir)
fake = File.join(top_srcdir, "tool/fake.rb")
eval(File.read(fake), nil, fake)
ENV["RUBYOPT"] = ["-r#{__FILE__}", ENV["RUBYOPT"]].compact.join(" ")