boost: enable single/multi/shared/static libs.

* Add option to disable single threading variant.
* Add option to disable static library variant.
* Drop unneeded "--with-system-layout" option.

Closes Homebrew/homebrew#21298.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Xiyue Deng 2013-07-17 22:17:45 -07:00 committed by Mike McQuaid
parent 38ae3b260a
commit 34b371fb51

View file

@ -31,7 +31,8 @@ class Boost < Formula
option :universal
option 'with-icu', 'Build regexp engine with icu support'
option 'with-c++11', 'Compile using Clang, std=c++11 and stdlib=libc++' if MacOS.version >= :lion
option 'use-system-layout', 'Use system layout instead of tagged'
option 'without-single', 'Disable building single-threading variant'
option 'without-static', 'Disable building static library variant'
depends_on :python => :recommended
depends_on UniversalPython if build.universal? and build.with? "python"
@ -113,16 +114,26 @@ class Boost < Formula
# on such systems.
bargs << "--without-libraries=log" if MacOS.version <= :snow_leopard
boost_layout = (build.include? "use-system-layout") ? "system" : "tagged"
args = ["--prefix=#{prefix}",
"--libdir=#{lib}",
"-d2",
"-j#{ENV.make_jobs}",
"--layout=#{boost_layout}",
"--layout=tagged",
"--user-config=user-config.jam",
"threading=multi",
"install"]
if build.include? 'without-single'
args << "threading=multi"
else
args << "threading=multi,single"
end
if build.include? 'without-static'
args << "link=shared"
else
args << "link=shared,static"
end
if MacOS.version >= :lion and build.with? 'c++11'
args << "toolset=clang" << "cxxflags=-std=c++11"
args << "cxxflags=-stdlib=libc++" << "cxxflags=-fPIC"