Module: Config

Defined in:
ext/mingw-rbconfig.rb

Overview

This rbconfig.rb corresponds to a Ruby installation for win32 cross-compiled with mingw under i686-linux. It can be used to cross-compile extensions for win32 using said toolchain.

This file assumes that a cross-compiled mingw32 build (compatible with the mswin32 builds) is installed under $HOME/ruby-mingw32.

Constant Summary collapse

TOPDIR =
File.dirname(__FILE__).chomp!("/lib/ruby/1.8/i386-mingw32")
DESTDIR =
''
CONFIG =
{}
MAKEFILE_CONFIG =
{}

Class Method Summary collapse

Class Method Details

.expand(val, config = CONFIG) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'ext/mingw-rbconfig.rb', line 154

def Config::expand(val, config = CONFIG)
  val.gsub!(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) do |var|
    if !(v = $1 || $2)
  '$'
    elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
  pat, sub = $1, $2
  config[v] = false
  Config::expand(key, config)
  config[v] = key
  key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
  key
    else
  var
    end
  end
  val
end