summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-09 13:59:17 (GMT)
committervlad <vlad@tyrion.(none)>2012-10-13 13:55:45 (GMT)
commitb3948434495a18df5c4537a2a6e0feecc0805788 (patch)
tree4e1eb516199b94ca96b0cc6f9fca8f65b242ccec
parentafdb2b3a61695b42162d09189d083e728da0c74f (diff)
downloadswift-contrib-b3948434495a18df5c4537a2a6e0feecc0805788.zip
swift-contrib-b3948434495a18df5c4537a2a6e0feecc0805788.tar.bz2
Allow giving paths to hunspell
-rw-r--r--BuildTools/SCons/SConscript.boot1
-rw-r--r--BuildTools/SCons/SConstruct16
2 files changed, 13 insertions, 4 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index 361004f..6f94211 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -38,6 +38,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("hunspell", "Hunspell location", False))
vars.Add(PathVariable("boost_includedir", "Boost headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariable.PathAccept))
vars.Add(PathVariable("expat_includedir", "Expat headers location", None, PathVariable.PathAccept))
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 669c599..79e2f6d 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -446,12 +446,20 @@ else :
openssl_conf.Finish()
#Hunspell
+hunspell_env = conf_env.Clone()
+hunspell_prefix = env["hunspell"] if isinstance(env.get("hunspell", False), str) else ""
+hunspell_flags = {}
+if hunspell_prefix :
+ hunspell_flags = {"CPPPATH":[os.path.join(hunspell_prefix, "include")], "LIBPATH":[os.path.join(hunspell_prefix, "lib")]}
+hunspell_env.MergeFlags(hunspell_flags)
+
env["HAVE_HUNSPELL"] = 0;
-conf = Configure(conf_env.Clone())
-if conf.CheckCXXHeader("hunspell/hunspell.hxx") and conf.CheckLib("hunspell-1.3") :
+hunspell_conf = Configure(hunspell_env)
+if hunspell_conf.CheckCXXHeader("hunspell/hunspell.hxx") and hunspell_conf.CheckLib("hunspell-1.3") :
env["HAVE_HUNSPELL"] = 1
- env["HUNSPELL_FLAGS"] = {"LIBS": ["hunspell-1.3"]}
-
+ hunspell_flags["LIBS"] = ["hunspell-1.3"]
+ env["HUNSPELL_FLAGS"] = hunspell_flags
+hunspell_conf.Finish()
# Bonjour
if env["PLATFORM"] == "darwin" :