1 diff -up ./SCons/Config/gnu.debug ./SCons/Config/gnu
2 --- ./SCons/Config/gnu.debug 2009-02-13 12:41:42.000000000 +0100
3 +++ ./SCons/Config/gnu 2009-02-13 12:42:37.000000000 +0100
4 @@ -68,13 +68,16 @@ cross_env(stub_env)
6 stub_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
8 -if not defenv['DEBUG']:
9 - stub_env.Append(CCFLAGS = ['-Os']) # optimize for size
10 +if defenv['DEBUG_SYMBOLS']:
11 + stub_env.Append(LINKFLAGS = '-g') # debugging
12 + stub_env.Append(CCFLAGS = '-g') # debugging
13 +if not defenv['DEBUG'] and defenv['OPT']:
14 + stub_env.Append(CCFLAGS = ['-O2']) # optimize
15 stub_env.Append(CCFLAGS = ['-Wall']) # all warnings
16 stub_env.Append(CCFLAGS = ['-xc']) # force compile as c
17 stub_env.Append(CCFLAGS = ['-fno-strict-aliasing']) # not safe for strict aliasing
19 -if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_W32']:
20 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_W32']:
21 stub_env.Append(LINKFLAGS = ['-s']) # strip
22 stub_env.Append(LINKFLAGS = ['-mwindows']) # build windows executables
23 stub_env.Append(LINKFLAGS = ['$NODEFLIBS_FLAG']) # no standard libraries
24 @@ -88,15 +91,18 @@ makensis_env = defenv.Clone()
26 makensis_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
28 -if not defenv['DEBUG']:
29 - makensis_env.Append(CCFLAGS = ['-O2']) # optimize
30 +if defenv['DEBUG_SYMBOLS']:
31 + makensis_env.Append(LINKFLAGS = '-g') # debugging
32 + makensis_env.Append(CCFLAGS = '-g') # debugging
33 +if not defenv['DEBUG'] and defenv['OPT']:
34 + makensis_env.Append(CCFLAGS = ['-O2']) # optimize
35 makensis_env.Append(CFLAGS = ['-Wall']) # all warnings
36 makensis_env.Append(CXXFLAGS = ['-Wno-non-virtual-dtor']) # ignore virtual dtor warnings
37 makensis_env.Append(CXXFLAGS = ['-Wall']) # all warnings
39 conf = FlagsConfigure(makensis_env)
40 conf.CheckLinkFlag('$MAP_FLAG') # generate map file
41 -if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']:
42 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_CP']:
43 TestStrip(conf) # strip
46 @@ -105,12 +111,15 @@ conf.Finish()
47 plugin_env = defenv.Clone()
50 -if not defenv['DEBUG']:
51 - plugin_env.Append(CCFLAGS = ['-Os']) # optimize for size
52 +if defenv['DEBUG_SYMBOLS']:
53 + plugin_env.Append(LINKFLAGS = '-g') # debugging
54 + plugin_env.Append(CCFLAGS = '-g') # debugging
55 +if not defenv['DEBUG'] and defenv['OPT']:
56 + plugin_env.Append(CCFLAGS = ['-O2']) # optimize
57 plugin_env.Append(CCFLAGS = ['-Wall']) # level 3 warnings
58 plugin_env.Append(CCFLAGS = ['-fno-strict-aliasing']) # not safe for strict aliasing
60 -if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_W32']:
61 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_W32']:
62 plugin_env.Append(LINKFLAGS = ['-s']) # strip
63 plugin_env.Append(LINKFLAGS = ['-mwindows']) # build windows executables
64 plugin_env.Append(LINKFLAGS = ['$ALIGN_FLAG']) # 512 bytes align
65 @@ -122,7 +131,10 @@ cp_util_env = defenv.Clone()
67 cp_util_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
69 -if not defenv['DEBUG']:
70 +if defenv['DEBUG_SYMBOLS']:
71 + cp_util_env.Append(LINKFLAGS = '-g') # debugging
72 + cp_util_env.Append(CCFLAGS = '-g') # debugging
73 +if not defenv['DEBUG'] and defenv['OPT']:
74 cp_util_env.Append(CCFLAGS = ['-O2']) # optimize
75 cp_util_env.Append(CCFLAGS = ['-Wall']) # all warnings
76 cp_util_env.Append(CCFLAGS = ['-fno-strict-aliasing']) # not safe for strict aliasing
77 @@ -140,7 +152,7 @@ util_env.Append(LINKFLAGS = ['-mwindows'
78 util_env.Append(LINKFLAGS = ['$ALIGN_FLAG']) # 512 bytes align
80 conf = FlagsConfigure(util_env)
81 -if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_W32']:
82 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_W32']:
83 util_env.Append(LINKFLAGS = ['-s']) # strip
86 @@ -149,7 +161,7 @@ conf.Finish()
87 conf = FlagsConfigure(cp_util_env)
88 conf.CheckCompileFlag('-m32')
89 conf.CheckLinkFlag('-m32')
90 -if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']:
91 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_CP']:
92 TestStrip(conf) # strip
95 @@ -157,6 +169,9 @@ conf.Finish()
97 test_env = defenv.Clone()
98 test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
99 +if defenv['DEBUG_SYMBOLS']:
100 + test_env.Append(LINKFLAGS = '-g') # debugging
101 + test_env.Append(CCFLAGS = '-g') # debugging
102 conf = FlagsConfigure(test_env)
103 conf.CheckCompileFlag('-m32')
104 conf.CheckLinkFlag('-m32')
105 diff -up ./SConstruct.debug ./SConstruct
106 --- ./SConstruct.debug 2009-02-04 15:05:48.000000000 +0100
107 +++ ./SConstruct 2009-02-13 12:41:42.000000000 +0100
108 @@ -157,6 +157,8 @@ opts.Add(('APPEND_CCFLAGS', 'Additional
109 opts.Add(('APPEND_LINKFLAGS', 'Additional linker flags'))
111 opts.Add(BoolVariable('DEBUG', 'Build executables with debugging information', 'no'))
112 +opts.Add(BoolOption('DEBUG_SYMBOLS', 'Build with debugging information, but none of the side effects of DEBUG', 'no'))
113 +opts.Add(BoolOption('OPT', 'Build with optimization', 'yes'))
114 opts.Add(PathVariable('CODESIGNER', 'A program used to sign executables', None))
115 opts.Add(BoolVariable('STRIP', 'Strips executables of any unrequired data such as symbols', 'yes'))
116 opts.Add(BoolVariable('STRIP_CP', 'Strips cross-platform executables of any unrequired data such as symbols', 'yes'))