diff options
| author | Remko Tronçon <git@el-tramo.be> | 2010-10-28 20:30:33 (GMT) | 
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2010-10-28 20:30:33 (GMT) | 
| commit | c3ce666e17edea2c67afc1ea282bf22c7345b978 (patch) | |
| tree | db8daed172bafedde0ea561a1cd2f8479d258f3e | |
| parent | 4e23da619f05c8f47b774c36e6645659203cb6d1 (diff) | |
| download | swift-contrib-c3ce666e17edea2c67afc1ea282bf22c7345b978.zip swift-contrib-c3ce666e17edea2c67afc1ea282bf22c7345b978.tar.bz2 | |
Added boost prefix flag.
| -rw-r--r-- | BuildTools/SCons/SConstruct | 38 | 
1 files changed, 26 insertions, 12 deletions
| diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index 5d2f383..23bd973 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -34,6 +34,7 @@ if os.name == "nt" :  if os.name == "nt" :  	vars.Add(PackageVariable("bonjour", "Bonjour SDK location", "yes"))  vars.Add(PackageVariable("openssl", "OpenSSL location", "yes")) +vars.Add(PackageVariable("boost", "Boost location location", "yes"))  vars.Add(PathVariable("qt", "Qt location", "", PathVariable.PathAccept))  vars.Add(PathVariable("docbook_xml", "DocBook XML", None, PathVariable.PathAccept))  vars.Add(PathVariable("docbook_xsl", "DocBook XSL", None, PathVariable.PathAccept)) @@ -313,40 +314,53 @@ if conf.CheckCHeader("idna.h") and conf.CheckLib("idn") :  else :  	env["LIBIDN_BUNDLED"] = 1 +# Avahi +if env["PLATFORM"] != "darwin" : +	if conf.CheckCHeader("avahi-client/client.h") and conf.CheckLib("avahi-client") and conf.CheckLib("avahi-common") : +		env["HAVE_AVAHI"] = True +		env["AVAHI_FLAGS"] = { "LIBS": ["avahi-client", "avahi-common"] } + +conf.Finish() +  # Boost +env["BOOST_FLAGS"] = {} +boost_prefix = env.get("boost", None) +if boost_prefix : +	env["BOOST_FLAGS"]["CPPPATH"] = [os.path.join(boost_prefix, "include")] +	env["BOOST_FLAGS"]["LIBPATH"] = [os.path.join(boost_prefix, "lib")] +boost_env = conf_env.Clone() +boost_env.MergeFlags(env["BOOST_FLAGS"]) +boost_conf = Configure(boost_env)  boostLibs = [("signals", None), ("thread", None), ("regex", None), ("program_options", None), ("filesystem", None), ("system", "system/system_error.hpp"), ("date_time", "date_time/date.hpp")]  allLibsPresent = True  libNames = []  for (lib, header) in boostLibs : +	# Check if we find the header  	if header :  		header = "boost/" + header  	else :  		header = "boost/" + lib + ".hpp" -	if not conf.CheckCXXHeader(header) : +	if not boost_conf.CheckCXXHeader(header) :  		allLibsPresent = False  		break + +	# Check if we find the lib  	libName = "boost_" + lib -	if not conf.CheckLib(libName) : +	if not boost_conf.CheckLib(libName) :  		libName += "-mt" -		if not conf.CheckLib(libName) : +		if not boost_conf.CheckLib(libName) :  			allLibsPresent = False  			break  	libNames.append(libName)  if allLibsPresent : -	env["BOOST_FLAGS"] = { "LIBS": libNames } -	if not conf.CheckCXXHeader("boost/uuid/uuid.hpp") : +	env["BOOST_FLAGS"]["LIBS"] = libNames +	if not boost_conf.CheckCXXHeader("boost/uuid/uuid.hpp") :  		# FIXME: Remove this workaround when UUID is available in most distros  		env["BOOST_BUNDLED_UUID_ONLY"] = True  else :  	env["BOOST_BUNDLED"] = True +boost_conf.Finish() -# Avahi -if env["PLATFORM"] != "darwin" : -	if conf.CheckCHeader("avahi-client/client.h") and conf.CheckLib("avahi-client") and conf.CheckLib("avahi-common") : -		env["HAVE_AVAHI"] = True -		env["AVAHI_FLAGS"] = { "LIBS": ["avahi-client", "avahi-common"] } - -conf.Finish()  # Xss  env["HAVE_XSS"] = 0 | 
 Swift
 Swift