Changed the order of the zlib lib files SConstruct searches for so it can find the MinGW specific .a first. 64-bit MinGW has problems with a MSVC generated lib file.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6615 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2015-09-19 18:54:02 +00:00
parent 85851b0dad
commit fe491ddf94
4 changed files with 16 additions and 34 deletions

View file

@ -468,8 +468,8 @@ if 'ZLIB_W32' in defenv:
]
)
))
# Search for import library of zlib for VisualC or mingw
for importlib in ['zdll.lib', 'libzdll.a', 'libz.dll.a']:
# Search for import library of zlib for mingw or VisualC
for importlib in ['libzdll.a', 'libz.dll.a', 'zdll.lib']:
defenv['ZLIB_W32_LIB'] = os.path.dirname(str(
defenv.FindFile(importlib,
[

View file

@ -857,14 +857,6 @@ int CEXEBuild::add_db_data(IMMap *mmap) // returns offset
bufferlen = INT_MAX-st-sizeof(int); // so maximize compressor room and hope the file compresses well
db->resize(st + bufferlen + sizeof(int));
#if defined(NSIS_CONFIG_COMPRESSION_SUPPORT) && defined(__GNUC__) && defined(_WIN64) // There is another one of these, remove both when fixed
// BUGBUG: zlib is currently broken on 64-bit MinGW
if (compressor == &zlib_compressor)
{
ERROR_MSG(_T("\nError: ZLib is currently broken on this platform!\n"));
return -1;
}
#endif
int n = compressor->Init(build_compress_level, build_compress_dict_size);
if (n != C_OK)
{
@ -2577,15 +2569,6 @@ int CEXEBuild::write_output(void)
RET_UNLESS_OK( check_write_output_errors() );
#if defined(NSIS_CONFIG_COMPRESSION_SUPPORT) && defined(__GNUC__) && defined(_WIN64) // There is another one of these, remove both when fixed
// BUGBUG: zlib is currently broken on 64-bit MinGW
if (compressor == &zlib_compressor)
{
ERROR_MSG(_T("\nError: ZLib is currently broken on this platform!\n"));
return PS_ERROR;
}
#endif
has_called_write_output=true;
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT

View file

@ -26,20 +26,20 @@ class CBzip2 : public ICompressor {
public:
virtual ~CBzip2() {}
int Init(int level, unsigned int dict_size) {
virtual int Init(int level, unsigned int dict_size) {
last_ret = !BZ_STREAM_END;
stream = new bz_stream;
if (!stream) return BZ_MEM_ERROR;
return BZ2_bzCompressInit(stream, level, 0, 30);
}
int End() {
virtual int End() {
int ret = BZ2_bzCompressEnd(stream);
delete stream;
return ret;
}
int Compress(bool finish) {
virtual int Compress(bool finish) {
// act like zlib when it comes to stream ending
if (last_ret == BZ_STREAM_END && finish)
return C_FINISHED;
@ -51,12 +51,12 @@ class CBzip2 : public ICompressor {
return C_OK;
}
void SetNextIn(char *in, unsigned int size) {
virtual void SetNextIn(char *in, unsigned int size) {
stream->next_in = (unsigned char*) in;
stream->avail_in = size;
}
void SetNextOut(char *out, unsigned int size) {
virtual void SetNextOut(char *out, unsigned int size) {
stream->next_out = (unsigned char*) out;
stream->avail_out = size;
}
@ -73,11 +73,11 @@ class CBzip2 : public ICompressor {
return stream->avail_out;
}
const TCHAR* GetName() {
virtual const TCHAR* GetName() {
return _T("bzip2");
}
const TCHAR* GetErrStr(int err) {
virtual const TCHAR* GetErrStr(int err) {
switch (err)
{
case BZ_SEQUENCE_ERROR:

View file

@ -26,34 +26,33 @@ class CZlib : public ICompressor {
public:
virtual ~CZlib() {}
int Init(int level, unsigned int dict_size) {
virtual int Init(int level, unsigned int dict_size) {
stream = new z_stream;
if (!stream) return Z_MEM_ERROR;
stream->zalloc = (alloc_func)Z_NULL;
stream->zfree = (free_func)Z_NULL;
stream->opaque = (voidpf)Z_NULL;
return deflateInit2(stream, level,
Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}
int End() {
virtual int End() {
int ret = deflateEnd(stream);
delete stream;
return ret;
}
int Compress(bool finish) {
virtual int Compress(bool finish) {
return deflate(stream, finish?Z_FINISH:0);
}
void SetNextIn(char *in, unsigned int size) {
virtual void SetNextIn(char *in, unsigned int size) {
stream->next_in = (unsigned char*)in;
stream->avail_in = size;
}
void SetNextOut(char *out, unsigned int size) {
virtual void SetNextOut(char *out, unsigned int size) {
stream->next_out = (unsigned char*)out;
stream->avail_out = size;
}
@ -70,11 +69,11 @@ class CZlib : public ICompressor {
return stream->avail_out;
}
const TCHAR* GetName() {
virtual const TCHAR* GetName() {
return _T("zlib");
}
const TCHAR* GetErrStr(int err) {
virtual const TCHAR* GetErrStr(int err) {
switch (err)
{
case Z_STREAM_ERROR: