Mesa (master): scons: Reduce all Cygwin platform names to 'cygwin'.

Vinson Lee vlee at kemper.freedesktop.org
Fri Feb 25 04:02:32 UTC 2011


Module: Mesa
Branch: master
Commit: eb1780238621c7be0342d9129eb639e4892c004d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb1780238621c7be0342d9129eb639e4892c004d

Author: Vinson Lee <vlee at vmware.com>
Date:   Thu Feb 24 19:49:37 2011 -0800

scons: Reduce all Cygwin platform names to 'cygwin'.

platform.system in SCons on Cygwin includes the OS version number.
Windows XP - CYGWIN_NT-5.1
Windows Vista - CYGWIN_NT-6.0
Windows 7 - CYGWIN_NT-6.1

Reduce all Cygwin platform variants to just 'cygwin' so anything
downstream can simply use 'cygwin' instead of the different full
platform names.

---

 common.py                             |    4 +++-
 scons/gallium.py                      |    2 ++
 src/gallium/winsys/sw/xlib/SConscript |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/common.py b/common.py
index b44f20e..1d0c6a7 100644
--- a/common.py
+++ b/common.py
@@ -15,6 +15,8 @@ import SCons.Script.SConscript
 # Defaults
 
 host_platform = _platform.system().lower()
+if host_platform.startswith('cygwin'):
+    host_platform = 'cygwin'
 
 # Search sys.argv[] for a "platform=foo" argument since we don't have
 # an 'env' variable at this point.
@@ -81,7 +83,7 @@ def AddOptions(opts):
 	opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
 											 allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
 	opts.Add(EnumOption('platform', 'target platform', host_platform,
-											 allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin_nt-5.1', 'cygwin_nt-6.1', 'sunos5', 'freebsd8')))
+											 allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
 	opts.Add('toolchain', 'compiler toolchain', default_toolchain)
 	opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
 	opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
diff --git a/scons/gallium.py b/scons/gallium.py
index 9118257..112f6c8 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -195,6 +195,8 @@ def generate(env):
     # Determine whether we are cross compiling; in particular, whether we need
     # to compile code generators with a different compiler as the target code.
     host_platform = _platform.system().lower()
+    if host_platform.startswith('cygwin'):
+        host_platform = 'cygwin'
     host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
     host_machine = {
         'x86': 'x86',
diff --git a/src/gallium/winsys/sw/xlib/SConscript b/src/gallium/winsys/sw/xlib/SConscript
index f6c4741..df01a9e 100644
--- a/src/gallium/winsys/sw/xlib/SConscript
+++ b/src/gallium/winsys/sw/xlib/SConscript
@@ -4,7 +4,7 @@
 
 Import('*')
 
-if env['platform'] in ('cygwin_nt-5.1', 'cygwin_nt-6.1', 'linux'):
+if env['platform'] in ('cygwin', 'linux'):
 
     env = env.Clone()
 




More information about the mesa-commit mailing list