Permalink
Browse files

Fix build on systems where make is not a GNU make.

  • Loading branch information...
1 parent a4c7326 commit 16c7a4b8f2b97d7213df4180e0d5e047aba9a7be @stass committed Jul 7, 2012
Showing with 12 additions and 2 deletions.
  1. +6 −1 Rakefile
  2. +6 −1 ext/hiredis_ext/extconf.rb
View
@@ -18,7 +18,12 @@ unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
if !File.directory?("vendor/hiredis/.git")
system("git submodule update --init")
end
- system("cd vendor/hiredis && make clean")
+ gnu_make = system("make --version 2>/dev/null | grep 'GNU Make' > /dev/null")
+ if gnu_make
+ system("cd vendor/hiredis && make clean")
+ else
+ system("cd vendor/hiredis && gmake clean")
+ end
end
end
@@ -9,7 +9,12 @@
end
# Make sure hiredis is built...
-system("cd #{hiredis_dir} && make static")
+gnu_make = system("make --version 2>/dev/null | grep 'GNU Make' > /dev/null")
+if gnu_make
+ system("cd #{hiredis_dir} && make static")
+else
+ system("cd #{hiredis_dir} && gmake static")
+end
# Statically link to hiredis (mkmf can't do this for us)
$CFLAGS << " -I#{hiredis_dir}"

0 comments on commit 16c7a4b

Please sign in to comment.