summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-09 13:59:17 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-09 15:31:25 (GMT)
commitc7a403abc7887fb692f7325e88638352dcbd852d (patch)
treed095d50947343d2448ad1235540bbb52962e83ee /BuildTools/SCons/SConstruct
parent02f7f0d98e937d8ec2d527ac701daf783bb37f27 (diff)
downloadswift-contrib-c7a403abc7887fb692f7325e88638352dcbd852d.zip
swift-contrib-c7a403abc7887fb692f7325e88638352dcbd852d.tar.bz2
Allow giving paths to hunspell
Diffstat (limited to 'BuildTools/SCons/SConstruct')
-rw-r--r--BuildTools/SCons/SConstruct16
1 files changed, 12 insertions, 4 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index ce3b020..c03ae4f 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -419,12 +419,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" :