gallium: Fix seg fault (James Vogt).
[mesa.git] / SConstruct
index dd118dfbb870b6c1a74694a3fb79ef64557707a7..4785e39ec566deb2ca80c897cdd51adc27f41382 100644 (file)
@@ -55,9 +55,6 @@ env = Environment(
        ENV = os.environ)
 Help(opts.GenerateHelpText(env))
 
-# for debugging
-#print env.Dump()
-
 # replicate options values in local variables
 debug = env['debug']
 dri = env['dri']
@@ -87,6 +84,7 @@ Export([
 # TODO: put the compiler specific settings in separate files
 # TODO: auto-detect as much as possible
 
+common.generate(env)
 
 if platform == 'winddk':
        env.Tool('winddk', ['.'])
@@ -115,17 +113,9 @@ if gcc:
        env.Append(CXXFLAGS = '-fmessage-length=0')
 
 if msvc:
-       env.Append(CFLAGS = '/W3')
-       if debug:
-               cflags = [
-                       '/Od', # disable optimizations
-                       '/Oy-', # disable frame pointer omission
-               ]
-       else:
-               cflags = [
-                       '/Ox', # maximum optimizations
-                       '/Os', # favor code space
-               ]
+       cflags = [
+               #'/Wp64', # enable 64 bit porting warnings
+       ]
        env.Append(CFLAGS = cflags)
        env.Append(CXXFLAGS = cflags)
        # Put debugging information in a separate .pdb file for each object file as
@@ -134,14 +124,7 @@ if msvc:
 
 # Defines
 if debug:
-       if gcc:
-               env.Append(CPPDEFINES = ['DEBUG'])
-       if msvc:
-               env.Append(CPPDEFINES = [
-                       ('DBG', '1'),
-                       ('DEBUG', '1'),
-                       ('_DEBUG', '1'),
-               ])
+       env.Append(CPPDEFINES = ['DEBUG'])
 else:
        env.Append(CPPDEFINES = ['NDEBUG'])
 
@@ -206,9 +189,7 @@ if llvm:
        env.ParseConfig('llvm-config --cflags --ldflags --libs')
        env.Append(CPPDEFINES = ['MESA_LLVM'])
        env.Append(CXXFLAGS = ['-Wno-long-long'])
-
-# Force C++ linkage
-if env['PLATFORM'] in ('posix',):
+        # Force C++ linkage
        env['LINK'] = env['CXX']
 
 # libGL
@@ -221,8 +202,8 @@ if platform not in ('winddk',):
                'Xfixes',
        ])
 
-# Convenience library support
-common.createConvenienceLibBuilder(env)
+# for debugging
+#print env.Dump()
 
 Export('env')