2010-04-06 06:21:40 +04:00
|
|
|
baseruby="@BASERUBY@"
|
|
|
|
ruby="${RUBY-$baseruby}"
|
|
|
|
"eval" "{ `expr \"$ruby\" : echo > /dev/null || echo exec` $ruby "'-r"`expr \"$0\" : / > /dev/null || pwd`/${0#/}" "$@";' "}" || "exit" "$?"
|
2009-02-19 09:47:13 +03:00
|
|
|
class Object
|
|
|
|
CROSS_COMPILING = RUBY_PLATFORM
|
|
|
|
remove_const :RUBY_PLATFORM
|
|
|
|
remove_const :RUBY_VERSION
|
|
|
|
remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
|
|
|
|
RUBY_PLATFORM = "@arch@"
|
2009-08-21 02:14:58 +04:00
|
|
|
RUBY_VERSION = "@RUBY_PROGRAM_VERSION@"
|
|
|
|
RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (@RUBY_RELEASE_DATE@) [#{RUBY_PLATFORM}]"
|
2009-02-19 09:47:13 +03:00
|
|
|
end
|
|
|
|
if RUBY_PLATFORM =~ /mswin|bccwin|mingw/
|
|
|
|
class File
|
|
|
|
remove_const :ALT_SEPARATOR
|
|
|
|
ALT_SEPARATOR = "\\"
|
|
|
|
end
|
|
|
|
end
|
2010-04-06 06:21:40 +04:00
|
|
|
|
|
|
|
$:.unshift(File.expand_path("..", __FILE__))
|
|
|
|
posthook = proc do
|
2010-04-06 21:06:20 +04:00
|
|
|
config = RbConfig::CONFIG
|
|
|
|
mkconfig = RbConfig::MAKEFILE_CONFIG
|
|
|
|
extout = File.expand_path(mkconfig["EXTOUT"], mkconfig["builddir"])
|
|
|
|
$arch_hdrdir = "#{extout}/include/$(arch)"
|
2010-04-06 06:21:40 +04:00
|
|
|
$ruby = baseruby
|
|
|
|
untrace_var(:$ruby, posthook)
|
|
|
|
end
|
2010-04-24 11:20:28 +04:00
|
|
|
prehook = proc do |extmk|
|
|
|
|
unless extmk
|
|
|
|
config = RbConfig::CONFIG
|
|
|
|
mkconfig = RbConfig::MAKEFILE_CONFIG
|
|
|
|
mkconfig["top_srcdir"] = $top_srcdir = File.expand_path("@abs_top_srcdir@")
|
|
|
|
mkconfig["rubyhdrdir"] = "$(top_srcdir)/include"
|
|
|
|
mkconfig["builddir"] = config["builddir"] = File.expand_path(File.dirname(__FILE__))
|
|
|
|
config["rubyhdrdir"] = File.join(mkconfig["top_srcdir"], "include")
|
|
|
|
mkconfig["libdir"] = config["libdir"] = mkconfig["topdir"]
|
|
|
|
trace_var(:$ruby, posthook)
|
|
|
|
end
|
|
|
|
untrace_var(:$extmk, prehook)
|
|
|
|
end
|
|
|
|
trace_var(:$extmk, prehook)
|