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