applied patch #2918870 - use of the zlib compression library provided by the system

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6030 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
f0rt 2010-02-07 21:24:09 +00:00
parent 9f7710ace6
commit c39ffff404
34 changed files with 280 additions and 7431 deletions

View file

@ -1,6 +1,6 @@
def AddAvailableLibs(env, libs):
"""
Scans through a list list of libraries and adds
Scans through a list of libraries and adds
available libraries to the environment.
"""
conf = env.Configure()
@ -10,6 +10,32 @@ def AddAvailableLibs(env, libs):
conf.Finish()
def AddZLib(env, platform, alias='install-utils'):
"""
Checks for platform specific zlib and adds the
appropriate compiler and linker options to the environment
"""
zlib = 'z'
if platform == 'win32':
if 'ZLIB_W32' in env:
# Add include and library path of zlib for Win32
env.Append(CPPPATH = env['ZLIB_W32_INC'])
env.Append(LIBPATH = env['ZLIB_W32_LIB'])
zlib = ['zdll', 'z']
if 'ZLIB_W32_DLL' in env:
env.DistributeW32Bin(env['ZLIB_W32_DLL'], alias=alias)
else:
print 'Please specify folder of zlib for Win32 via ZLIB_W32'
Exit(1)
conf = env.Configure()
if not conf.CheckLibWithHeader(zlib, 'zlib.h', 'c'):
print 'zlib (%s) is missing!' % (platform)
Exit(1)
env = conf.Finish()
def GetAvailableLibs(env, libs):
"""
Scans through a list list of libraries and adds
@ -87,4 +113,4 @@ def FlagsConfigure(env):
"""
return env.Configure(custom_tests = { 'CheckCompileFlag' : check_compile_flag, 'CheckLinkFlag': check_link_flag })
Export('AddAvailableLibs FlagsConfigure GetAvailableLibs')
Export('AddAvailableLibs AddZLib FlagsConfigure GetAvailableLibs')