summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-11-07 10:35:25 (GMT)
committerTobias Markmann <tm@ayena.de>2016-11-18 09:18:57 (GMT)
commit8a71b91be885652f37c5aab5e1ecf25af4599fbc (patch)
tree5f66eb3c1b8b9176594f00999ff9677cd4269453
parent43479ef719ea8fc6abbf654730b47c4583140508 (diff)
downloadswift-8a71b91be885652f37c5aab5e1ecf25af4599fbc.zip
swift-8a71b91be885652f37c5aab5e1ecf25af4599fbc.tar.bz2
Add scons options forcing for bundled Boost, libminiupnpc, libnatpmp
Test-Information: Build Swiften on Debian 8.6 with all installed dependencies with and without passing these new options to scons. Either case built fine. Change-Id: I4867c0479a0d44b15e12918c5075e9039945ed95
-rw-r--r--BuildTools/SCons/SConscript.boot6
-rw-r--r--BuildTools/SCons/SConstruct6
2 files changed, 9 insertions, 3 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index d6527f3..7efa8c9 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -25,83 +25,89 @@ vars.Add(BoolVariable("assertions", "Compile with assertions", "yes"))
vars.Add(BoolVariable("max_jobs", "Build with maximum number of parallel jobs", "no"))
vars.Add(EnumVariable("target", "Choose a target platform for compilation", "native", ["native", "iphone-simulator", "iphone-device", "xcode", "android"]))
vars.Add('android_toolchain', "Path to Android toolchain")
vars.Add('android_sdk_bin', "Path to Android SDK's tools directory")
vars.Add(BoolVariable("swift_mobile", "Build mobile Swift", "no"))
vars.Add(BoolVariable("swiften_dll", "Build Swiften as dynamically linked library", "no"))
if os.name != "nt" :
vars.Add(BoolVariable("coverage", "Compile with coverage information", "no"))
if os.name == "posix" :
vars.Add(BoolVariable("valgrind", "Run tests with valgrind", "no"))
if os.name == "mac" or (os.name == "posix" and os.uname()[0] == "Darwin"):
vars.Add(BoolVariable("universal", "Create universal binaries", "no"))
vars.Add(BoolVariable("mac105", "Link against the 10.5 frameworks", "no"))
vars.Add(BoolVariable("mac106", "Link against the 10.6 frameworks", "no"))
if os.name == "nt" :
vars.Add(PathVariable("vcredist", "MSVC redistributable dir", None, PathVariable.PathAccept))
if os.name == "nt" :
vars.Add(PathVariable("wix_bindir", "Path to WiX binaries", "", PathVariable.PathAccept))
if os.name == "nt" :
vars.Add(PackageVariable("bonjour", "Bonjour SDK location", "yes"))
vars.Add(EnumVariable("tls_backend", "Choose the TLS backend", "native", ["native", "openssl", "openssl_bundled"]))
vars.Add(PackageVariable("openssl", "OpenSSL location", "yes"))
vars.Add("openssl_libnames", "Comma-separated openssl library names to override defaults", None)
vars.Add("openssl_include", "Location of OpenSSL include files (if not under (openssl)/include)", None)
vars.Add("openssl_libdir", "Location of OpenSSL library files (if not under (openssl)/lib)", None)
vars.Add(PackageVariable("hunspell_prefix", "Hunspell location", False))
vars.Add(BoolVariable("hunspell_enable", "Build with Hunspell support", True))
vars.Add(PathVariable("boost_includedir", "Boost headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariable.PathAccept))
vars.Add(BoolVariable("boost_bundled_enable", "Allow use of bundled Boost as last resort", "true"))
+vars.Add(BoolVariable("boost_force_bundled", "Force use of bundled Boost.", False))
vars.Add(PathVariable("zlib_includedir", "Zlib headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("zlib_libdir", "Zlib library location", None, PathVariable.PathAccept))
vars.Add(PathVariable("zlib_libfile", "Zlib library file (full path to file)", None, PathVariable.PathAccept))
vars.Add(BoolVariable("zlib_bundled_enable", "Allow use of bundled Zlib as last resort", "true"))
vars.Add(BoolVariable("try_gconf", "Try configuring for GConf?", "true"))
vars.Add(BoolVariable("try_libxml", "Try configuring for libXML?", "true"))
vars.Add(BoolVariable("try_expat", "Try configuring for expat?", "true"))
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", os.name == "nt" and "libexpat" or "expat")
vars.Add(PackageVariable("icu", "ICU library location", "no"))
vars.Add(BoolVariable("libidn_bundled_enable", "Allow use of bundled LibIDN", "true"))
vars.Add(BoolVariable("try_libidn", "Try configuring for LibIDN?", "true"))
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", os.name == "nt" and "libidn" or "idn")
vars.Add(BoolVariable("need_idn", "Whether an IDN library is required. Without this, most internal binaries will fail", "true"))
+
vars.Add(PathVariable("libminiupnpc_includedir", "LibMiniUPNPC headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("libminiupnpc_libdir", "LibMiniUPNPC library location", None, PathVariable.PathAccept))
vars.Add("libminiupnpc_libname", "LibMiniUPNPC library name", os.name == "nt" and "libminiupnpc" or "miniupnpc")
+vars.Add(BoolVariable("libminiupnpc_force_bundled", "Force use of bundled LibMiniUPNPC", False))
+
vars.Add(PathVariable("libnatpmp_includedir", "LibNATPMP headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("libnatpmp_libdir", "LibNATPMP library location", None, PathVariable.PathAccept))
vars.Add("libnatpmp_libname", "LibNATPMP library name", os.name == "nt" and "libnatpmp" or "natpmp")
+vars.Add(BoolVariable("libnatpmp_force_bundled", "Force use of bundled LibNATPMP", False))
+
vars.Add(PathVariable("sqlite_includedir", "SQLite headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("sqlite_libdir", "SQLite library location", None, PathVariable.PathAccept))
vars.Add("sqlite_libname", "SQLite library name", os.name == "nt" and "libsqlite3" or "sqlite3")
vars.Add("sqlite_force_bundled", "Force use of the bundled SQLite", None)
vars.Add(PathVariable("lua_includedir", "Lua headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("lua_libdir", "Lua library location", None, PathVariable.PathAccept))
vars.Add("lua_libname", "Lua library name", os.name == "nt" and "liblua" or "lua")
vars.Add("lua_force_bundled", "Force use of the bundled Lua", None)
vars.Add(PathVariable("editline_includedir", "Readline headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("editline_libdir", "Readline library location", None, PathVariable.PathAccept))
vars.Add("editline_libname", "Readline library name", os.name == "nt" and "libedit" or "edit")
vars.Add(BoolVariable("try_avahi", "Try configuring for avahi?", "true"))
vars.Add(PathVariable("avahi_includedir", "Avahi headers location", None, PathVariable.PathAccept))
vars.Add(PathVariable("avahi_libdir", "Avahi library location", None, PathVariable.PathAccept))
vars.Add(PathVariable("qt", "Qt location", "", PathVariable.PathAccept))
vars.Add(BoolVariable("qt5", "Compile in Qt5 mode", "yes"))
vars.Add(PathVariable("docbook_xml", "DocBook XML", None, PathVariable.PathAccept))
vars.Add(PathVariable("docbook_xsl", "DocBook XSL", None, PathVariable.PathAccept))
vars.Add(BoolVariable("build_examples", "Build example programs", "yes"))
vars.Add(BoolVariable("enable_variants", "Build in a separate dir under build/, depending on compile flags", "no"))
vars.Add(BoolVariable("experimental_ft", "Build experimental file transfer", "yes"))
vars.Add(BoolVariable("experimental", "Build experimental features", "no"))
vars.Add(BoolVariable("set_iterator_debug_level", "Set _ITERATOR_DEBUG_LEVEL=0", "yes"))
vars.Add(BoolVariable("unbound", "Build bundled ldns and unbound. Use them for DNS lookup.", "no"))
vars.Add(BoolVariable("check_headers", "Independently build compilation units for all Swiften headers for detecting missing dependencies.", "no"))
vars.Add("win_target_arch", "Target architecture for Windows builds. x86 for 32-bit (default) or x86_64 for 64-bit.", "x86")
vars.Add(BoolVariable("install_git_hooks", "Install git hooks", "true"))
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 2da3787..c084cff 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -203,61 +203,61 @@ boost_flags = {}
if env.get("boost_libdir", None) :
boost_flags["LIBPATH"] = [env["boost_libdir"]]
if env.get("boost_includedir", None) :
if env["PLATFORM"] == "win32" or env["PLATFORM"] == "hpux" or env["PLATFORM"] == "sunos" :
boost_flags["CPPPATH"] = [env["boost_includedir"]]
else :
# Using isystem to avoid getting warnings from a system boost
# Unfortunately, this also disables dependency tracking
boost_flags["CPPFLAGS"] = [("-isystem", env["boost_includedir"])]
boost_conf_env.MergeFlags(boost_flags)
conf = Configure(boost_conf_env)
boostLibs = [(None, "signals2.hpp"), ("system", "system/system_error.hpp"), ("thread", None), ("regex", None), ("program_options", None), ("filesystem", None), ("serialization", "archive/text_oarchive.hpp"), ("date_time", "date_time/date.hpp")]
allLibsPresent = True
libNames = []
for (lib, header) in boostLibs :
if header :
header = "boost/" + header
else :
header = "boost/" + lib + ".hpp"
if not conf.CheckCXXHeader(header) :
allLibsPresent = False
break
if lib and env["PLATFORM"] != "win32" :
libName = "boost_" + lib
if not conf.CheckLib(libName, language='CXX') :
libName += "-mt"
if not conf.CheckLib(libName, language='CXX') :
allLibsPresent = False
break
libNames.append(libName)
-if allLibsPresent :
+if not env.get("boost_force_bundled") and allLibsPresent :
env["BOOST_FLAGS"] = boost_flags
if env["PLATFORM"] != "win32" :
env["BOOST_FLAGS"].update({"LIBS": libNames})
if not conf.CheckCXXHeader("boost/uuid/uuid.hpp") :
# FIXME: Remove this workaround when UUID is available in most distros
env["BOOST_BUNDLED_UUID_ONLY"] = True
elif not env.get("boost_bundled_enable", True) :
print "Error: Boost not found and boost_bundled_enable is false"
Exit(1)
else :
env["BOOST_BUNDLED"] = True
conf.Finish()
# Xss
env["HAVE_XSS"] = 0
if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" :
xss_flags = {
"LIBPATH": ["/usr/X11R6/lib"],
"LIBS": ["Xss"]
}
xss_env = conf_env.Clone()
xss_env.MergeFlags(xss_flags)
conf = Configure(xss_env)
if conf.CheckFunc("XScreenSaverQueryExtension") :
env["HAVE_XSS"] = 1
env["XSS_FLAGS"] = xss_flags
conf.Finish()
# GConf
@@ -410,81 +410,81 @@ conf.Finish()
# Fallback to bundled LibIDN
if not env.get("HAVE_ICU", False) and not env.get("HAVE_LIBIDN", False) :
if env.get("libidn_bundled_enable", True) :
env["HAVE_LIBIDN"] = 1
env["LIBIDN_BUNDLED"] = 1
elif env.get("need_idn", True):
print "Error: ICU and LIBIDN not found, and libidn_bundled_enable is false"
Exit(1)
else:
print "Proceeding without an IDN library because need_idn was false. This will break all internal binaries"
# Unbound
if env["unbound"] :
env["LDNS_BUNDLED"] = 1
env["UNBOUND_BUNDLED"] = 1
else :
env["LDNS_FLAGS"] = {}
env["UNBOUND_FLAGS"] = {}
# LibMiniUPnPc
if env["experimental_ft"] :
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"]) :
+ if not env.get("libminiupnpc_force_bundled") and conf.CheckCHeader("miniupnpc.h") and conf.CheckLib(env["libminiupnpc_libname"]) :
env["HAVE_LIBMINIUPNPC"] = 1
env["LIBMINIUPNPC_FLAGS"] = { "LIBS": ["miniupnpc"] }
env["LIBMINIUPNPC_FLAGS"].update(libminiupnpc_flags)
else :
env["LIBMINIUPNPC_BUNDLED"] = 1
conf.Finish()
else :
env["LIBMINIUPNPC_FLAGS"] = {}
# LibNATPMP
if env["experimental_ft"] :
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"]) :
+ if not env.get("libnatpmp_force_bundled") and conf.CheckCHeader("natpmp.h") and conf.CheckLib(env["libnatpmp_libname"]) :
env["HAVE_LIBNATPMP"] = 1
env["LIBNATPMP_FLAGS"] = { "LIBS": ["natpmp"] }
env["LIBNATPMP_FLAGS"].update(libnatpmp_flags)
else :
env["LIBNATPMP_BUNDLED"] = 1
conf.Finish()
else :
env["LIBNATPMP_FLAGS"] = {}
# SQLite
if env["experimental"] :
sqlite_conf_env = conf_env.Clone()
sqlite_flags = {}
if env.get("sqlite_libdir", None) :
sqlite_flags["LIBPATH"] = [env["sqlite_libdir"]]
if env.get("sqlite_includedir", None) :
sqlite_flags["CPPPATH"] = [env["sqlite_includedir"]]
sqlite_conf_env.MergeFlags(sqlite_flags)
conf = Configure(sqlite_conf_env)
if conf.CheckCHeader("sqlite3.h") and conf.CheckLib(env["sqlite_libname"]) and not env.get("sqlite_force_bundled", False):
env["HAVE_SQLITE"] = 1
env["SQLITE_FLAGS"] = { "LIBS": [env["sqlite_libname"]] }
env["SQLITE_FLAGS"].update(sqlite_flags)
else :
env["SQLITE_BUNDLED"] = 1
conf.Finish()
else :
env["SQLITE_FLAGS"] = {}