Package: ruby-mkrf / 0.2.3+dfsg-5

0500_replace_config_by_rbconfig.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Description: Replace deprecated Config:: by RbConfig::
Author: C├ędric Boutillier <cedric.boutillier@gmail.com>
Last-Update: 2012-07-04

--- a/lib/mkrf/availability.rb
+++ b/lib/mkrf/availability.rb
@@ -10,14 +10,14 @@
   # on the current system.
   class Availability
     # ruby 1.9+
-    if Config::CONFIG['rubyhdrdir']
-      DEFAULT_INCLUDES = [Config::CONFIG['rubyhdrdir'],
-                          Config::CONFIG['rubyhdrdir'] + "/" + Config::CONFIG['arch'],
-                          Config::CONFIG["archdir"],Config::CONFIG['sitelibdir'], "."]
+    if RbConfig::CONFIG['rubyhdrdir']
+      DEFAULT_INCLUDES = [RbConfig::CONFIG['rubyhdrdir'],
+                          RbConfig::CONFIG['rubyhdrdir'] + "/" + RbConfig::CONFIG['arch'],
+                          RbConfig::CONFIG["archdir"],RbConfig::CONFIG['sitelibdir'], "."]
 
     else
-      DEFAULT_INCLUDES = [Config::CONFIG['includedir'], Config::CONFIG["archdir"],
-                          Config::CONFIG['sitelibdir'], "."]
+      DEFAULT_INCLUDES = [RbConfig::CONFIG['includedir'], RbConfig::CONFIG["archdir"],
+                          RbConfig::CONFIG['sitelibdir'], "."]
     end
                         
     # These really shouldn't be static like this..
@@ -35,11 +35,11 @@
     # * <tt>:compiler</tt> -- which compiler to use when determining availability
     # * <tt>:includes</tt> -- directories that should be searched for include files
     def initialize(options = {})      
-      @loaded_libs = [(options[:loaded_libs] || Config::CONFIG["LIBS"].gsub('-l', '').split)].flatten
+      @loaded_libs = [(options[:loaded_libs] || RbConfig::CONFIG["LIBS"].gsub('-l', '').split)].flatten
       @library_paths = [(options[:library_paths] || [])].flatten
       # Not sure what COMMON_HEADERS looks like when populated
-      @headers = options[:headers] || [] # Config::CONFIG["COMMON_HEADERS"]
-      @compiler = options[:compiler] || Config::CONFIG["CC"]
+      @headers = options[:headers] || [] # RbConfig::CONFIG["COMMON_HEADERS"]
+      @compiler = options[:compiler] || RbConfig::CONFIG["CC"]
       @includes = [(options[:includes] || DEFAULT_INCLUDES)].flatten
       @logger = Logger.new('mkrf.log')
       @defines = []
@@ -167,7 +167,7 @@
       if RUBY_PLATFORM =~ /mswin/
         "link -nologo -incremental:no -debug -opt:ref -opt:icf -dll"
       else
-        Config::CONFIG['LDSHARED']
+        RbConfig::CONFIG['LDSHARED']
       end
     end
 
--- a/lib/mkrf/generator.rb
+++ b/lib/mkrf/generator.rb
@@ -40,7 +40,7 @@
   class Generator
     include Rake
     
-    CONFIG = Config::CONFIG
+    CONFIG = RbConfig::CONFIG
     
     # Any extra code, given as a string, to be appended to the Rakefile.
     attr_accessor :additional_code
--- a/lib/mkrf/rakehelper.rb
+++ b/lib/mkrf/rakehelper.rb
@@ -41,7 +41,7 @@
 
 def setup_extension(dir, extension)
   ext = "ext/#{dir}"
-  ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
+  ext_so = "#{ext}/#{extension}.#{RbConfig::CONFIG['DLEXT']}"
   ext_files = FileList[
     "#{ext}/*.c",
     "#{ext}/*.h",