Chris@4: import os.path, sys Chris@4: Chris@4: class ConfigurationError(Exception): Chris@4: def __init__(self, reason): Chris@4: Exception.__init__(self, "Configuration failed: %s" % reason) Chris@4: Chris@4: env = Environment() Chris@4: Chris@4: # sunos, aix, hpux, irix, sunos appear to be platforms known by SCons, assuming they're POSIX compliant Chris@4: Posix = ("linux", "darwin", "sunos", "aix", "hpux", "irix", "sunos", "netbsd") Chris@4: Windows = ("win32", "cygwin") Chris@4: Chris@4: if env["PLATFORM"] == "posix": Chris@4: if sys.platform[:5] == "linux": Chris@4: Platform = "linux" Chris@4: elif sys.platform[:6] == "netbsd": Chris@4: Platform = "netbsd" Chris@4: else: Chris@4: raise ConfigurationError("Unknown platform %s" % sys.platform) Chris@4: else: Chris@4: if not env["PLATFORM"] in ("win32", "cygwin") + Posix: Chris@4: raise ConfigurationError("Unknown platform %s" % env["PLATFORM"]) Chris@4: Platform = env["PLATFORM"] Chris@4: Chris@4: # Inspired by the versioning scheme followed by Qt, it seems sensible enough. There are three components: major, minor Chris@4: # and micro. Major changes with each subtraction from the API (backward-incompatible, i.e. V19 vs. V18), minor changes Chris@4: # with each addition to the API (backward-compatible), micro changes with each revision of the source code. Chris@4: ApiVer = "2.0.0" Chris@4: Chris@4: Export("Platform", "Posix", "ConfigurationError", "ApiVer")