Skip to content

Instantly share code, notes, and snippets.

@luislavena
Created August 1, 2010 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luislavena/503737 to your computer and use it in GitHub Desktop.
Save luislavena/503737 to your computer and use it in GitHub Desktop.
baseruby="ruby"
ruby="${RUBY-$baseruby}"
"eval" "{ `expr \"$ruby\" : echo > /dev/null || echo exec` $ruby "'-r"`expr \"$0\" : / > /dev/null || pwd`/${0#/}" "$@";' "}" || "exit" "$?"
class Object
CROSS_COMPILING = RUBY_PLATFORM
remove_const :RUBY_PLATFORM
remove_const :RUBY_VERSION
remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
RUBY_PLATFORM = "i386-mingw32"
RUBY_VERSION = "1.9.2"
RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (2010-08-02) [#{RUBY_PLATFORM}]"
end
if RUBY_PLATFORM =~ /mswin|bccwin|mingw/
class File
remove_const :ALT_SEPARATOR
ALT_SEPARATOR = "\\"
end
end
$:.unshift(File.expand_path("..", __FILE__))
posthook = proc do
config = RbConfig::CONFIG
mkconfig = RbConfig::MAKEFILE_CONFIG
extout = File.expand_path(mkconfig["EXTOUT"], mkconfig["builddir"])
$arch_hdrdir = "#{extout}/include/$(arch)"
$ruby = baseruby
untrace_var(:$ruby, posthook)
end
prehook = proc do |extmk|
unless extmk
config = RbConfig::CONFIG
mkconfig = RbConfig::MAKEFILE_CONFIG
mkconfig["top_srcdir"] = $top_srcdir = File.expand_path("/home/luis/projects/oss/ruby/build/..")
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment