summaryrefslogtreecommitdiff
path: root/engine/SCons/Tool/MSCommon
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Tool/MSCommon')
-rw-r--r--engine/SCons/Tool/MSCommon/__init__.py4
-rw-r--r--engine/SCons/Tool/MSCommon/arch.py4
-rw-r--r--engine/SCons/Tool/MSCommon/common.py27
-rw-r--r--engine/SCons/Tool/MSCommon/netframework.py4
-rw-r--r--engine/SCons/Tool/MSCommon/sdk.py4
-rw-r--r--engine/SCons/Tool/MSCommon/vc.py4
-rw-r--r--engine/SCons/Tool/MSCommon/vs.py4
7 files changed, 33 insertions, 18 deletions
diff --git a/engine/SCons/Tool/MSCommon/__init__.py b/engine/SCons/Tool/MSCommon/__init__.py
index 4f56a4a..7a23c87 100644
--- a/engine/SCons/Tool/MSCommon/__init__.py
+++ b/engine/SCons/Tool/MSCommon/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """
Common functions for Microsoft Visual Studio and Visual C/C++.
diff --git a/engine/SCons/Tool/MSCommon/arch.py b/engine/SCons/Tool/MSCommon/arch.py
index ce214c2..25ec1b9 100644
--- a/engine/SCons/Tool/MSCommon/arch.py
+++ b/engine/SCons/Tool/MSCommon/arch.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """Module to define supported Windows chip architectures.
"""
diff --git a/engine/SCons/Tool/MSCommon/common.py b/engine/SCons/Tool/MSCommon/common.py
index 219e680..d7d3b79 100644
--- a/engine/SCons/Tool/MSCommon/common.py
+++ b/engine/SCons/Tool/MSCommon/common.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """
Common helper functions for working with the Microsoft tool chain.
@@ -60,12 +60,27 @@ def is_win64():
# Unfortunately, python does not provide a useful way to determine
# if the underlying Windows OS is 32-bit or 64-bit. Worse, whether
# the Python itself is 32-bit or 64-bit affects what it returns,
- # so nothing in sys.* or os.* help. So we go to the registry to
- # look directly for a clue from Windows, caching the result to
- # avoid repeated registry calls.
+ # so nothing in sys.* or os.* help.
+
+ # Apparently the best solution is to use env vars that Windows
+ # sets. If PROCESSOR_ARCHITECTURE is not x86, then the python
+ # process is running in 64 bit mode (on a 64-bit OS, 64-bit
+ # hardware, obviously).
+ # If this python is 32-bit but the OS is 64, Windows will set
+ # ProgramW6432 and PROCESSOR_ARCHITEW6432 to non-null.
+ # (Checking for HKLM\Software\Wow6432Node in the registry doesn't
+ # work, because some 32-bit installers create it.)
global _is_win64
if _is_win64 is None:
- _is_win64 = has_reg(r"Software\Wow6432Node")
+ # I structured these tests to make it easy to add new ones or
+ # add exceptions in the future, because this is a bit fragile.
+ _is_win64 = False
+ if os.environ.get('PROCESSOR_ARCHITECTURE','x86') != 'x86':
+ _is_win64 = True
+ if os.environ.get('PROCESSOR_ARCHITEW6432'):
+ _is_win64 = True
+ if os.environ.get('ProgramW6432'):
+ _is_win64 = True
return _is_win64
diff --git a/engine/SCons/Tool/MSCommon/netframework.py b/engine/SCons/Tool/MSCommon/netframework.py
index 300f662..b52e597 100644
--- a/engine/SCons/Tool/MSCommon/netframework.py
+++ b/engine/SCons/Tool/MSCommon/netframework.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """
"""
diff --git a/engine/SCons/Tool/MSCommon/sdk.py b/engine/SCons/Tool/MSCommon/sdk.py
index f1345e4..f458dc0 100644
--- a/engine/SCons/Tool/MSCommon/sdk.py
+++ b/engine/SCons/Tool/MSCommon/sdk.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """Module to detect the Platform/Windows SDK
diff --git a/engine/SCons/Tool/MSCommon/vc.py b/engine/SCons/Tool/MSCommon/vc.py
index c02f15c..a190b8e 100644
--- a/engine/SCons/Tool/MSCommon/vc.py
+++ b/engine/SCons/Tool/MSCommon/vc.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@
# * test on 64 bits XP + VS 2005 (and VS 6 if possible)
# * SDK
# * Assembly
-__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """Module for Visual C/C++ detection and configuration.
"""
diff --git a/engine/SCons/Tool/MSCommon/vs.py b/engine/SCons/Tool/MSCommon/vs.py
index f9531c0..5be29c1 100644
--- a/engine/SCons/Tool/MSCommon/vs.py
+++ b/engine/SCons/Tool/MSCommon/vs.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 4577 2009/12/27 19:43:56 scons"
+__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 4629 2010/01/17 22:23:21 scons"
__doc__ = """Module to detect Visual Studio and/or Visual C/C++
"""