intel: Remove the pbo zero-copy code.
[mesa.git] / scons / gallium.py
index 8cd3bc7f6e0dd3385c82f5589fefb9b9b89b6f8b..1c9c0ea32e46613dcc13f1e3dbc9666fdbfa774d 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',
@@ -361,7 +363,7 @@ def generate(env):
             ccflags += ['-O3']
         # Work around aliasing bugs - developers should comment this out
         ccflags += ['-fno-strict-aliasing']
-        ccflags += ['-g3']
+        ccflags += ['-g']
         if env['build'] in ('checked', 'profile'):
             # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
             ccflags += [
@@ -532,6 +534,14 @@ 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']
+            if env['machine'] == 'x86_64':
+                linkflags += ['-static-libstdc++']
+            # 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
@@ -596,6 +606,18 @@ def generate(env):
         libs += ['m', 'pthread', 'dl']
     env.Append(LIBS = libs)
 
+    # OpenMP
+    if env['openmp']:
+        if env['msvc']:
+            env.Append(CCFLAGS = ['/openmp'])
+            # When building openmp release VS2008 link.exe crashes with LNK1103 error.
+            # Workaround: overwrite PDB flags with empty value as it isn't required anyways
+            if env['build'] == 'release':
+                env['PDB'] = ''
+        if env['gcc']:
+            env.Append(CCFLAGS = ['-fopenmp'])
+            env.Append(LIBS = ['gomp'])
+
     # Load tools
     env.Tool('lex')
     env.Tool('yacc')