summaryrefslogtreecommitdiff
path: root/scons
diff options
context:
space:
mode:
Diffstat (limited to 'scons')
-rw-r--r--scons/crossmingw.py1
-rw-r--r--scons/gallium.py50
2 files changed, 28 insertions, 23 deletions
diff --git a/scons/crossmingw.py b/scons/crossmingw.py
index 9cb0b89e3c..a4ae74e8d5 100644
--- a/scons/crossmingw.py
+++ b/scons/crossmingw.py
@@ -177,6 +177,7 @@ def generate(env):
# default in recent gcc versions
env.AppendUnique(CFLAGS = ['-gstabs'])
+ env.AppendUnique(CPPDEFINES = [('__MSVCRT_VERSION__', '0x0700')])
#env.AppendUnique(LIBS = ['iberty'])
env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup'])
#env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at'])
diff --git a/scons/gallium.py b/scons/gallium.py
index ac68bd604c..a40a957191 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -110,8 +110,21 @@ def generate(env):
env['toolchain'] = 'wcesdk'
env.Tool(env['toolchain'])
- if os.environ.has_key('CC'):
- env['CC'] = os.environ['CC']
+ if env['platform'] == 'embedded':
+ # Allow overriding compiler from environment
+ if os.environ.has_key('CC'):
+ env['CC'] = os.environ['CC']
+ # Update CCVERSION to match
+ pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
+ stdin = 'devnull',
+ stderr = 'devnull',
+ stdout = subprocess.PIPE)
+ if pipe.wait() == 0:
+ line = pipe.stdout.readline()
+ match = re.search(r'[0-9]+(\.[0-9]+)+', line)
+ if match:
+ env['CCVERSION'] = match.group(0)
+
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
@@ -230,7 +243,7 @@ def generate(env):
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
if platform == 'embedded':
- cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
+ cppdefines += ['PIPE_OS_EMBEDDED']
env.Append(CPPDEFINES = cppdefines)
# C compiler options
@@ -238,16 +251,7 @@ def generate(env):
cxxflags = [] # C++
ccflags = [] # C & C++
if gcc:
- ccversion = ''
- pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
- stdin = 'devnull',
- stderr = 'devnull',
- stdout = subprocess.PIPE)
- if pipe.wait() == 0:
- line = pipe.stdout.readline()
- match = re.search(r'[0-9]+(\.[0-9]+)+', line)
- if match:
- ccversion = match.group(0)
+ ccversion = env['CCVERSION']
if debug:
ccflags += ['-O0', '-g3']
elif ccversion.startswith('4.2.'):
@@ -277,10 +281,10 @@ def generate(env):
ccflags += [
'-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
]
- if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
- ccflags += [
- '-mstackrealign', # ensure stack is aligned
- ]
+ if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
+ ccflags += [
+ '-mstackrealign', # ensure stack is aligned
+ ]
if env['machine'] == 'x86_64':
ccflags += ['-m64']
# See also:
@@ -297,12 +301,12 @@ def generate(env):
'-std=gnu99',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
- ccflags += [
- '-Werror=pointer-arith',
- ]
- cflags += [
- '-Werror=declaration-after-statement',
- ]
+ ccflags += [
+ '-Werror=pointer-arith',
+ ]
+ cflags += [
+ '-Werror=declaration-after-statement',
+ ]
if msvc:
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx