diff --git a/SCons/Config/default b/SCons/Config/default index 77eb550b..410bf4db 100644 --- a/SCons/Config/default +++ b/SCons/Config/default @@ -28,6 +28,10 @@ plugin_env = defenv.Copy(no_import_lib = 1) util_env = defenv.Copy() +### cross-platform util environment + +cp_util_env = util_env.Copy() + # return -Return('stub_env makensis_env plugin_env util_env') +Return('stub_env makensis_env plugin_env util_env cp_util_env') diff --git a/SCons/Config/gnu b/SCons/Config/gnu index b964292d..2ab52490 100644 --- a/SCons/Config/gnu +++ b/SCons/Config/gnu @@ -70,19 +70,23 @@ plugin_env.Append(LINKFLAGS = '-mwindows') # build windows executables plugin_env.Append(LINKFLAGS = '$ALIGN_FLAG') # 512 bytes align plugin_env.Append(LINKFLAGS = '$MAP_FLAG') # generate map file +### cross-platform util environment + +cp_util_env = defenv.Copy() + +cp_util_env.Append(CCFLAGS = '-O2') # optimize +cp_util_env.Append(CCFLAGS = '-Wall') # all warnings + +cp_util_env.Append(LINKFLAGS = '-s') # strip +cp_util_env.Append(LINKFLAGS = '$ALIGN_FLAG') # 512 bytes align +cp_util_env.Append(LINKFLAGS = '$MAP_FLAG') # generate map file + ### util environment -util_env = defenv.Copy() +util_env = cp_util_env.Copy() cross_env(util_env) -util_env.Append(CCFLAGS = '-O2') # optimize -util_env.Append(CCFLAGS = '-Wall') # all warnings - -util_env.Append(LINKFLAGS = '-s') # strip util_env.Append(LINKFLAGS = '-mwindows') # build windows executables -util_env.Append(LINKFLAGS = '$ALIGN_FLAG') # 512 bytes align -util_env.Append(LINKFLAGS = '$MAP_FLAG') # generate map file - ### weird GCC requirements @@ -164,4 +168,4 @@ conf.Finish() ### return -Return('stub_env makensis_env plugin_env util_env') +Return('stub_env makensis_env plugin_env util_env cp_util_env') diff --git a/SCons/Config/ms b/SCons/Config/ms index 8a957599..a61ee7ec 100644 --- a/SCons/Config/ms +++ b/SCons/Config/ms @@ -66,6 +66,10 @@ util_env.Append(CCFLAGS = '/W3') # level 3 warnings util_env.Append(LINKFLAGS = '/opt:nowin98') # 512 bytes align util_env.Append(LINKFLAGS = '$MAP_FLAG') # generate map file +### cross-platform util environment + +cp_util_env = util_env.Copy() + # return -Return('stub_env makensis_env plugin_env util_env') +Return('stub_env makensis_env plugin_env util_env cp_util_env') diff --git a/SConstruct b/SConstruct index 84cb6e16..0b251c76 100644 --- a/SConstruct +++ b/SConstruct @@ -185,6 +185,7 @@ stub_env = envs[0] makensis_env = envs[1] plugin_env = envs[2] util_env = envs[3] +cp_util_env = envs[4] ###################################################################### ####### Aliases ### @@ -365,8 +366,11 @@ for plugin in plugins: def BuildUtil(target, source, libs, entry = None, res = None, resources = None, defines = None, flags = None, nodeflib = False, install = None, install_as = None, - examples = None, docs = None): - env = util_env.Copy() + examples = None, docs = None, cross_platform = False): + if not cross_platform: + env = util_env.Copy() + else: + env = cp_util_env.Copy() AddEnvStandardFlags(env, defines, flags, entry, nodeflib)