diff -ur nsis-2.39-src.orig/SCons/Config/gnu nsis-2.39-src.debopt/SCons/Config/gnu --- nsis-2.39-src.orig/SCons/Config/gnu 2008-03-03 16:33:56.000000000 +0000 +++ nsis-2.39-src.debopt/SCons/Config/gnu 2008-09-22 12:53:18.000000000 +0100 @@ -61,8 +61,11 @@ stub_env = defenv.Clone() cross_env(stub_env) -if not defenv['DEBUG']: - stub_env.Append(CCFLAGS = '-Os') # optimize for size +if not defenv['DEBUG_SYMBOLS']: + stub_env.Append(CCFLAGS = '-g') # debugging + stub_env.Append(LINKFLAGS = '-g') # debugging +if not defenv['DEBUG'] and defenv['OPT']: + stub_env.Append(CCFLAGS = '-O2') # optimize stub_env.Append(CCFLAGS = '-Wall') # all warnings stub_env.Append(CCFLAGS = '-x c') # force compile as c stub_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict aliasing @@ -88,7 +91,7 @@ conf.CheckCompileFlag('-m32') # conf.CheckLinkFlag('-m32') # conf.CheckLinkFlag('$MAP_FLAG') # generate map file -if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']: +if not defenv['DEBUG'] and not defenv['DEBUG_SYMBOLS'] and defenv['STRIP'] and defenv['STRIP_CP']: TestStrip(conf) # strip conf.Finish() @@ -112,7 +115,10 @@ cp_util_env = defenv.Clone() -if not defenv['DEBUG']: +if defenv['DEBUG_SYMBOLS']: + cp_util_env.Append(CCFLAGS = '-g') # debugging + cp_util_env.Append(LINKFLAGS = '-g') # debugging +if not defenv['DEBUG'] and defenv['OPT']: cp_util_env.Append(CCFLAGS = '-O2') # optimize cp_util_env.Append(CCFLAGS = '-Wall') # all warnings cp_util_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict aliasing @@ -146,6 +152,10 @@ ### test environment test_env = defenv.Clone() +if defenv['DEBUG_SYMBOLS']: + test_env.Append(LINKFLAGS = '-g') # debugging + test_env.Append(CCFLAGS = '-g') # debugging + conf = FlagsConfigure(test_env) conf.CheckCompileFlag('-m32') conf.CheckLinkFlag('-m32') diff -ur nsis-2.39-src.orig/SConstruct nsis-2.39-src.debopt/SConstruct --- nsis-2.39-src.orig/SConstruct 2008-05-04 09:30:07.000000000 +0100 +++ nsis-2.39-src.debopt/SConstruct 2008-09-22 12:55:55.000000000 +0100 @@ -168,6 +168,8 @@ opts.Add(('APPEND_LINKFLAGS', 'Additional linker flags')) # build options opts.Add(BoolOption('DEBUG', 'Build executables with debugging information', 'no')) +opts.Add(BoolOption('DEBUG_SYMBOLS', 'Build with debugging information, but none of the side effects of DEBUG', 'no')) +opts.Add(BoolOption('OPT', 'Build with optimization', 'yes')) opts.Add(PathOption('CODESIGNER', 'A program used to sign executables', None)) opts.Add(BoolOption('STRIP', 'Strips executables of any unrequired data such as symbols', 'yes')) opts.Add(BoolOption('STRIP_CP', 'Strips cross-platform executables of any unrequired data such as symbols', 'yes'))