Added config check for gzip support in boost iostreams.
This commit is contained in:
parent
8389fc9078
commit
dbb0f1de86
2 changed files with 32 additions and 1 deletions
|
@ -201,6 +201,7 @@ if env["prereqs"]:
|
|||
LIBS = ["intl"])
|
||||
conf.CheckCPlusPlus(gcc_version = "3.3") and \
|
||||
conf.CheckBoost("iostreams", require_version = "1.33.0") and \
|
||||
conf.CheckBoostIostreamsGZip() and \
|
||||
conf.CheckBoost("smart_ptr", header_only = True) and \
|
||||
conf.CheckCHeader("libintl.h", "<>") and \
|
||||
conf.CheckSDL(require_version = '1.2.7') or Die("Base prerequisites are not met.")
|
||||
|
|
|
@ -96,4 +96,34 @@ def CheckBoost(context, boost_lib, require_version = None, header_only = False):
|
|||
env.Replace(**backup)
|
||||
return False
|
||||
|
||||
config_checks = { "CheckBoost" : CheckBoost }
|
||||
def CheckBoostIostreamsGZip(context):
|
||||
env = context.env
|
||||
backup = env.Clone().Dictionary()
|
||||
|
||||
context.Message("Checking for gzip support in Boost Iostreams... ")
|
||||
test_program = """
|
||||
#include <boost/iostreams/filtering_stream.hpp>
|
||||
#include <boost/iostreams/filter/gzip.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::iostreams::filtering_stream<boost::iostreams::output> filter;
|
||||
filter.push(boost::iostreams::gzip_compressor(boost::iostreams::gzip_params()));
|
||||
}
|
||||
\n"""
|
||||
|
||||
for zlib in ["", "z"]:
|
||||
env.Append(LIBS = [zlib])
|
||||
comment = ""
|
||||
if zlib:
|
||||
comment = " //Trying to link against '%s'.\n" % zlib
|
||||
if context.TryLink(comment + test_program, ".cpp"):
|
||||
context.Result("yes")
|
||||
return True
|
||||
else:
|
||||
env.Replace(**backup)
|
||||
|
||||
context.Result("no")
|
||||
return False
|
||||
|
||||
config_checks = { "CheckBoost" : CheckBoost, "CheckBoostIostreamsGZip" : CheckBoostIostreamsGZip }
|
||||
|
|
Loading…
Add table
Reference in a new issue