From e4f4eace1cac97c3d473be6554177e7ec1425a8f Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 17 Dec 2007 05:54:08 +0100 Subject: [PATCH] Added support for LZMA SDK 4.57. Compiles, but pretty much untested. --- src/compress_lzma.cpp | 8 +++++--- src/stub/src/arch/i086/Makefile.extra | 2 +- src/stub/src/c/Makevars.lzma | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/compress_lzma.cpp b/src/compress_lzma.cpp index 3db87002..0b34e09a 100644 --- a/src/compress_lzma.cpp +++ b/src/compress_lzma.cpp @@ -545,12 +545,14 @@ int upx_lzma_test_overlap ( const upx_bytep buf, const char *upx_lzma_version_string(void) { -#if (WITH_LZMA == 0x449) +#if (WITH_LZMA + 0 == 0x457) + return "4.57"; +#elif (WITH_LZMA + 0 == 0x449) return "4.49"; -#elif (WITH_LZMA == 0x443) +#elif (WITH_LZMA + 0 == 0x443) return "4.43"; #else -# error "unknown version" +# error "unknown WITH_LZMA version" return NULL; #endif } diff --git a/src/stub/src/arch/i086/Makefile.extra b/src/stub/src/arch/i086/Makefile.extra index 85195270..9aff45ab 100644 --- a/src/stub/src/arch/i086/Makefile.extra +++ b/src/stub/src/arch/i086/Makefile.extra @@ -107,7 +107,7 @@ $c += -O1 -1 $c += -w $c += -D__INT_MAX__=32767 $c += -DWITH_LZMA=$(UPX_LZMA_VERSION) -ifeq ($(UPX_LZMA_VERSION),0x449) +ifneq ($(findstring .$(UPX_LZMA_VERSION).,.0x449.0x457.),) $c += -I$(subst \,/,$(call winedir_w,$(UPX_LZMADIR)/C/Compress/Lzma)) else $c += -I$(subst \,/,$(call winedir_w,$(UPX_LZMADIR)/C/7zip/Compress/LZMA_C)) diff --git a/src/stub/src/c/Makevars.lzma b/src/stub/src/c/Makevars.lzma index 2b3efbae..004e2969 100644 --- a/src/stub/src/c/Makevars.lzma +++ b/src/stub/src/c/Makevars.lzma @@ -1,7 +1,9 @@ # you should set envvar UPX_LZMADIR to point to your unpacked LZMA SDK lzma443.tar.bz2 # NOTE: only version 4.43 is currently sufficiently tested ! -ifneq ($(wildcard $(UPX_LZMADIR)/CPP/7zip/.),) +ifneq ($(wildcard $(UPX_LZMADIR)/C/CpuArch.h),) +UPX_LZMA_VERSION = 0x457 +else ifneq ($(wildcard $(UPX_LZMADIR)/CPP/7zip/.),) UPX_LZMA_VERSION = 0x449 else ifneq ($(wildcard $(UPX_LZMADIR)/C/7zip/.),) UPX_LZMA_VERSION = 0x443