fixed bug #1474597 - Mac OS X 10.4 build failures

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4664 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-04-28 15:54:42 +00:00
parent 9ed073277d
commit 991295e17f
4 changed files with 49 additions and 17 deletions

View file

@ -35,6 +35,25 @@ defenv['ALIGN_FLAG'] = '-Wl,--file-alignment,512'
defenv['CPP_REQUIRES_STDLIB'] = 1
defenv['SUBSYS_CON'] = '-Wl,--subsystem,console'
### helper functions
# on Mac OS X, programs built with g++ 4.0, stl and -s error out:
# dyld: lazy symbol binding failed: lazy pointer not found
# dyld: lazy pointer not found
#
# to avoid this, this function checks if -s works
def TestStrip(ctx):
c = """
#include <vector>
int main() {
std::vector<int> v;
return 0;
}
"""
ctx.CheckLinkFlag('-s', run = 1, extension = '.cpp', code = c)
### debug
if defenv['DEBUG']:
@ -66,11 +85,10 @@ if not defenv['DEBUG']:
makensis_env.Append(CCFLAGS = '-O2') # optimize
makensis_env.Append(CCFLAGS = '-Wall') # all warnings
if not defenv['DEBUG']:
makensis_env.Append(LINKFLAGS = '-s') # strip
conf = FlagsConfigure(makensis_env)
conf.CheckLinkFlag('$MAP_FLAG') # generate map file
if not defenv['DEBUG']:
TestStrip(conf) # strip
conf.Finish()
### plugin environment
@ -93,14 +111,13 @@ plugin_env.Append(LINKFLAGS = '$MAP_FLAG') # generate map file
cp_util_env = defenv.Copy()
if not defenv['DEBUG']:
cp_util_env.Append(CCFLAGS = '-O2') # optimize
cp_util_env.Append(CCFLAGS = '-Wall') # all warnings
if not defenv['DEBUG']:
cp_util_env.Append(LINKFLAGS = '-s') # strip
cp_util_env.Append(CCFLAGS = '-O2') # optimize
cp_util_env.Append(CCFLAGS = '-Wall') # all warnings
conf = FlagsConfigure(cp_util_env)
conf.CheckLinkFlag('$MAP_FLAG') # generate map file
if not defenv['DEBUG']:
TestStrip(conf) # strip
conf.Finish()
### util environment