fix bug #2497148 - allow out of tree builds on POSIX platforms

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5921 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
pabs3 2009-02-04 14:05:48 +00:00
parent a1671db5d6
commit f41ba95bab
12 changed files with 57 additions and 20 deletions

View file

@ -23,10 +23,14 @@ defenv.Append(CPPDEFINES = [('NSISCALL', '$STDCALL')])
stub_env = defenv.Clone()
stub_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### makensis environment
makensis_env = defenv.Clone()
makensis_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### plugin environment
plugin_env = defenv.Clone(no_import_lib = 1)
@ -39,10 +43,14 @@ util_env = defenv.Clone()
cp_util_env = util_env.Clone()
cp_util_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### test environment
test_env = defenv.Clone()
test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
# return
Return('stub_env makensis_env plugin_env util_env cp_util_env test_env')

View file

@ -10,7 +10,7 @@ Import('FlagsConfigure')
def cross_env(env):
if env['PLATFORM'] != 'win32':
env.Tool('crossmingw', toolpath = ['../Tools'])
env.Tool('crossmingw', toolpath = [Dir('../Tools').rdir()])
### flags
@ -66,6 +66,8 @@ if defenv['DEBUG']:
stub_env = defenv.Clone()
cross_env(stub_env)
stub_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
if not defenv['DEBUG']:
stub_env.Append(CCFLAGS = ['-Os']) # optimize for size
stub_env.Append(CCFLAGS = ['-Wall']) # all warnings
@ -84,6 +86,8 @@ stub_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file
makensis_env = defenv.Clone()
makensis_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
if not defenv['DEBUG']:
makensis_env.Append(CCFLAGS = ['-O2']) # optimize
makensis_env.Append(CCFLAGS = ['-Wall']) # all warnings
@ -117,6 +121,8 @@ plugin_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file
cp_util_env = defenv.Clone()
cp_util_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
if not defenv['DEBUG']:
cp_util_env.Append(CCFLAGS = ['-O2']) # optimize
cp_util_env.Append(CCFLAGS = ['-Wall']) # all warnings
@ -151,6 +157,7 @@ conf.Finish()
### test environment
test_env = defenv.Clone()
test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
conf = FlagsConfigure(test_env)
conf.CheckCompileFlag('-m32')
conf.CheckLinkFlag('-m32')
@ -168,7 +175,7 @@ conf.Finish()
# sure the sections will be written in the correct order.
#
stub_env.Append(LINKFLAGS = '-T %s' % File('linker_script').abspath)
stub_env.Append(LINKFLAGS = ['-T', File('linker_script').rfile()])
#
# GCC requires some functions from the CRT to be present, if certain

View file

@ -23,10 +23,14 @@ defenv.Append(CPPDEFINES = [('NSISCALL', '$STDCALL')])
stub_env = defenv.Clone()
stub_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### makensis environment
makensis_env = defenv.Clone()
makensis_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### use "$CXX -Ae" as the "$CC" compiler to build makensis
makensis_env['CC'] = makensis_env['CXX']
@ -111,10 +115,14 @@ util_env = defenv.Clone()
cp_util_env = util_env.Clone()
cp_util_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### test environment
test_env = defenv.Clone()
test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
# return
Return('stub_env makensis_env plugin_env util_env cp_util_env test_env')

View file

@ -81,6 +81,8 @@ conf.Finish()
stub_env = defenv.Clone()
stub_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
if not defenv['DEBUG']:
stub_env.Append(CCFLAGS = ['/O1']) # optimize for size
stub_env.Append(CCFLAGS = ['/W3']) # level 3 warnings
@ -96,6 +98,8 @@ stub_env.Append(CCFLAGS = ['/Fa${TARGET}.lst']) # listing file name
makensis_env = defenv.Clone()
makensis_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
if not defenv['DEBUG']:
makensis_env.Append(CCFLAGS = ['/O2']) # optimize for speed
makensis_env.Append(CCFLAGS = ['$EXCEPTION_FLAG']) # enable exceptions
@ -130,10 +134,14 @@ util_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file
cp_util_env = util_env.Clone()
cp_util_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### test environment
test_env = defenv.Clone()
test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
### weird compiler requirements
def check_requirement(ctx, func, trigger):