scons: Move MinGW flags from crossmingw.py to gallium.py
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 6 Sep 2011 12:13:32 +0000 (13:13 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 6 Sep 2011 12:18:58 +0000 (13:18 +0100)
So that they are used by native MinGW compilers too.

scons/crossmingw.py
scons/gallium.py

index 949fc4fb1dcc8bd8860e8c13df586a3d0779b5ee..893002f64a99c157aaa1904884e4eb9592f29351 100644 (file)
@@ -225,14 +225,6 @@ def generate(env):
     # default in recent gcc versions
     env.AppendUnique(CCFLAGS = ['-gstabs'])
 
-    env.AppendUnique(CPPDEFINES = [('__MSVCRT_VERSION__', '0x0700')])
-    #env.AppendUnique(LIBS = ['iberty'])
-    env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup'])
-    #env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at'])
-
-    # Avoid depending on gcc runtime DLLs
-    env.AppendUnique(LINKFLAGS = ['-static-libgcc'])
-
     env.AddMethod(compile_without_gstabs, 'compile_without_gstabs')
 
 def exists(env):
index 7135251d7a335d5ffe18322d170069f19a749e97..5103b9248551aba126b9c0012dc52d1d00006f21 100755 (executable)
@@ -279,6 +279,8 @@ def generate(env):
             ('_WIN32_WINNT', '0x0601'),
             ('WINVER', '0x0601'),
         ]
+        if gcc:
+            cppdefines += [('__MSVCRT_VERSION__', '0x0700')]
         if msvc and env['toolchain'] != 'winddk':
             cppdefines += [
                 'VC_EXTRALEAN',
@@ -532,6 +534,12 @@ def generate(env):
             pass
         else:
             env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
+        if env['platform'] == 'windows':
+            # Avoid depending on gcc runtime DLLs
+            linkflags += ['-static-libgcc']
+            # Handle the @xx symbol munging of DLL exports
+            shlinkflags += ['-Wl,--enable-stdcall-fixup']
+            #shlinkflags += ['-Wl,--kill-at']
     if msvc:
         if env['build'] == 'release':
             # enable Link-time Code Generation