2 Paul Wise <pabs@debian.org>
3 Add an option to generate debugging symbols
4 without side-effects on optimisation flags
5 and an option to enable/disable optimisation
6 Index: SCons/Config/gnu
7 ===================================================================
8 --- SCons/Config/gnu.orig 2007-02-02 20:34:33.000000000 +1100
9 +++ SCons/Config/gnu 2007-02-08 15:33:51.000000000 +1100
12 makensis_env = defenv.Copy()
\r
14 -if not defenv['DEBUG']:
\r
15 - makensis_env.Append(CCFLAGS = '-O2') # optimize
\r
16 +if defenv['DEBUG_SYMBOLS']:
\r
17 + makensis_env.Append(CCFLAGS = '-g') # debugging
\r
18 + makensis_env.Append(LINKFLAGS = '-g') # debugging
\r
19 +if not defenv['DEBUG'] and defenv['OPT']:
\r
20 + makensis_env.Append(CCFLAGS = '-O2') # optimize
\r
21 makensis_env.Append(CCFLAGS = '-Wall') # all warnings
\r
23 conf = FlagsConfigure(makensis_env)
\r
24 conf.CheckLinkFlag('$MAP_FLAG') # generate map file
\r
25 -if not defenv['DEBUG']:
\r
26 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS']:
\r
27 TestStrip(conf) # strip
\r
32 cp_util_env = defenv.Copy()
\r
34 -if not defenv['DEBUG']:
\r
35 +if defenv['DEBUG_SYMBOLS']:
\r
36 + cp_util_env.Append(CCFLAGS = '-g') # debugging
\r
37 + cp_util_env.Append(LINKFLAGS = '-g') # debugging
\r
38 +if not defenv['DEBUG'] and defenv['OPT']:
\r
39 cp_util_env.Append(CCFLAGS = '-O2') # optimize
\r
40 cp_util_env.Append(CCFLAGS = '-Wall') # all warnings
\r
42 conf = FlagsConfigure(cp_util_env)
\r
43 conf.CheckLinkFlag('$MAP_FLAG') # generate map file
\r
44 -if not defenv['DEBUG']:
\r
45 +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS']:
\r
46 TestStrip(conf) # strip
\r
50 ### test environment
\r
52 test_env = defenv.Copy()
\r
53 +if defenv['DEBUG_SYMBOLS']:
\r
54 + test_env.Append(LINKFLAGS = '-g') # debugging
\r
55 + test_env.Append(CCFLAGS = '-g') # debugging
\r
57 ### weird GCC requirements
\r
60 ===================================================================
61 --- SConstruct.orig 2007-02-02 20:34:33.000000000 +1100
62 +++ SConstruct 2007-02-08 15:48:40.000000000 +1100
64 opts.Add(PathOption('LIBPATH', 'Path to search for libraries', None))
\r
66 opts.Add(BoolOption('DEBUG', 'Build executables with debugging information', 'no'))
\r
67 +opts.Add(BoolOption('DEBUG_SYMBOLS', 'Build with debugging information, but none of the side effects of DEBUG', 'no'))
\r
68 +opts.Add(BoolOption('OPT', 'Build with optimization', 'yes'))
\r
69 opts.Add(PathOption('CODESIGNER', 'A program used to sign executables', None))
\r
70 # path related build options
\r
71 opts.Add(('PREFIX_DEST', 'Intermediate installation prefix (extra install time prefix)', dirs['dest']))
\r