rcov 0.5.0.1-mswin32

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,139 @@
1
+ # rcov Copyright (c) 2004-2006 Mauricio Fernandez <mfp@acm.org>
2
+ #
3
+ # See LEGAL and LICENSE for licensing information.
4
+
5
+ require 'rcov/version'
6
+
7
+ module Rcov
8
+
9
+ # RCOV__ performs the low-level tracing of the execution, gathering code
10
+ # coverage information in the process. The C core made available through the
11
+ # rcovrt extension will be used if possible. Otherwise the functionality
12
+ # will be emulated using set_trace_func, but this is very expensive and
13
+ # will fail if other libraries (e.g. breakpoint) change the trace_func.
14
+ #
15
+ # Do not use this module; it is very low-level and subject to frequent
16
+ # changes. Rcov::CodeCoverageAnalyzer offers a much more convenient and
17
+ # stable interface.
18
+ module RCOV__
19
+ COVER = {}
20
+ CALLSITES = {}
21
+ DEFSITES = {}
22
+ pure_ruby_impl_needed = true
23
+ unless defined? $rcov_do_not_use_rcovrt
24
+ begin
25
+ require 'rcovrt'
26
+ abi = [0,0,0]
27
+ begin
28
+ abi = RCOV__.ABI
29
+ raise if abi[0] != RCOVRT_ABI[0] || abi[1] < RCOVRT_ABI[1]
30
+ pure_ruby_impl_needed = false
31
+ rescue
32
+ $stderr.puts <<-EOF
33
+ The rcovrt extension I found was built for a different version of rcov.
34
+ The required ABI is: #{RCOVRT_ABI.join(".")}
35
+ Your current rcovrt extension is: #{abi.join(".")}
36
+
37
+ Please delete rcovrt.{so,bundle,dll,...} and install the required one.
38
+ EOF
39
+ raise LoadError
40
+ end
41
+ rescue LoadError
42
+ $stderr.puts <<-EOF
43
+
44
+ Since the rcovrt extension couldn't be loaded, rcov will run in pure-Ruby
45
+ mode, which is about two orders of magnitude slower.
46
+
47
+ If you're on win32, you can find a pre-built extension (usable with recent
48
+ One Click Installer and mswin32 builds) at http://eigenclass.org/hiki.rb?rcov .
49
+
50
+ EOF
51
+ end
52
+ end
53
+
54
+ if pure_ruby_impl_needed
55
+ methods = %w[install_coverage_hook remove_coverage_hook reset_coverage
56
+ install_callsite_hook remove_callsite_hook reset_callsite
57
+ generate_coverage_info generate_callsite_info]
58
+ sklass = class << self; self end
59
+ (methods & sklass.instance_methods).each do |meth|
60
+ sklass.class_eval{ remove_method meth }
61
+ end
62
+
63
+ @coverage_hook_activated = @callsite_hook_activated = false
64
+
65
+ def self.install_coverage_hook # :nodoc:
66
+ install_common_hook
67
+ @coverage_hook_activated = true
68
+ end
69
+
70
+ def self.install_callsite_hook # :nodoc:
71
+ install_common_hook
72
+ @callsite_hook_activated = true
73
+ end
74
+
75
+ def self.install_common_hook # :nodoc:
76
+ set_trace_func lambda {|event, file, line, id, binding, klass|
77
+ next unless SCRIPT_LINES__.has_key? file
78
+ case event
79
+ when 'call'
80
+ if @callsite_hook_activated
81
+ receiver = eval("self", binding)
82
+ klass = class << klass; self end unless klass === receiver
83
+ begin
84
+ DEFSITES[[klass.to_s, id.to_s]] = [file, line]
85
+ rescue Exception
86
+ end
87
+ caller_arr = caller[1,1]
88
+ begin
89
+ hash = CALLSITES[[klass.to_s, id.to_s]] ||= {}
90
+ hash[caller_arr] ||= 0
91
+ hash[caller_arr] += 1
92
+ #puts "#{event} #{file} #{line} #{klass.inspect} " +
93
+ # "#{klass.object_id} #{id} #{eval('self', binding)}"
94
+ rescue Exception
95
+ end
96
+ end
97
+ when 'c-call', 'c-return', 'class'
98
+ return
99
+ end
100
+ if @coverage_hook_activated
101
+ COVER[file] ||= Array.new(SCRIPT_LINES__[file].size, 0)
102
+ COVER[file][line - 1] ||= 0
103
+ COVER[file][line - 1] += 1
104
+ end
105
+ }
106
+ end
107
+
108
+ def self.remove_coverage_hook # :nodoc:
109
+ @coverage_hook_activated = false
110
+ set_trace_func(nil) if !@callsite_hook_activated
111
+ end
112
+
113
+ def self.remove_callsite_hook # :nodoc:
114
+ @callsite_hook_activated = false
115
+ set_trace_func(nil) if !@coverage_hook_activated
116
+ end
117
+
118
+ def self.reset_coverage # :nodoc:
119
+ COVER.replace({})
120
+ end
121
+
122
+ def self.reset_callsite # :nodoc:
123
+ CALLSITES.replace({})
124
+ DEFSITES.replace({})
125
+ end
126
+
127
+ def self.generate_coverage_info # :nodoc:
128
+ Marshal.load(Marshal.dump(COVER))
129
+ end
130
+
131
+ def self.generate_callsite_info # :nodoc:
132
+ [CALLSITES, DEFSITES]
133
+ end
134
+ end
135
+ end # RCOV__
136
+
137
+ end # Rcov
138
+
139
+ # vi: set sw=2:
data/lib/rcov/rant.rb ADDED
@@ -0,0 +1,85 @@
1
+
2
+ require 'rant/rantlib'
3
+
4
+ module Rant # :nodoc:
5
+ class Generators::Rcov
6
+ def self.rant_gen(app, ch, args, &block)
7
+ if !args || args.empty?
8
+ self.new(app, ch, &block)
9
+ elsif args.size == 1
10
+ name, pre = app.normalize_task_arg(args.first, ch)
11
+ self.new(app, ch, name, pre, &block)
12
+ else
13
+ app.abort_at(ch,
14
+ "Rcov takes only one additional argument, " +
15
+ "which should be like one given to the `task' command.")
16
+ end
17
+ end
18
+
19
+ attr_accessor :verbose
20
+ attr_accessor :libs
21
+ attr_accessor :test_dirs
22
+ attr_accessor :pattern
23
+ attr_accessor :test_files
24
+ attr_accessor :rcov_opts
25
+ # Directory where to put the generated XHTML reports
26
+ attr_accessor :output_dir
27
+
28
+ def initialize(app, cinf, name = :rcov, prerequisites = [], &block)
29
+ @rac = app
30
+ @name = name
31
+ @pre = prerequisites
32
+ #@block = block
33
+ @verbose = nil
34
+ cf = cinf[:file]
35
+ @libs = []
36
+ libdir = File.join(File.dirname(File.expand_path(cf)), 'lib')
37
+ @libs << libdir if test(?d, libdir)
38
+ @rcov_opts = ["--text-report"]
39
+ @test_dirs = []
40
+ @pattern = nil
41
+ @test_files = nil
42
+ yield self if block_given?
43
+ @pattern = "test*.rb" if @pattern.nil? && @test_files.nil?
44
+ @output_dir ||= "coverage"
45
+
46
+ @pre ||= []
47
+ # define the task
48
+ app.task(:__caller__ => cinf, @name => @pre) { |t|
49
+ args = []
50
+ if @libs && !@libs.empty?
51
+ args << "-I#{@libs.join File::PATH_SEPARATOR}"
52
+ end
53
+ if rcov_path = ENV['RCOVPATH']
54
+ args << rcov_path
55
+ else
56
+ args << "-S" << "rcov"
57
+ end
58
+ args.concat rcov_opts
59
+ args << "-o" << @output_dir
60
+ if test(?d, "test")
61
+ @test_dirs << "test"
62
+ elsif test(?d, "tests")
63
+ @test_dirs << "tests"
64
+ end
65
+ args.concat filelist
66
+ app.context.sys.ruby args
67
+ }
68
+ end
69
+
70
+ def filelist
71
+ return @rac.sys[@rac.var['TEST']] if @rac.var['TEST']
72
+ filelist = @test_files || []
73
+ if filelist.empty?
74
+ if @test_dirs && !@test_dirs.empty?
75
+ @test_dirs.each { |dir|
76
+ filelist.concat(@rac.sys[File.join(dir, @pattern)])
77
+ }
78
+ else
79
+ filelist.concat(@rac.sys[@pattern]) if @pattern
80
+ end
81
+ end
82
+ filelist
83
+ end
84
+ end # class Generators::RubyTest
85
+ end # module Rant
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Define a task library for performing code coverage analysis of unit tests
4
+ # using rcov.
5
+
6
+ require 'rake'
7
+ require 'rake/tasklib'
8
+
9
+ module Rcov
10
+
11
+ # Create a task that runs a set of tests through rcov, generating code
12
+ # coverage reports.
13
+ #
14
+ # Example:
15
+ #
16
+ # require 'rcov/rcovtask'
17
+ #
18
+ # Rcov::RcovTask.new do |t|
19
+ # t.libs << "test"
20
+ # t.test_files = FileList['test/test*.rb']
21
+ # t.verbose = true
22
+ # end
23
+ #
24
+ # If rake is invoked with a "TEST=filename" command line option,
25
+ # then the list of test files will be overridden to include only the
26
+ # filename specified on the command line. This provides an easy way
27
+ # to run just one test.
28
+ #
29
+ # If rake is invoked with a "RCOVOPTS=options" command line option,
30
+ # then the given options are passed to rcov.
31
+ #
32
+ # If rake is invoked with a "RCOVPATH=path/to/rcov" command line option,
33
+ # then the given rcov executable will be used; otherwise the one in your
34
+ # PATH will be used.
35
+ #
36
+ # Examples:
37
+ #
38
+ # rake rcov # run tests normally
39
+ # rake rcov TEST=just_one_file.rb # run just one test file.
40
+ # rake rcov RCOVOPTS="-p" # run in profile mode
41
+ # rake rcov RCOVOPTS="-T" # generate text report
42
+ #
43
+ class RcovTask < Rake::TaskLib
44
+
45
+ # Name of test task. (default is :test)
46
+ attr_accessor :name
47
+
48
+ # List of directories to added to $LOAD_PATH before running the
49
+ # tests. (default is 'lib')
50
+ attr_accessor :libs
51
+
52
+ # True if verbose test output desired. (default is false)
53
+ attr_accessor :verbose
54
+
55
+ # Request that the tests be run with the warning flag set.
56
+ # E.g. warning=true implies "ruby -w" used to run the tests.
57
+ attr_accessor :warning
58
+
59
+ # Glob pattern to match test files. (default is 'test/test*.rb')
60
+ attr_accessor :pattern
61
+
62
+ # Array of commandline options to pass to ruby when running the rcov loader.
63
+ attr_accessor :ruby_opts
64
+
65
+ # Array of commandline options to pass to rcov. An explicit
66
+ # RCOVOPTS=opts on the command line will override this. (default
67
+ # is <tt>["--text-report"]</tt>)
68
+ attr_accessor :rcov_opts
69
+
70
+ # Output directory for the XHTML report.
71
+ attr_accessor :output_dir
72
+
73
+ # Explicitly define the list of test files to be included in a
74
+ # test. +list+ is expected to be an array of file names (a
75
+ # FileList is acceptable). If both +pattern+ and +test_files+ are
76
+ # used, then the list of test files is the union of the two.
77
+ def test_files=(list)
78
+ @test_files = list
79
+ end
80
+
81
+ # Create a testing task.
82
+ def initialize(name=:rcov)
83
+ @name = name
84
+ @libs = ["lib"]
85
+ @pattern = nil
86
+ @test_files = nil
87
+ @verbose = false
88
+ @warning = false
89
+ @rcov_opts = ["--text-report"]
90
+ @ruby_opts = []
91
+ @output_dir = "coverage"
92
+ yield self if block_given?
93
+ @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil?
94
+ define
95
+ end
96
+
97
+ # Create the tasks defined by this task lib.
98
+ def define
99
+ lib_path = @libs.join(File::PATH_SEPARATOR)
100
+ actual_name = Hash === name ? name.keys.first : name
101
+ unless Rake.application.last_comment
102
+ desc "Analyze code coverage with tests" +
103
+ (@name==:rcov ? "" : " for #{actual_name}")
104
+ end
105
+ task @name do
106
+ run_code = ''
107
+ RakeFileUtils.verbose(@verbose) do
108
+ run_code =
109
+ case rcov_path
110
+ when nil, ''
111
+ "-S rcov"
112
+ else %!"#{rcov_path}"!
113
+ end
114
+ ruby_opts = @ruby_opts.clone
115
+ ruby_opts.unshift run_code
116
+ ruby_opts.unshift( "-I#{lib_path}" )
117
+ ruby_opts.unshift( "-w" ) if @warning
118
+ ruby ruby_opts.join(" ") + " " + option_list +
119
+ %[ -o "#{@output_dir}" ] +
120
+ file_list.collect { |fn| %["#{fn}"] }.join(' ')
121
+ end
122
+ end
123
+
124
+ desc "Remove rcov products for #{actual_name}"
125
+ task paste("clobber_", actual_name) do
126
+ rm_r @output_dir rescue nil
127
+ end
128
+
129
+ clobber_task = paste("clobber_", actual_name)
130
+ task :clobber => [clobber_task]
131
+
132
+ task actual_name => clobber_task
133
+ self
134
+ end
135
+
136
+ def rcov_path # :nodoc:
137
+ ENV['RCOVPATH']
138
+ end
139
+
140
+ def option_list # :nodoc:
141
+ ENV['RCOVOPTS'] || @rcov_opts.join(" ") || ""
142
+ end
143
+
144
+ def file_list # :nodoc:
145
+ if ENV['TEST']
146
+ FileList[ ENV['TEST'] ]
147
+ else
148
+ result = []
149
+ result += @test_files.to_a if @test_files
150
+ result += FileList[ @pattern ].to_a if @pattern
151
+ FileList[result]
152
+ end
153
+ end
154
+ end
155
+ end
156
+
@@ -0,0 +1,13 @@
1
+ # rcov Copyright (c) 2004-2006 Mauricio Fernandez <mfp@acm.org>
2
+ #
3
+ # See LEGAL and LICENSE for licensing information.
4
+
5
+ module Rcov
6
+
7
+ VERSION = "0.5.0"
8
+ RELEASE_DATE = "2006-05-30"
9
+ RCOVRT_ABI = [1,0,0]
10
+ UPSTREAM_URL = "http://eigenclass.org/hiki.rb?rcov"
11
+
12
+ end
13
+ # vi: set sw=2:
data/lib/rcovrt.so ADDED
Binary file
data/mingw-rbconfig.rb ADDED
@@ -0,0 +1,174 @@
1
+
2
+ # This rbconfig.rb corresponds to a Ruby installation for win32 cross-compiled
3
+ # with mingw under i686-linux. It can be used to cross-compile extensions for
4
+ # win32 using said toolchain.
5
+ #
6
+ # This file assumes that a cross-compiled mingw32 build (compatible with the
7
+ # mswin32 builds) is installed under $HOME/ruby-mingw32.
8
+
9
+ module Config
10
+ RUBY_VERSION == "1.8.4" or
11
+ raise "ruby lib version (1.8.4) doesn't match executable version (#{RUBY_VERSION})"
12
+
13
+ TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/1.8/i386-mingw32")
14
+ DESTDIR = '' unless defined? DESTDIR
15
+ CONFIG = {}
16
+ CONFIG["DESTDIR"] = DESTDIR
17
+ CONFIG["INSTALL"] = "/usr/bin/install -c"
18
+ CONFIG["prefix"] = (TOPDIR || DESTDIR + "#{ENV["HOME"]}/ruby-mingw32")
19
+ CONFIG["EXEEXT"] = ".exe"
20
+ CONFIG["ruby_install_name"] = "ruby"
21
+ CONFIG["RUBY_INSTALL_NAME"] = "ruby"
22
+ CONFIG["RUBY_SO_NAME"] = "msvcrt-ruby18"
23
+ CONFIG["SHELL"] = "/bin/sh"
24
+ CONFIG["PATH_SEPARATOR"] = ":"
25
+ CONFIG["PACKAGE_NAME"] = ""
26
+ CONFIG["PACKAGE_TARNAME"] = ""
27
+ CONFIG["PACKAGE_VERSION"] = ""
28
+ CONFIG["PACKAGE_STRING"] = ""
29
+ CONFIG["PACKAGE_BUGREPORT"] = ""
30
+ CONFIG["exec_prefix"] = "$(prefix)"
31
+ CONFIG["bindir"] = "$(exec_prefix)/bin"
32
+ CONFIG["sbindir"] = "$(exec_prefix)/sbin"
33
+ CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
34
+ CONFIG["datadir"] = "$(prefix)/share"
35
+ CONFIG["sysconfdir"] = "$(prefix)/etc"
36
+ CONFIG["sharedstatedir"] = "$(prefix)/com"
37
+ CONFIG["localstatedir"] = "$(prefix)/var"
38
+ CONFIG["libdir"] = "$(exec_prefix)/lib"
39
+ CONFIG["includedir"] = "$(prefix)/include"
40
+ CONFIG["oldincludedir"] = "/usr/include"
41
+ CONFIG["infodir"] = "$(prefix)/info"
42
+ CONFIG["mandir"] = "$(prefix)/man"
43
+ CONFIG["build_alias"] = "i686-linux"
44
+ CONFIG["host_alias"] = "i586-mingw32msvc"
45
+ CONFIG["target_alias"] = "i386-mingw32"
46
+ CONFIG["ECHO_C"] = ""
47
+ CONFIG["ECHO_N"] = "-n"
48
+ CONFIG["ECHO_T"] = ""
49
+ CONFIG["LIBS"] = "-lwsock32 "
50
+ CONFIG["MAJOR"] = "1"
51
+ CONFIG["MINOR"] = "8"
52
+ CONFIG["TEENY"] = "4"
53
+ CONFIG["build"] = "i686-pc-linux"
54
+ CONFIG["build_cpu"] = "i686"
55
+ CONFIG["build_vendor"] = "pc"
56
+ CONFIG["build_os"] = "linux"
57
+ CONFIG["host"] = "i586-pc-mingw32msvc"
58
+ CONFIG["host_cpu"] = "i586"
59
+ CONFIG["host_vendor"] = "pc"
60
+ CONFIG["host_os"] = "mingw32msvc"
61
+ CONFIG["target"] = "i386-pc-mingw32"
62
+ CONFIG["target_cpu"] = "i386"
63
+ CONFIG["target_vendor"] = "pc"
64
+ CONFIG["target_os"] = "mingw32"
65
+ CONFIG["CC"] = "i586-mingw32msvc-gcc"
66
+ CONFIG["CFLAGS"] = "-g -O2 "
67
+ CONFIG["LDFLAGS"] = ""
68
+ CONFIG["CPPFLAGS"] = ""
69
+ CONFIG["OBJEXT"] = "o"
70
+ CONFIG["CPP"] = "i586-mingw32msvc-gcc -E"
71
+ CONFIG["EGREP"] = "grep -E"
72
+ CONFIG["GNU_LD"] = "yes"
73
+ CONFIG["CPPOUTFILE"] = "-o conftest.i"
74
+ CONFIG["OUTFLAG"] = "-o "
75
+ CONFIG["YACC"] = "bison -y"
76
+ CONFIG["RANLIB"] = "i586-mingw32msvc-ranlib"
77
+ CONFIG["AR"] = "i586-mingw32msvc-ar"
78
+ CONFIG["NM"] = "i586-mingw32msvc-nm"
79
+ CONFIG["WINDRES"] = "i586-mingw32msvc-windres"
80
+ CONFIG["DLLWRAP"] = "i586-mingw32msvc-dllwrap"
81
+ CONFIG["OBJDUMP"] = "i586-mingw32msvc-objdump"
82
+ CONFIG["LN_S"] = "ln -s"
83
+ CONFIG["SET_MAKE"] = ""
84
+ CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
85
+ CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
86
+ CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
87
+ CONFIG["RM"] = "rm -f"
88
+ CONFIG["CP"] = "cp"
89
+ CONFIG["MAKEDIRS"] = "mkdir -p"
90
+ CONFIG["LIBOBJS"] = " fileblocks$(U).o crypt$(U).o flock$(U).o acosh$(U).o win32$(U).o"
91
+ CONFIG["ALLOCA"] = ""
92
+ CONFIG["DLDFLAGS"] = " -Wl,--enable-auto-import,--export-all"
93
+ CONFIG["ARCH_FLAG"] = ""
94
+ CONFIG["STATIC"] = ""
95
+ CONFIG["CCDLFLAGS"] = ""
96
+ CONFIG["LDSHARED"] = "i586-mingw32msvc-gcc -shared -s"
97
+ CONFIG["DLEXT"] = "so"
98
+ CONFIG["DLEXT2"] = "dll"
99
+ CONFIG["LIBEXT"] = "a"
100
+ CONFIG["LINK_SO"] = ""
101
+ CONFIG["LIBPATHFLAG"] = " -L\"%s\""
102
+ CONFIG["RPATHFLAG"] = ""
103
+ CONFIG["LIBPATHENV"] = ""
104
+ CONFIG["TRY_LINK"] = ""
105
+ CONFIG["STRIP"] = "strip"
106
+ CONFIG["EXTSTATIC"] = ""
107
+ CONFIG["setup"] = "Setup"
108
+ CONFIG["MINIRUBY"] = "ruby -rfake"
109
+ CONFIG["PREP"] = "fake.rb"
110
+ CONFIG["RUNRUBY"] = "$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`"
111
+ CONFIG["EXTOUT"] = ".ext"
112
+ CONFIG["ARCHFILE"] = ""
113
+ CONFIG["RDOCTARGET"] = ""
114
+ CONFIG["XCFLAGS"] = " -DRUBY_EXPORT"
115
+ CONFIG["XLDFLAGS"] = " -Wl,--stack,0x02000000 -L."
116
+ CONFIG["LIBRUBY_LDSHARED"] = "i586-mingw32msvc-gcc -shared -s"
117
+ CONFIG["LIBRUBY_DLDFLAGS"] = " -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBRUBY)"
118
+ CONFIG["rubyw_install_name"] = "rubyw"
119
+ CONFIG["RUBYW_INSTALL_NAME"] = "rubyw"
120
+ CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
121
+ CONFIG["LIBRUBY_SO"] = "$(RUBY_SO_NAME).dll"
122
+ CONFIG["LIBRUBY_ALIASES"] = ""
123
+ CONFIG["LIBRUBY"] = "lib$(LIBRUBY_SO).a"
124
+ CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
125
+ CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static"
126
+ CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME)"
127
+ CONFIG["SOLIBS"] = "$(LIBS)"
128
+ CONFIG["DLDLIBS"] = ""
129
+ CONFIG["ENABLE_SHARED"] = "yes"
130
+ CONFIG["MAINLIBS"] = ""
131
+ CONFIG["COMMON_LIBS"] = "m"
132
+ CONFIG["COMMON_MACROS"] = ""
133
+ CONFIG["COMMON_HEADERS"] = "windows.h winsock.h"
134
+ CONFIG["EXPORT_PREFIX"] = ""
135
+ CONFIG["MINIOBJS"] = "dmydln.o"
136
+ CONFIG["MAKEFILES"] = "Makefile GNUmakefile"
137
+ CONFIG["arch"] = "i386-mingw32"
138
+ CONFIG["sitearch"] = "i386-msvcrt"
139
+ CONFIG["sitedir"] = "$(prefix)/lib/ruby/site_ruby"
140
+ CONFIG["configure_args"] = "'--host=i586-mingw32msvc' '--target=i386-mingw32' '--build=i686-linux' '--prefix=#{ENV["HOME"]}/ruby-mingw32' 'build_alias=i686-linux' 'host_alias=i586-mingw32msvc' 'target_alias=i386-mingw32'"
141
+ CONFIG["NROFF"] = "/usr/bin/nroff"
142
+ CONFIG["MANTYPE"] = "doc"
143
+ CONFIG["LTLIBOBJS"] = " fileblocks$(U).lo crypt$(U).lo flock$(U).lo acosh$(U).lo win32$(U).lo"
144
+ CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
145
+ CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
146
+ CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
147
+ CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
148
+ CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
149
+ CONFIG["topdir"] = File.dirname(__FILE__)
150
+ MAKEFILE_CONFIG = {}
151
+ CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
152
+ def Config::expand(val, config = CONFIG)
153
+ val.gsub!(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) do |var|
154
+ if !(v = $1 || $2)
155
+ '$'
156
+ elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
157
+ pat, sub = $1, $2
158
+ config[v] = false
159
+ Config::expand(key, config)
160
+ config[v] = key
161
+ key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
162
+ key
163
+ else
164
+ var
165
+ end
166
+ end
167
+ val
168
+ end
169
+ CONFIG.each_value do |val|
170
+ Config::expand(val)
171
+ end
172
+ end
173
+ RbConfig = Config # compatibility for ruby-1.9
174
+ CROSS_COMPILING = nil unless defined? CROSS_COMPILING