diff options
author | Kevin Smith <git@kismith.co.uk> | 2014-10-13 09:44:03 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2014-10-13 10:30:12 (GMT) |
commit | 3f9c73993358b3636e3244f3e29cb4ee916e7b02 (patch) | |
tree | 334256f3dd7880f94537e4833ca76fab31fd65f9 | |
parent | c7cd9c8d239c1c5d604de8862625741754138771 (diff) | |
download | swift-contrib-3f9c73993358b3636e3244f3e29cb4ee916e7b02.zip swift-contrib-3f9c73993358b3636e3244f3e29cb4ee916e7b02.tar.bz2 |
Regress Python requirement to 2.4 again
Test-information:
Ran through the configuration step on a machine with only Python 2.4
Change-Id: I3d5ba54395ede875c7f21c2769151fe6d308e760
-rw-r--r-- | BuildTools/SCons/SConscript.boot | 8 | ||||
-rw-r--r-- | BuildTools/SCons/SConstruct | 2 | ||||
-rw-r--r-- | BuildTools/SCons/Version.py | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot index 0a4eb33..10fc7d3 100644 --- a/BuildTools/SCons/SConscript.boot +++ b/BuildTools/SCons/SConscript.boot @@ -37,86 +37,86 @@ if os.name == "mac" or (os.name == "posix" and os.uname()[0] == "Darwin"): 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(PackageVariable("openssl", "OpenSSL location", "yes")) vars.Add("openssl_libnames", "Comma-separated openssl library names to override defaults", None) vars.Add(BoolVariable("openssl_force_bundled", "Force use of the bundled OpenSSL", "no")) 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", "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(BoolVariable("boost_bundled_enable", "Allow use of bundled Boost as last resort", "true")) 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 bunded Expat", "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", "libminiupnpc" if os.name == "nt" else "miniupnpc") +vars.Add("libminiupnpc_libname", "LibMiniUPNPC library name", os.name == "nt" and "libminiupnpc" or "miniupnpc") 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", "libnatpmp" if os.name == "nt" else "natpmp") +vars.Add("libnatpmp_libname", "LibNATPMP library name", os.name == "nt" and "libnatpmp" or "natpmp") 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", "liblua" if os.name == "nt" else "lua") +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", "libedit" if os.name == "nt" else "edit") +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", "no")) # TODO: auto-detect this 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("install_git_hooks", "Install git hooks", "true")) ################################################################################ # Set up default build & configure environment ################################################################################ env_ENV = { 'PATH' : os.environ['PATH'], 'LD_LIBRARY_PATH' : os.environ.get("LD_LIBRARY_PATH", ""), 'TERM' : os.environ.get("TERM", ""), } if "MSVC_VERSION" in ARGUMENTS : env = Environment(ENV = env_ENV, variables = vars, MSVC_VERSION = ARGUMENTS["MSVC_VERSION"], platform = ARGUMENTS.get("PLATFORM", None)) else : env = Environment(ENV = env_ENV, variables = vars, platform = ARGUMENTS.get("PLATFORM", None)) Help(vars.GenerateHelpText(env)) # Workaround for missing Visual Studio 2012 support in SCons diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index 5db30f8..d314ff3 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -523,71 +523,71 @@ else : if openssl_libdir: openssl_flags["LIBPATH"] = [openssl_libdir] env["OPENSSL_DIR"] = openssl_prefix elif env["PLATFORM"] == "win32" : openssl_flags["LIBPATH"] = [os.path.join(openssl_prefix, "lib", "VC")] env["OPENSSL_DIR"] = openssl_prefix else : openssl_flags["LIBPATH"] = [os.path.join(openssl_prefix, "lib")] openssl_env.MergeFlags(openssl_flags) openssl_conf = Configure(openssl_env) if use_openssl and openssl_conf.CheckCHeader("openssl/ssl.h") : env["HAVE_OPENSSL"] = 1 env["OPENSSL_FLAGS"] = openssl_flags openssl_libnames = env.get("openssl_libnames", None) if openssl_libnames: env["OPENSSL_FLAGS"]["LIBS"] = openssl_libnames.split(',') elif env["PLATFORM"] == "win32" : env["OPENSSL_FLAGS"]["LIBS"] = ["libeay32MD", "ssleay32MD"] else: env["OPENSSL_FLAGS"]["LIBS"] = ["ssl", "crypto"] if env["PLATFORM"] == "darwin" : if platform.mac_ver()[0].startswith("10.5") : env["OPENSSL_FLAGS"]["FRAMEWORKS"] = ["Security"] else : env["OPENSSL_FLAGS"] = {} if env["PLATFORM"] == "win32" : env["HAVE_SCHANNEL"] = True # If we're compiling for Windows and OpenSSL isn't being used, use Schannel env.Append(LIBS = ["secur32"]) openssl_conf.Finish() #Hunspell hunspell_env = conf_env.Clone() -hunspell_prefix = env["hunspell"] if isinstance(env.get("hunspell", False), str) else "" +hunspell_prefix = isinstance(env.get("hunspell", False), str) and env["hunspell"] or "" 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; hunspell_conf = Configure(hunspell_env) if hunspell_conf.CheckCXXHeader("hunspell/hunspell.hxx") and hunspell_conf.CheckLib("hunspell") : env["HAVE_HUNSPELL"] = 1 hunspell_flags["LIBS"] = ["hunspell"] env["HUNSPELL_FLAGS"] = hunspell_flags hunspell_conf.Finish() # Bonjour if env["PLATFORM"] == "darwin" and env["target"] == "native" : env["HAVE_BONJOUR"] = 1 elif env.get("bonjour", False) : bonjour_env = conf_env.Clone() bonjour_conf = Configure(bonjour_env) bonjour_flags = {} if env.get("bonjour") != True : bonjour_prefix = env["bonjour"] bonjour_flags["CPPPATH"] = [os.path.join(bonjour_prefix, "include")] bonjour_flags["LIBPATH"] = [os.path.join(bonjour_prefix, "lib", "win32")] bonjour_env.MergeFlags(bonjour_flags) if bonjour_conf.CheckCHeader("dns_sd.h") and bonjour_conf.CheckLib("dnssd") : env["HAVE_BONJOUR"] = 1 env["BONJOUR_FLAGS"] = bonjour_flags env["BONJOUR_FLAGS"]["LIBS"] = ["dnssd"] bonjour_conf.Finish() # Cocoa & IOKit if env["PLATFORM"] == "darwin" : cocoa_conf = Configure(conf_env) if cocoa_conf.CheckCHeader("IOKit/IOKitLib.h") : diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py index 2f3b5a5..4fd9171 100644 --- a/BuildTools/SCons/Version.py +++ b/BuildTools/SCons/Version.py @@ -7,62 +7,62 @@ def getGitBuildVersion(root, project) : tag = git("describe --tags --match \"" + project + "-*\"", root) if tag : m = re.match(project + "-(.*)-(.*)-(.*)", tag) if m : return m.group(1) + "-dev" + m.group(2) return None def git(cmd, root) : full_cmd = "git " + cmd p = subprocess.Popen(full_cmd, cwd=root, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=(os.name != "nt")) gitVersion = p.stdout.read() # error = p.stderr.read() # if error: # print "Git error: " + error p.stdin.close() if p.wait() == 0 : return gitVersion return None def getBuildVersion(root, project) : versionFilename = os.path.join(root, "VERSION." + project) if os.path.isfile(versionFilename) : f = open(versionFilename) version = f.read().strip() f.close() return version gitVersion = getGitBuildVersion(root, project) if gitVersion : return gitVersion return datetime.date.today().strftime("%Y%m%d") def convertToWindowsVersion(version) : version_match = re.match("(\d+)\.(\d+)(.*)", version) - major = int(version_match.group(1)) if version_match else 0 - minor = int(version_match.group(2)) if version_match else 0 + major = version_match and int(version_match.group(1)) or 0 + minor = version_match and int(version_match.group(2)) or 0 if version_match and len(version_match.group(3)) == 0 : patch = 60000 else : match = re.match("^beta(\d+)(.*)", version_match.group(3)) build_string = "" if match : patch = 1000*int(match.group(1)) build_string = match.group(2) else : rc_match = re.match("^rc(\d+)(.*)", version_match.group(3)) if rc_match : patch = 10000*int(rc_match.group(1)) build_string = rc_match.group(2) else : patch = 0 alpha_match = re.match("^alpha(.*)", version_match.group(3)) if alpha_match : build_string = alpha_match.group(1) if len(build_string) > 0 : build_match = re.match("^-dev(\d+)", build_string) if build_match : patch += int(build_match.group(1)) return (major, minor, patch) |