You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/07/01 01:31:35 UTC

[lucy-commits] svn commit: r1141750 - /incubator/lucy/trunk/ruby/Rakefile

Author: marvin
Date: Thu Jun 30 23:31:35 2011
New Revision: 1141750

URL: http://svn.apache.org/viewvc?rev=1141750&view=rev
Log:
Adapt Ruby build to new names for Charmonizer Windows Makefiles.

Modified:
    incubator/lucy/trunk/ruby/Rakefile

Modified: incubator/lucy/trunk/ruby/Rakefile
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/ruby/Rakefile?rev=1141750&r1=1141749&r2=1141750&view=diff
==============================================================================
--- incubator/lucy/trunk/ruby/Rakefile (original)
+++ incubator/lucy/trunk/ruby/Rakefile Thu Jun 30 23:31:35 2011
@@ -28,6 +28,23 @@ def cc_command
   RbConfig::CONFIG["CC"]
 end
 
+def make_command
+  command = RbConfig::CONFIG["make-prog"]
+  if !command
+    if RUBY_PLATFORM =~ /mswin/i
+      cc = cc_command
+      if cc =~ /^cl\b/
+        command = "nmake"
+      else
+        command = "dmake"
+      end
+    end
+  else
+    command = "make"
+  end
+  return command
+end
+
 def extra_ccflags
   ""
 end
@@ -43,14 +60,14 @@ def run_make(dir, params)
   chdir(dir) if dir
   command = params.clone
   command.unshift("CC=#{cc_command}")
-  if cc_command =~ /^cl\b/ 
-    if File.exists?("Makefile.win")
-      command.unshift("-f", "Makefile.win")
+  if RUBY_PLATFORM =~ /mswin/i
+    if cc_command =~ /^cl\b/ 
+      command.unshift("-f", "Makefile.MSVC")
+    else
+      command.unshift("-f", "Makefile.MinGW")
     end
-    command.unshift("nmake")
-  else
-    command.unshift("make")
   end
+  command.unshift(make_command)
   success = system(*command)
   if !success
     raise "Make failed"