summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-06 13:21:27 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-06 14:48:58 (GMT)
commit37e576b9980c0edc0eee2d5bb691f0a353a62b60 (patch)
treea227fb957a9805a352c9789fef9362bc0692bbad /BuildTools
parent63a8085f02218d2dd2b51acf29280624d6317610 (diff)
downloadswift-contrib-37e576b9980c0edc0eee2d5bb691f0a353a62b60.zip
swift-contrib-37e576b9980c0edc0eee2d5bb691f0a353a62b60.tar.bz2
Added Expat configuration flags.
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConstruct27
1 files changed, 21 insertions, 6 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 11bd0b1..136c7ed 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -34,7 +34,9 @@ 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(PackageVariable("boost", "Boost location", "yes"))
+vars.Add(PathVariable("expat_libdir", "Expat library location", None, PathVariable.PathAccept))
+vars.Add(PathVariable("expat_includedir", "Expat headers location", None, PathVariable.PathAccept))
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))
@@ -454,11 +456,24 @@ if not env.get("HAVE_LIBXML", 0) :
conf.Finish()
# Expat
-conf = Configure(conf_env)
-if not env.get("HAVE_LIBXML",0) and conf.CheckCHeader("expat.h") and conf.CheckLib("expat") :
- env["HAVE_EXPAT"] = 1
- env["EXPAT_FLAGS"] = { "LIBS": ["expat"] }
-conf.Finish()
+if not env.get("HAVE_LIBXML",0) :
+ expat_conf_env = conf_env.Clone()
+ expat_flags = {}
+ if env.get("expat_libdir", None) :
+ expat_flags["LIBPATH"] = [env["expat_libdir"]]
+ if env.get("expat_includedir", None) :
+ expat_flags["CPPPATH"] = [env["expat_includedir"]]
+ if env["PLATFORM"] == "win32" :
+ expat_libname = "libexpat"
+ else :
+ expat_libname = "expat"
+ expat_conf_env.MergeFlags(expat_flags)
+ conf = Configure(expat_conf_env)
+ if conf.CheckCHeader("expat.h") and conf.CheckLib(expat_libname) :
+ env["HAVE_EXPAT"] = 1
+ env["EXPAT_FLAGS"] = { "LIBS": [expat_libname] }
+ env["EXPAT_FLAGS"].update(expat_flags)
+ conf.Finish()
# Bundled expat
bundledExpat = False