Skip to content

Commit

Permalink
redis: add jemalloc option.
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#40984.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
tzudot authored and MikeMcQuaid committed Jun 25, 2015
1 parent fa56400 commit ddfa01c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Formula/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Redis < Formula
sha256 "54bda6925b7258c6dbcd8134fbb64a3feae09d1c0de1fedae7925a524ee1befe" => :mountain_lion
end

option "with-jemalloc", "Select jemalloc as memory allocator when building Redis"

head "https://github.com/antirez/redis.git", :branch => "unstable"

fails_with :llvm do
Expand All @@ -22,7 +24,12 @@ def install
# Architecture isn't detected correctly on 32bit Snow Leopard without help
ENV["OBJARCH"] = "-arch #{MacOS.preferred_arch}"

system "make", "install", "PREFIX=#{prefix}", "CC=#{ENV.cc}"
args = %W[
PREFIX=#{prefix}
CC=#{ENV.cc}
]
args << "MALLOC=jemalloc" if build.with? "jemalloc"
system "make", "install", *args

%w[run db/redis log].each { |p| (var+p).mkpath }

Expand Down

0 comments on commit ddfa01c

Please sign in to comment.