summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-12-08 17:48:49 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-12-08 17:50:03 (GMT)
commit5349e609e1ee23549a390e3ef85f2e9964dd0ef9 (patch)
tree58348547cd0e47004a329f4704b47543fae14c32 /BuildTools/SCons
parent52d662ac5390dbf269eb69ec039d2264925fa04b (diff)
downloadswift-contrib-5349e609e1ee23549a390e3ef85f2e9964dd0ef9.zip
swift-contrib-5349e609e1ee23549a390e3ef85f2e9964dd0ef9.tar.bz2
Added LibIDN include/libflags.
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/SConstruct26
1 files changed, 20 insertions, 6 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index bdb7d48..75129b7 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -39,6 +39,9 @@ vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariab
vars.Add(PathVariable("expat_includedir", "Expat headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("expat_libdir", "Expat library location", None, PathVariable.PathAccept))
vars.Add("expat_libname", "Expat library name", "libexpat" if os.name == "nt" else "expat")
+vars.Add(PathVariable("libidn_includedir", "LibIDN headers location", None, PathVariable.PathAccept))
+vars.Add(PathVariable("libidn_libdir", "LibIDN library location", None, PathVariable.PathAccept))
+vars.Add("libidn_libname", "LibIDN library name", "libidn" if os.name == "nt" else "idn")
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))
@@ -318,12 +321,6 @@ if conf.CheckLib("c") :
if conf.CheckLib("stdc++") :
env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["stdc++"]
-# LibIDN
-if conf.CheckCHeader("idna.h") and conf.CheckLib("idn") :
- env["LIBIDN_FLAGS"] = { "LIBS": ["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") :
@@ -463,6 +460,23 @@ if not env.get("HAVE_EXPAT", 0) and not env.get("HAVE_LIBXML", 0) :
env["HAVE_EXPAT"] = 1
env["EXPAT_BUNDLED"] = True
+# LibIDN
+libidn_conf_env = conf_env.Clone()
+libidn_flags = {}
+if env.get("libidn_libdir", None) :
+ libidn_flags["LIBPATH"] = [env["libidn_libdir"]]
+if env.get("libidn_includedir", None) :
+ libidn_flags["CPPPATH"] = [env["libidn_includedir"]]
+libidn_conf_env.MergeFlags(libidn_flags)
+conf = Configure(libidn_conf_env)
+if conf.CheckCHeader("idna.h") and conf.CheckLib(env["libidn_libname"]) :
+ env["HAVE_LIBIDN"] = 1
+ env["LIBIDN_FLAGS"] = { "LIBS": [env["libidn_libname"]] }
+ env["LIBIDN_FLAGS"].update(libidn_flags)
+else :
+ env["LIBIDN_BUNDLED"] = 1
+conf.Finish()
+
# Qt
if env["qt"] :
env["QTDIR"] = env["qt"]