aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorNikolaus Demmel2014-02-27 09:10:05 +0000
committerMike McQuaid2014-02-27 09:11:17 +0000
commit2311fe2b2c5adf4904a5a01c864c1e18bdf9c9ba (patch)
treed13fbc6fb7df4f1a12838dc923f2dcf77ad38c95 /Library
parent1f1fcd225960d680881139a69f11c1aba9188402 (diff)
downloadhomebrew-2311fe2b2c5adf4904a5a01c864c1e18bdf9c9ba.tar.bz2
mongodb: libc++, boost, --full support.
* On 10.9, use libc++ (not libstdc++) for devel and HEAD builds * Pass --full flag to install headers and library also. * Add option --with-boost, to pass --use-system-boost to scons (avoid linking issues with the created library). Closes #25253. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/mongodb.rb34
1 files changed, 29 insertions, 5 deletions
diff --git a/Library/Formula/mongodb.rb b/Library/Formula/mongodb.rb
index cf2737ed7..cb56432aa 100644
--- a/Library/Formula/mongodb.rb
+++ b/Library/Formula/mongodb.rb
@@ -27,18 +27,42 @@ class Mongodb < Formula
end
end
+ # When 2.6 is released this conditional can be removed.
+ if MacOS.version < :mavericks || !build.stable?
+ option "with-boost", "Compile using installed boost, not the version shipped with mongodb"
+ depends_on "boost" => :optional
+ end
+
depends_on 'scons' => :build
depends_on 'openssl' => :optional
def install
- # mongodb currently can't build with libc++; this should be fixed in
- # 2.6, but can't be backported to the current stable release.
- ENV.cxx += ' -stdlib=libstdc++' if ENV.compiler == :clang && MacOS.version >= :mavericks
-
args = ["--prefix=#{prefix}", "-j#{ENV.make_jobs}"]
+
+ cxx = ENV.cxx
+ if ENV.compiler == :clang && MacOS.version >= :mavericks
+ if build.stable?
+ # When 2.6 is released this cxx hack can be removed
+ # ENV.append "CXXFLAGS", "-stdlib=libstdc++" does not work with scons
+ # so use this hack of appending the flag to the --cxx parameter of the sconscript.
+ # mongodb 2.4 can't build with libc++, but defaults to it on Mavericks
+ cxx += " -stdlib=libstdc++"
+ else
+ # build devel and HEAD version on Mavericks with libc++
+ # Use --osx-version-min=10.9 such that the compiler defaults to libc++.
+ # Upstream issue discussing the default flags:
+ # https://jira.mongodb.org/browse/SERVER-12682
+ args << "--osx-version-min=10.9"
+ end
+ end
+
args << '--64' if MacOS.prefer_64_bit?
args << "--cc=#{ENV.cc}"
- args << "--cxx=#{ENV.cxx}"
+ args << "--cxx=#{cxx}"
+
+ # --full installs development headers and client library, not just binaries
+ args << "--full"
+ args << "--use-system-boost" if build.with? "boost"
if build.with? 'openssl'
args << '--ssl'