From 018b9cc347b57aab5317d8f00c2907f8d1fbddfb Mon Sep 17 00:00:00 2001 From: pabs3 Date: Wed, 14 Nov 2007 06:20:44 +0000 Subject: [PATCH] Add Debian patch for separate stripping options for Win32 & cross-platform options git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5368 212acab6-be3b-0410-9dea-997c60f758d6 --- SCons/Config/gnu | 20 +++++++++++++++----- SConstruct | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/SCons/Config/gnu b/SCons/Config/gnu index c1c190c8..26a1bb25 100644 --- a/SCons/Config/gnu +++ b/SCons/Config/gnu @@ -67,7 +67,7 @@ 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 -if not defenv['DEBUG'] and defenv['STRIP']: +if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_W32']: stub_env.Append(LINKFLAGS = '-s') # strip stub_env.Append(LINKFLAGS = '-mwindows') # build windows executables stub_env.Append(LINKFLAGS = '$NODEFLIBS_FLAG') # no standard libraries @@ -88,7 +88,7 @@ conf = FlagsConfigure(makensis_env) conf.CheckCompileFlag('-m32') # conf.CheckLinkFlag('-m32') # conf.CheckLinkFlag('$MAP_FLAG') # generate map file -if not defenv['DEBUG'] and defenv['STRIP']: +if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']: TestStrip(conf) # strip conf.Finish() @@ -102,7 +102,7 @@ if not defenv['DEBUG']: plugin_env.Append(CCFLAGS = '-Wall') # level 3 warnings plugin_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict aliasing -if not defenv['DEBUG'] and defenv['STRIP']: +if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_W32']: plugin_env.Append(LINKFLAGS = '-s') # strip plugin_env.Append(LINKFLAGS = '-mwindows') # build windows executables plugin_env.Append(LINKFLAGS = '$ALIGN_FLAG') # 512 bytes align @@ -119,8 +119,6 @@ cp_util_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict alias conf = FlagsConfigure(cp_util_env) conf.CheckLinkFlag('$MAP_FLAG') # generate map file -if not defenv['DEBUG'] and defenv['STRIP']: - TestStrip(conf) # strip conf.Finish() ### util environment @@ -131,6 +129,18 @@ cross_env(util_env) util_env.Append(LINKFLAGS = '-mwindows') # build windows executables util_env.Append(LINKFLAGS = '$ALIGN_FLAG') # 512 bytes align +conf = FlagsConfigure(util_env) +if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_W32']: + util_env.Append(LINKFLAGS = '-s') # strip +conf.Finish() + +### cross-platform util environment stripping + +conf = FlagsConfigure(cp_util_env) +if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']: + TestStrip(conf) # strip +conf.Finish() + ### test environment test_env = defenv.Clone() diff --git a/SConstruct b/SConstruct index 6eb528ca..bafa6eda 100644 --- a/SConstruct +++ b/SConstruct @@ -175,6 +175,8 @@ opts.Add(('APPEND_LINKFLAGS', 'Additional linker flags')) opts.Add(BoolOption('DEBUG', 'Build executables with debugging information', 'no')) 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')) +opts.Add(BoolOption('STRIP_W32', 'Strips Win32 executables of any unrequired data such as symbols', 'yes')) # path related build options opts.Add(('PREFIX_DEST', 'Intermediate installation prefix (extra install time prefix)', dirs['dest'])) opts.Add(('PREFIX_CONF', 'Path to install nsisconf.nsh to', dirs['conf']))