[Groonga-commit] ranguba/rroonga at e2476cd [master] Use gmake if it's available

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Sep 23 15:57:29 JST 2015


Kouhei Sutou	2015-09-23 15:57:29 +0900 (Wed, 23 Sep 2015)

  New Revision: e2476cdff5f847b779ce9b0da6a9291b01135655
  https://github.com/ranguba/rroonga/commit/e2476cdff5f847b779ce9b0da6a9291b01135655

  Message:
    Use gmake if it's available

  Modified files:
    ext/groonga/extconf.rb

  Modified: ext/groonga/extconf.rb (+17 -2)
===================================================================
--- ext/groonga/extconf.rb    2015-09-11 12:55:08 +0900 (17187d9)
+++ ext/groonga/extconf.rb    2015-09-23 15:57:29 +0900 (3d09bdb)
@@ -162,6 +162,20 @@ def configure_command_line(prefix)
   escaped_command_line.join(" ")
 end
 
+def guess_make
+  env_make = ENV["MAKE"]
+  return env_make if env_make
+
+  candidates = ["gmake", "make"]
+  candidates.each do |candidate|
+    (ENV["PATH"] || "").split(File::PATH_SEPARATOR).each do |path|
+      return candidate if File.executable?(File.join(path, candidate))
+    end
+  end
+
+  "make"
+end
+
 def n_processors
   proc_file = "/proc/cpuinfo"
   if File.exist?(proc_file)
@@ -174,12 +188,13 @@ def n_processors
 end
 
 def install_for_gnu_build_system(install_dir)
+  make = guess_make
   run_command("configuring...",
               configure_command_line(install_dir))
   run_command("building (maybe long time)...",
-              "make -j#{n_processors}")
+              "#{make} -j#{n_processors}")
   run_command("installing...",
-              "make install")
+              "#{make} install")
 end
 
 def build_groonga_from_git(major, minor, micro)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index