aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-07-14 13:00:38 +0000
committerlloyd <[email protected]>2009-07-14 13:00:38 +0000
commitf2e1b23ea9400b1fe593273bb43c838fc63545a1 (patch)
tree14f1f73007b245bebdbfc8e43294eefc2bd09b38
parent686c6cb75fa94978ba5939af0ae71f33d6a41e65 (diff)
Canonicalize os names (from either uname or --os) against osinfo.aliases;
noticed by Rickard Bondesson when he tried running configure.py on Solaris, aka SunOS.
-rwxr-xr-xconfigure.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/configure.py b/configure.py
index 640cd65b7..ecdc40301 100755
--- a/configure.py
+++ b/configure.py
@@ -955,8 +955,18 @@ def main(argv = None):
options.compiler, ' '.join(sorted(ccinfo.keys()))))
if options.os not in osinfo:
- raise Exception('Unknown OS "%s"; available options: %s' % (
- options.os, ' '.join(sorted(osinfo.keys()))))
+
+ def find_canonical_os_name(os):
+ for (name, info) in osinfo.items():
+ if os in info.aliases:
+ return name
+ return os # not found
+
+ options.os = find_canonical_os_name(options.os)
+
+ if options.os not in osinfo:
+ raise Exception('Unknown OS "%s"; available options: %s' % (
+ options.os, ' '.join(sorted(osinfo.keys()))))
if options.cpu is None:
(options.arch, options.cpu) = guess_processor(archinfo)