summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2013-03-30 09:14:43 (GMT)
committerKevin Smith <git@kismith.co.uk>2013-03-30 11:46:04 (GMT)
commit2d7a63e9323f03edd72668f582e894ab64ab4023 (patch)
tree97a52c423ef831e560e55628a07d9db9c8935f49 /BuildTools/SCons/SConstruct
parent497b647fe034a3d2cdc6d75ce0ff70e3df3aaf04 (diff)
downloadswift-2d7a63e9323f03edd72668f582e894ab64ab4023.zip
swift-2d7a63e9323f03edd72668f582e894ab64ab4023.tar.bz2
Making stuff build against non-bundled libraries
Change-Id: I2c00de607e204f7d2c474aa9d4c18cde86d575ec
Diffstat (limited to 'BuildTools/SCons/SConstruct')
-rw-r--r--BuildTools/SCons/SConstruct48
1 files changed, 34 insertions, 14 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 698217f..1de598f 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -335,25 +335,45 @@ if not env.get("HAVE_ICU", False) and not env.get("HAVE_LIBIDN", False) :
# LibMiniUPnPc
if env["experimental"] :
- #libminiupnpc_conf_env = conf_env.Clone()
- #conf = Configure(libminiupnpc_conf_env)
- #if conf.CheckCHeader("miniupnpc.h") and conf.CheckLib(env["libminiupnpc_libname"]) :
- # print "NOT IMPLEMENTED YET"
- #else :
- env["LIBMINIUPNPC_BUNDLED"] = 1
- #conf.Finish()
+ libminiupnpc_flags = {"CPPPATH": ["/usr/include/miniupnpc/"]}
+ libminiupnpc_conf_env = conf_env.Clone()
+ if env.get("libminiupnpc_libdir", None) :
+ libminiupnpc_flags["LIBPATH"] = [env["libminiupnpc_libdir"]]
+ if env.get("libminiupnpc_includedir", None) :
+ libminiupnpc_flags["CPPPATH"] = [env["libminiupnpc_includedir"]]
+ libminiupnpc_conf_env.MergeFlags(libminiupnpc_flags)
+ conf = Configure(libminiupnpc_conf_env)
+ if conf.CheckCHeader("miniupnpc.h") and conf.CheckLib(env["libminiupnpc_libname"]) and False :
+ # ^ False because APIs aren't stable
+ env["HAVE_LIBMINIUPNPC"] = 1
+ env["LIBMINIUPNPC_FLAGS"] = { "LIBS": ["miniupnpc"] }
+ env["LIBMINIUPNPC_FLAGS"].update(libminiupnpc_flags)
+ else :
+ env["HAVE_LIBMINIUPNPC"] = 1
+ env["LIBMINIUPNPC_BUNDLED"] = 1
+ conf.Finish()
else :
env["LIBMINIUPNPC_FLAGS"] = {}
# LibNATPMP
if env["experimental"] :
- #libnatpmp_conf_env = conf_env.Clone()
- #conf = Configure(libnatpmp_conf_env)
- #if conf.CheckCHeader("natpmp.h") and conf.CheckLib(env["libnatpmp_libname"]) :
- # print "NOT IMPLEMENTED YET"
- #else :
- env["LIBNATPMP_BUNDLED"] = 1
- #conf.Finish()
+ libnatpmp_flags = {}
+ libnatpmp_conf_env = conf_env.Clone()
+ if env.get("libnatpmp_libdir", None) :
+ libnatpmp_flags["LIBPATH"] = [env["libnatpmp_libdir"]]
+ if env.get("libnatpmp_includedir", None) :
+ libnatpmp_flags["CPPPATH"] = [env["libnatpmp_includedir"]]
+ libnatpmp_conf_env.MergeFlags(libnatpmp_flags)
+ conf = Configure(libnatpmp_conf_env)
+ if conf.CheckCHeader("natpmp.h") and conf.CheckLib(env["libnatpmp_libname"]) and False:
+ # ^ False because APIs aren't stable
+ env["HAVE_LIBNATPMP"] = 1
+ env["LIBNATPMP_FLAGS"] = { "LIBS": ["natpmp"] }
+ env["LIBNATPMP_FLAGS"].update(libnatpmp_flags)
+ else :
+ env["HAVE_LIBNATPMP"] = 1
+ env["LIBNATPMP_BUNDLED"] = 1
+ conf.Finish()
else :
env["LIBNATPMP_FLAGS"] = {}