hitimes 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +4 -0
- data/gemspec.rb +6 -1
- data/lib/hitimes.rb +8 -3
- data/lib/hitimes/version.rb +2 -2
- data/spec/interval_spec.rb +1 -1
- data/spec/timed_metric_spec.rb +5 -5
- data/spec/timed_value_metric_spec.rb +2 -2
- data/spec/value_metric_spec.rb +5 -5
- data/tasks/config.rb +2 -1
- data/tasks/distribution.rake +18 -3
- data/tasks/extension.rake +19 -2
- data/tasks/rspec.rake +3 -1
- metadata +4 -5
- data/ext/hitimes/rbconfig.rb +0 -179
data/HISTORY
CHANGED
data/gemspec.rb
CHANGED
@@ -57,4 +57,9 @@ Hitimes::GEM_SPEC_MINGW32= Hitimes::GEM_SPEC.clone
|
|
57
57
|
Hitimes::GEM_SPEC_MINGW32.platform = ::Gem::Platform.new( "i386-mingw32" )
|
58
58
|
Hitimes::GEM_SPEC_MINGW32.extensions = []
|
59
59
|
|
60
|
-
Hitimes::
|
60
|
+
Hitimes::GEM_SPEC_JAVA = Hitimes::GEM_SPEC.clone
|
61
|
+
Hitimes::GEM_SPEC_JAVA.platform = ::Gem::Platform.new( 'java' )
|
62
|
+
Hitimes::GEM_SPEC_JAVA.extensions = []
|
63
|
+
|
64
|
+
Hitimes::SPECS = [ Hitimes::GEM_SPEC, Hitimes::GEM_SPEC_MSWIN32, Hitimes::GEM_SPEC_MINGW32, Hitimes::GEM_SPEC_JAVA ]
|
65
|
+
|
data/lib/hitimes.rb
CHANGED
@@ -19,9 +19,14 @@ end
|
|
19
19
|
require 'hitimes/paths'
|
20
20
|
require 'hitimes/version'
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if RUBY_PLATFORM == "java" then
|
23
|
+
require 'hitimes/hitimes'
|
24
|
+
else
|
25
|
+
# use a version subdirectory for extensions, initially to support windows, but
|
26
|
+
# why make a special case. It doesn't hurt anyone to have an extra subdir.
|
27
|
+
require "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}/hitimes_ext"
|
28
|
+
end
|
29
|
+
|
25
30
|
require 'hitimes/stats'
|
26
31
|
require 'hitimes/mutexed_stats'
|
27
32
|
|
data/lib/hitimes/version.rb
CHANGED
data/spec/interval_spec.rb
CHANGED
data/spec/timed_metric_spec.rb
CHANGED
@@ -84,10 +84,10 @@ describe Hitimes::TimedMetric do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
it "keeps track of the minimum start time of all the intervals" do
|
87
|
-
f1 = Time.now.gmtime.to_f *
|
87
|
+
f1 = Time.now.gmtime.to_f * 1_000_000
|
88
88
|
5.times { @tm.start ; sleep 0.05 ; @tm.stop }
|
89
|
-
f2 = Time.now.gmtime.to_f *
|
90
|
-
@tm.sampling_start_time.should
|
89
|
+
f2 = Time.now.gmtime.to_f * 1_000_000
|
90
|
+
@tm.sampling_start_time.should >= f1
|
91
91
|
@tm.sampling_start_time.should < f2
|
92
92
|
# distance from now to start time should be greater than the distance from
|
93
93
|
# the start to the min start_time
|
@@ -99,7 +99,7 @@ describe Hitimes::TimedMetric do
|
|
99
99
|
5.times { @tm.start ; sleep 0.05 ; @tm.stop }
|
100
100
|
f2 = Time.now.gmtime.to_f * 1_000_000
|
101
101
|
@tm.sampling_stop_time.should > f1
|
102
|
-
@tm.sampling_stop_time.should
|
102
|
+
@tm.sampling_stop_time.should <= f2
|
103
103
|
# distance from now to max stop time time should be less than the distance
|
104
104
|
# from the start to the max stop time
|
105
105
|
(f2 - @tm.sampling_stop_time).should < ( @tm.sampling_stop_time - f1 )
|
@@ -140,7 +140,7 @@ describe Hitimes::TimedMetric do
|
|
140
140
|
it "has the right sum" do
|
141
141
|
10.times { |x| @tm.measure { sleep 0.01*x } }
|
142
142
|
h = @tm.to_hash
|
143
|
-
h['sum'].should be_close( 0.45, 0.
|
143
|
+
h['sum'].should be_close( 0.45, 0.003 )
|
144
144
|
end
|
145
145
|
|
146
146
|
fields = ::Hitimes::Stats::STATS.dup + %w[ name additional_data sampling_start_time sampling_stop_time ]
|
@@ -97,7 +97,7 @@ describe Hitimes::TimedValueMetric do
|
|
97
97
|
f1 = Time.now.gmtime.to_f * 1000000
|
98
98
|
5.times { @tm.start ; sleep 0.05 ; @tm.stop( 1 ) }
|
99
99
|
f2 = Time.now.gmtime.to_f * 1000000
|
100
|
-
@tm.sampling_start_time.should
|
100
|
+
@tm.sampling_start_time.should >= f1
|
101
101
|
@tm.sampling_start_time.should < f2
|
102
102
|
# distance from now to start time should be greater than the distance from
|
103
103
|
# the start to the min start_time
|
@@ -109,7 +109,7 @@ describe Hitimes::TimedValueMetric do
|
|
109
109
|
5.times { @tm.start ; sleep 0.05 ; @tm.stop( 1 ) }
|
110
110
|
f2 = Time.now.gmtime.to_f * 1000000
|
111
111
|
@tm.sampling_stop_time.should > f1
|
112
|
-
@tm.sampling_stop_time.should
|
112
|
+
@tm.sampling_stop_time.should <= f2
|
113
113
|
# distance from now to max stop time time should be less than the distance
|
114
114
|
# from the start to the max stop time
|
115
115
|
(f2 - @tm.sampling_stop_time).should < ( @tm.sampling_stop_time - f1 )
|
data/spec/value_metric_spec.rb
CHANGED
@@ -58,10 +58,10 @@ describe Hitimes::ValueMetric do
|
|
58
58
|
it "keeps track of the first start time of all the measurements" do
|
59
59
|
m = Hitimes::ValueMetric.new( "first-start-time" )
|
60
60
|
f1 = Time.now.gmtime.to_f * 1_000_000
|
61
|
-
10.times{ |x| m.measure( x ) }
|
61
|
+
10.times{ |x| m.measure( x ); sleep 0.1 }
|
62
62
|
f2 = Time.now.gmtime.to_f * 1_000_000
|
63
|
-
m.sampling_start_time.should
|
64
|
-
m.
|
63
|
+
m.sampling_start_time.should >= f1
|
64
|
+
m.sampling_start_time.should < f2
|
65
65
|
# distance from now to start time should be greater than the distance from
|
66
66
|
# the start to the min start_time
|
67
67
|
(f2 - m.sampling_start_time).should > ( m.sampling_start_time - f1 )
|
@@ -70,10 +70,10 @@ describe Hitimes::ValueMetric do
|
|
70
70
|
it "keeps track of the last stop time of all the intervals" do
|
71
71
|
m = Hitimes::ValueMetric.new( "last-stop-time" )
|
72
72
|
f1 = Time.now.gmtime.to_f * 1_000_000
|
73
|
-
10.times {|x| m.measure( x ) }
|
73
|
+
10.times {|x| m.measure( x ); sleep 0.1 }
|
74
74
|
f2 = Time.now.gmtime.to_f * 1_000_000
|
75
75
|
m.sampling_stop_time.should > f1
|
76
|
-
m.sampling_stop_time.should
|
76
|
+
m.sampling_stop_time.should <= f2
|
77
77
|
# distance from now to max stop time time should be less than the distance
|
78
78
|
# from the start to the max stop time
|
79
79
|
(f2 - m.sampling_stop_time).should < ( m.sampling_stop_time - f1 )
|
data/tasks/config.rb
CHANGED
@@ -2,6 +2,7 @@ require 'configuration'
|
|
2
2
|
|
3
3
|
require 'rake'
|
4
4
|
require 'tasks/utils'
|
5
|
+
require 'yaml'
|
5
6
|
|
6
7
|
#-----------------------------------------------------------------------
|
7
8
|
# General project configuration
|
@@ -92,7 +93,7 @@ Configuration.for('rdoc') {
|
|
92
93
|
#-----------------------------------------------------------------------
|
93
94
|
Configuration.for('extension') {
|
94
95
|
configs Configuration.for('packaging').files.ext.find_all { |x| %w[ mkrf_conf.rb extconf.rb ].include?(File.basename(x)) }
|
95
|
-
cross_rbconfig YAML
|
96
|
+
cross_rbconfig ::YAML::load_file( File.expand_path("~/.rake-compiler/config.yml"))
|
96
97
|
}
|
97
98
|
|
98
99
|
#-----------------------------------------------------------------------
|
data/tasks/distribution.rake
CHANGED
@@ -36,11 +36,16 @@ if pkg_config = Configuration.for_if_exist?("packaging") then
|
|
36
36
|
puts Hitimes::GEM_SPEC_WIN.to_ruby
|
37
37
|
end
|
38
38
|
|
39
|
+
desc "dump gemspec for java"
|
40
|
+
task :gemspec_java do
|
41
|
+
puts Hitimes::GEM_SPEC_JAVA.to_ruby
|
42
|
+
end
|
43
|
+
|
39
44
|
desc "reinstall gem"
|
40
45
|
task :reinstall => [:uninstall, :repackage, :install]
|
41
46
|
|
42
47
|
desc "package up a windows gem"
|
43
|
-
task :package_win => :clean
|
48
|
+
task :package_win => :clean do
|
44
49
|
Configuration.for("extension").cross_rbconfig.keys.each do |rbconfig|
|
45
50
|
v = rbconfig.split("-").last
|
46
51
|
s = v.sub(/\.\d$/,'')
|
@@ -58,15 +63,25 @@ if pkg_config = Configuration.for_if_exist?("packaging") then
|
|
58
63
|
end
|
59
64
|
end
|
60
65
|
|
66
|
+
if RUBY_PLATFORM == "java" then
|
67
|
+
desc "package up a jruby gem"
|
68
|
+
task :package_java => "ext:build_java" do
|
69
|
+
Hitimes::GEM_SPEC_JAVA.files += FileList["lib/hitimes/java/*.jar"]
|
70
|
+
Gem::Builder.new( Hitimes::GEM_SPEC_JAVA ).build
|
71
|
+
mv Dir["*.gem"].first, "pkg"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
61
75
|
task :clobber do
|
62
76
|
rm_rf "lib/hitimes/1.8"
|
63
77
|
rm_rf "lib/hitimes/1.9"
|
78
|
+
rm_rf "lib/hitimes/*.jar"
|
64
79
|
end
|
65
80
|
|
66
|
-
task :prep => [:clean, :package, :package_win]
|
81
|
+
task :prep => [:clean, :package, :package_win, :package_java ]
|
67
82
|
|
68
83
|
desc "distribute copiously"
|
69
|
-
task :copious => [:clean, :package, :package_win ] do
|
84
|
+
task :copious => [:clean, :package, :package_win, :package_java ] do
|
70
85
|
gems = Hitimes::SPECS.collect { |s| "#{s.full_name}.gem" }
|
71
86
|
Rake::SshFilePublisher.new('jeremy@copiousfreetime.org',
|
72
87
|
'/var/www/vhosts/www.copiousfreetime.org/htdocs/gems/gems',
|
data/tasks/extension.rake
CHANGED
@@ -8,7 +8,7 @@ require 'pathname'
|
|
8
8
|
if ext_config = Configuration.for_if_exist?('extension') then
|
9
9
|
namespace :ext do
|
10
10
|
desc "Build the extension(s)"
|
11
|
-
task :build => :
|
11
|
+
task :build => :clobber do
|
12
12
|
ext_config.configs.each do |extension|
|
13
13
|
path = Pathname.new(extension)
|
14
14
|
parts = path.split
|
@@ -26,6 +26,23 @@ if ext_config = Configuration.for_if_exist?('extension') then
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
if RUBY_PLATFORM == "java" then
|
30
|
+
desc "Build the jruby extension"
|
31
|
+
task :build_java => [ :clobber, "lib/hitimes/hitimes.jar" ]
|
32
|
+
|
33
|
+
file "lib/hitimes/hitimes.jar" => FileList["ext/java/src/hitimes/*.java"] do |t|
|
34
|
+
jruby_home = Config::CONFIG['prefix']
|
35
|
+
jruby_jar = File.join( jruby_home, 'lib', 'jruby.jar' )
|
36
|
+
|
37
|
+
mkdir_p 'pkg/classes'
|
38
|
+
sh "javac -classpath #{jruby_jar} -d pkg/classes #{t.prerequisites.join(' ')}"
|
39
|
+
|
40
|
+
dest_dir = File.dirname(t.name)
|
41
|
+
sh "jar cf #{t.name} -C pkg/classes ."
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
|
29
46
|
def build_win( version = "1.8.6" )
|
30
47
|
ext_config = Configuration.for("extension")
|
31
48
|
rbconfig = ext_config.cross_rbconfig["rbconfig-#{version}"]
|
@@ -34,7 +51,7 @@ if ext_config = Configuration.for_if_exist?('extension') then
|
|
34
51
|
path = Pathname.new(extension)
|
35
52
|
parts = path.split
|
36
53
|
conf = parts.last
|
37
|
-
rvm =
|
54
|
+
rvm = File.expand_path( "~/.rvm/bin/rvm" )
|
38
55
|
Dir.chdir(path.dirname) do |d|
|
39
56
|
if File.exist?( "Makefile" ) then
|
40
57
|
sh "make clean distclean"
|
data/tasks/rspec.rake
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hitimes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.5
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeremy Hinegardner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-28 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -126,7 +126,6 @@ files:
|
|
126
126
|
- ext/hitimes/hitimes_interval.h
|
127
127
|
- ext/hitimes/hitimes_stats.h
|
128
128
|
- ext/hitimes/extconf.rb
|
129
|
-
- ext/hitimes/rbconfig.rb
|
130
129
|
- lib/hitimes/metric.rb
|
131
130
|
- lib/hitimes/mutexed_stats.rb
|
132
131
|
- lib/hitimes/paths.rb
|
data/ext/hitimes/rbconfig.rb
DELETED
@@ -1,179 +0,0 @@
|
|
1
|
-
|
2
|
-
# This file was created by mkconfig.rb when ruby was built. Any
|
3
|
-
# changes made to this file will be lost the next time ruby is built.
|
4
|
-
|
5
|
-
module Config
|
6
|
-
RUBY_VERSION == "1.8.6" or
|
7
|
-
raise "ruby lib version (1.8.6) doesn't match executable version (#{RUBY_VERSION})"
|
8
|
-
|
9
|
-
TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/1.8/i386-mingw32")
|
10
|
-
DESTDIR = '' unless defined? DESTDIR
|
11
|
-
CONFIG = {}
|
12
|
-
CONFIG["DESTDIR"] = DESTDIR
|
13
|
-
CONFIG["INSTALL"] = '/usr/bin/install -c'
|
14
|
-
CONFIG["prefix"] = (TOPDIR || DESTDIR + "/Users/jeremy/.rake-compiler/ruby/ruby-1.8.6-p287")
|
15
|
-
CONFIG["EXEEXT"] = ".exe"
|
16
|
-
CONFIG["ruby_install_name"] = "ruby"
|
17
|
-
CONFIG["RUBY_INSTALL_NAME"] = "ruby"
|
18
|
-
CONFIG["RUBY_SO_NAME"] = "msvcrt-ruby18"
|
19
|
-
CONFIG["SHELL"] = "/bin/sh"
|
20
|
-
CONFIG["PATH_SEPARATOR"] = ":"
|
21
|
-
CONFIG["PACKAGE_NAME"] = ""
|
22
|
-
CONFIG["PACKAGE_TARNAME"] = ""
|
23
|
-
CONFIG["PACKAGE_VERSION"] = ""
|
24
|
-
CONFIG["PACKAGE_STRING"] = ""
|
25
|
-
CONFIG["PACKAGE_BUGREPORT"] = ""
|
26
|
-
CONFIG["exec_prefix"] = "$(prefix)"
|
27
|
-
CONFIG["bindir"] = "$(exec_prefix)/bin"
|
28
|
-
CONFIG["sbindir"] = "$(exec_prefix)/sbin"
|
29
|
-
CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
|
30
|
-
CONFIG["datarootdir"] = "$(prefix)/share"
|
31
|
-
CONFIG["datadir"] = "$(datarootdir)"
|
32
|
-
CONFIG["sysconfdir"] = "$(prefix)/etc"
|
33
|
-
CONFIG["sharedstatedir"] = "$(prefix)/com"
|
34
|
-
CONFIG["localstatedir"] = "$(prefix)/var"
|
35
|
-
CONFIG["includedir"] = "$(prefix)/include"
|
36
|
-
CONFIG["oldincludedir"] = "/usr/include"
|
37
|
-
CONFIG["docdir"] = "$(datarootdir)/doc/$(PACKAGE)"
|
38
|
-
CONFIG["infodir"] = "$(datarootdir)/info"
|
39
|
-
CONFIG["htmldir"] = "$(docdir)"
|
40
|
-
CONFIG["dvidir"] = "$(docdir)"
|
41
|
-
CONFIG["pdfdir"] = "$(docdir)"
|
42
|
-
CONFIG["psdir"] = "$(docdir)"
|
43
|
-
CONFIG["libdir"] = "$(exec_prefix)/lib"
|
44
|
-
CONFIG["localedir"] = "$(datarootdir)/locale"
|
45
|
-
CONFIG["mandir"] = "$(datarootdir)/man"
|
46
|
-
CONFIG["DEFS"] = ""
|
47
|
-
CONFIG["ECHO_C"] = ""
|
48
|
-
CONFIG["ECHO_N"] = "-n"
|
49
|
-
CONFIG["ECHO_T"] = ""
|
50
|
-
CONFIG["LIBS"] = "-lshell32 -lwsock32 "
|
51
|
-
CONFIG["build_alias"] = "i686-linux"
|
52
|
-
CONFIG["host_alias"] = "i386-mingw32"
|
53
|
-
CONFIG["target_alias"] = "i386-mingw32"
|
54
|
-
CONFIG["MAJOR"] = "1"
|
55
|
-
CONFIG["MINOR"] = "8"
|
56
|
-
CONFIG["TEENY"] = "6"
|
57
|
-
CONFIG["build"] = "i686-pc-linux"
|
58
|
-
CONFIG["build_cpu"] = "i686"
|
59
|
-
CONFIG["build_vendor"] = "pc"
|
60
|
-
CONFIG["build_os"] = "linux"
|
61
|
-
CONFIG["host"] = "i386-pc-mingw32"
|
62
|
-
CONFIG["host_cpu"] = "i386"
|
63
|
-
CONFIG["host_vendor"] = "pc"
|
64
|
-
CONFIG["host_os"] = "mingw32"
|
65
|
-
CONFIG["target"] = "i386-pc-mingw32"
|
66
|
-
CONFIG["target_cpu"] = "i386"
|
67
|
-
CONFIG["target_vendor"] = "pc"
|
68
|
-
CONFIG["target_os"] = "mingw32"
|
69
|
-
CONFIG["CC"] = "i386-mingw32-gcc"
|
70
|
-
CONFIG["CFLAGS"] = "-g -O2 "
|
71
|
-
CONFIG["LDFLAGS"] = "-L. "
|
72
|
-
CONFIG["CPPFLAGS"] = " $(DEFS)"
|
73
|
-
CONFIG["OBJEXT"] = "o"
|
74
|
-
CONFIG["CPP"] = "i386-mingw32-gcc -E"
|
75
|
-
CONFIG["GREP"] = "/usr/bin/grep"
|
76
|
-
CONFIG["EGREP"] = "/usr/bin/grep -E"
|
77
|
-
CONFIG["GNU_LD"] = "yes"
|
78
|
-
CONFIG["CPPOUTFILE"] = "-o conftest.i"
|
79
|
-
CONFIG["OUTFLAG"] = "-o "
|
80
|
-
CONFIG["YACC"] = "bison -y"
|
81
|
-
CONFIG["YFLAGS"] = ""
|
82
|
-
CONFIG["RANLIB"] = "i386-mingw32-ranlib"
|
83
|
-
CONFIG["AR"] = "i386-mingw32-ar"
|
84
|
-
CONFIG["AS"] = "i386-mingw32-as"
|
85
|
-
CONFIG["ASFLAGS"] = ""
|
86
|
-
CONFIG["NM"] = "i386-mingw32-nm"
|
87
|
-
CONFIG["WINDRES"] = "i386-mingw32-windres"
|
88
|
-
CONFIG["DLLWRAP"] = "i386-mingw32-dllwrap"
|
89
|
-
CONFIG["OBJDUMP"] = "i386-mingw32-objdump"
|
90
|
-
CONFIG["LN_S"] = "ln -s"
|
91
|
-
CONFIG["SET_MAKE"] = ""
|
92
|
-
CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
|
93
|
-
CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
|
94
|
-
CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
|
95
|
-
CONFIG["RM"] = "rm -f"
|
96
|
-
CONFIG["CP"] = "cp"
|
97
|
-
CONFIG["MAKEDIRS"] = "mkdir -p"
|
98
|
-
CONFIG["ALLOCA"] = ""
|
99
|
-
CONFIG["DLDFLAGS"] = " -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
|
100
|
-
CONFIG["ARCH_FLAG"] = ""
|
101
|
-
CONFIG["STATIC"] = ""
|
102
|
-
CONFIG["CCDLFLAGS"] = ""
|
103
|
-
CONFIG["LDSHARED"] = "i386-mingw32-gcc -shared -s"
|
104
|
-
CONFIG["DLEXT"] = "so"
|
105
|
-
CONFIG["DLEXT2"] = "dll"
|
106
|
-
CONFIG["LIBEXT"] = "a"
|
107
|
-
CONFIG["LINK_SO"] = ""
|
108
|
-
CONFIG["LIBPATHFLAG"] = " -L%s"
|
109
|
-
CONFIG["RPATHFLAG"] = ""
|
110
|
-
CONFIG["LIBPATHENV"] = ""
|
111
|
-
CONFIG["TRY_LINK"] = ""
|
112
|
-
CONFIG["STRIP"] = "strip"
|
113
|
-
CONFIG["EXTSTATIC"] = ""
|
114
|
-
CONFIG["setup"] = "Setup"
|
115
|
-
CONFIG["MINIRUBY"] = "ruby -I/Users/jeremy/.rake-compiler/builds/ruby-1.8.6-p287 -rfake"
|
116
|
-
CONFIG["PREP"] = "fake.rb"
|
117
|
-
CONFIG["RUNRUBY"] = "$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`"
|
118
|
-
CONFIG["EXTOUT"] = ".ext"
|
119
|
-
CONFIG["ARCHFILE"] = ""
|
120
|
-
CONFIG["RDOCTARGET"] = ""
|
121
|
-
CONFIG["XCFLAGS"] = " -DRUBY_EXPORT"
|
122
|
-
CONFIG["XLDFLAGS"] = " -Wl,--stack,0x02000000"
|
123
|
-
CONFIG["LIBRUBY_LDSHARED"] = "i386-mingw32-gcc -shared -s"
|
124
|
-
CONFIG["LIBRUBY_DLDFLAGS"] = " -Wl,--enable-auto-image-base,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBRUBY)"
|
125
|
-
CONFIG["rubyw_install_name"] = "rubyw"
|
126
|
-
CONFIG["RUBYW_INSTALL_NAME"] = "rubyw"
|
127
|
-
CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
|
128
|
-
CONFIG["LIBRUBY_SO"] = "$(RUBY_SO_NAME).dll"
|
129
|
-
CONFIG["LIBRUBY_ALIASES"] = ""
|
130
|
-
CONFIG["LIBRUBY"] = "lib$(LIBRUBY_SO).a"
|
131
|
-
CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
|
132
|
-
CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static"
|
133
|
-
CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME)"
|
134
|
-
CONFIG["SOLIBS"] = "$(LIBS)"
|
135
|
-
CONFIG["DLDLIBS"] = ""
|
136
|
-
CONFIG["ENABLE_SHARED"] = "yes"
|
137
|
-
CONFIG["MAINLIBS"] = ""
|
138
|
-
CONFIG["COMMON_LIBS"] = "m"
|
139
|
-
CONFIG["COMMON_MACROS"] = ""
|
140
|
-
CONFIG["COMMON_HEADERS"] = "windows.h winsock.h"
|
141
|
-
CONFIG["EXPORT_PREFIX"] = ""
|
142
|
-
CONFIG["MAKEFILES"] = "Makefile GNUmakefile"
|
143
|
-
CONFIG["arch"] = "i386-mingw32"
|
144
|
-
CONFIG["sitearch"] = "i386-msvcrt"
|
145
|
-
CONFIG["sitedir"] = "$(prefix)/lib/ruby/site_ruby"
|
146
|
-
CONFIG["configure_args"] = " '--target=i386-mingw32' '--host=i386-mingw32' '--build=i686-linux' '--enable-shared' '--disable-install-doc' '--without-tk' '--without-tcl' '--prefix=/Users/jeremy/.rake-compiler/ruby/ruby-1.8.6-p287' 'build_alias=i686-linux' 'host_alias=i386-mingw32' 'target_alias=i386-mingw32'"
|
147
|
-
CONFIG["NROFF"] = "/usr/bin/nroff"
|
148
|
-
CONFIG["MANTYPE"] = "doc"
|
149
|
-
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
|
150
|
-
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
|
151
|
-
CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
|
152
|
-
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
|
153
|
-
CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
|
154
|
-
CONFIG["topdir"] = File.dirname(__FILE__)
|
155
|
-
MAKEFILE_CONFIG = {}
|
156
|
-
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
|
157
|
-
def Config::expand(val, config = CONFIG)
|
158
|
-
val.gsub!(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) do |var|
|
159
|
-
if !(v = $1 || $2)
|
160
|
-
'$'
|
161
|
-
elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
|
162
|
-
pat, sub = $1, $2
|
163
|
-
config[v] = false
|
164
|
-
Config::expand(key, config)
|
165
|
-
config[v] = key
|
166
|
-
key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
|
167
|
-
key
|
168
|
-
else
|
169
|
-
var
|
170
|
-
end
|
171
|
-
end
|
172
|
-
val
|
173
|
-
end
|
174
|
-
CONFIG.each_value do |val|
|
175
|
-
Config::expand(val)
|
176
|
-
end
|
177
|
-
end
|
178
|
-
RbConfig = Config # compatibility for ruby-1.9
|
179
|
-
CROSS_COMPILING = nil unless defined? CROSS_COMPILING
|