import Config

dbg = Config.Config('dbg', default=True, CCFLAGS=['-g', '-O0'], suffix='_DEBUG')
optdbg = Config.Config('optdbg', CCFLAGS=['-g', '-02'], suffix='_OPTIMIZED')
release = Config.Config('release', CCFLAGS=['-02'])

import Config
from SCons.Script import *

dbgFlags = {}
optdbgFlags = {}
releaseFlags = {}

env = Environment()
if env['CC'] == 'gcc':
	dbgFlags['CCFLAGS'] = ['-g', '-O0']
	optdbgFlags['CCFLAGS'] = ['-g', '-O2']
	releaseFlags['CCFLAGS'] = ['-O2']
elif env['CC'] == 'cl':
	dbgFlags['CCFLAGS'] = ['/Zi', '/Od']
	optdbgFlags['CCFLAGS'] = ['/Zi', '/O2']
	releaseFlags['CCFLAGS'] = ['/O2']

dbg = Config.Config('dbg', default=True, suffix='_DEBUG', **dbgFlags)
optdbg = Config.Config('optdbg', suffix='_OPTIMIZED', **optdbgFlags)
release = Config.Config('release', **releaseFlags)

Use msvc flags when building with msvc, and gcc flags when building with gcc