diff -up upx-3.07-src/src/compress_lzma.cpp.use-lib upx-3.07-src/src/compress_lzma.cpp
--- upx-3.07-src/src/compress_lzma.cpp.use-lib 2010-09-08 11:07:00.000000000 -0400
+++ upx-3.07-src/src/compress_lzma.cpp 2011-08-09 14:43:45.097077927 -0400
@@ -340,11 +338,9 @@ error:
#undef _NO_EXCEPTIONS
#if (WITH_LZMA >= 0x449)
# define INITGUID 1
-//# include "CPP/7zip/Compress/LZMA/LZMADecoder.h"
# include "CPP/7zip/Compress/LZMA/LZMAEncoder.h"
#else
# include "C/Common/MyInitGuid.h"
-//# include "C/7zip/Compress/LZMA/LZMADecoder.h"
# include "C/7zip/Compress/LZMA/LZMAEncoder.h"
#endif
@@ -416,29 +412,6 @@ STDMETHODIMP ProgressInfo::SetRatioInfo(
# pragma warning(disable: 424) // #424: extra ";" ignored
#endif
-#if (WITH_LZMA >= 0x449)
-# include "C/Alloc.c"
-# include "C/7zCrc.c"
-# include "C/Compress/Lz/MatchFinder.c"
-//# include "CPP/7zip/Common/InBuffer.cpp"
-# include "CPP/7zip/Common/OutBuffer.cpp"
-# include "CPP/7zip/Common/StreamUtils.cpp"
-//# include "CPP/7zip/Compress/LZ/LZOutWindow.cpp"
-//# include "CPP/7zip/Compress/LZMA/LZMADecoder.cpp"
-# include "CPP/7zip/Compress/LZMA/LZMAEncoder.cpp"
-# include "CPP/7zip/Compress/RangeCoder/RangeCoderBit.cpp"
-#else
-# include "C/Common/Alloc.cpp"
-# include "C/Common/CRC.cpp"
-//# include "C/7zip/Common/InBuffer.cpp"
-# include "C/7zip/Common/OutBuffer.cpp"
-# include "C/7zip/Common/StreamUtils.cpp"
-# include "C/7zip/Compress/LZ/LZInWindow.cpp"
-//# include "C/7zip/Compress/LZ/LZOutWindow.cpp"
-//# include "C/7zip/Compress/LZMA/LZMADecoder.cpp"
-# include "C/7zip/Compress/LZMA/LZMAEncoder.cpp"
-# include "C/7zip/Compress/RangeCoder/RangeCoderBit.cpp"
-#endif
#undef RC_NORMALIZE
@@ -563,7 +536,6 @@ error:
#undef _LZMA_PROB32
#include "C/LzmaDec.h"
-#include "C/LzmaDec.c"
int upx_lzma_decompress ( const upx_bytep src, unsigned src_len,
@@ -662,10 +634,8 @@ error:
#undef _LZMA_LOC_OPT
#if (WITH_LZMA >= 0x449)
# include "C/Compress/Lzma/LzmaDecode.h"
-# include "C/Compress/Lzma/LzmaDecode.c"
#else
# include "C/7zip/Compress/LZMA_C/LzmaDecode.h"
-# include "C/7zip/Compress/LZMA_C/LzmaDecode.c"
#endif
int upx_lzma_decompress ( const upx_bytep src, unsigned src_len,
diff -up upx-3.07-src/src/Makefile.use-lib upx-3.07-src/src/Makefile
--- upx-3.07-src/src/Makefile.use-lib 2011-08-09 14:44:35.619476678 -0400
+++ upx-3.07-src/src/Makefile 2011-08-09 14:44:10.731772723 -0400
@@ -57,7 +57,7 @@ ifneq ($(wildcard $(UPX_UCLDIR)/include/
INCLUDES += -I$(UPX_UCLDIR)/include
LIBS += $(addprefix -L,$(dir $(wildcard $(UPX_UCLDIR)/libucl$(libext) $(UPX_UCLDIR)/src/.libs/libucl$(libext))))
endif
-LIBS += -lucl -lz
+LIBS += -lucl -lz -llzmasdk
# you should set envvar UPX_LZMADIR to point to your unpacked LZMA SDK
include $(top_srcdir)/src/stub/src/c/Makevars.lzma
ifneq ($(UPX_LZMA_VERSION),)
diff -up upx-3.07-src/src/stub/src/c/lzma_d_c.c.use-lib upx-3.07-src/src/stub/src/c/lzma_d_c.c
--- upx-3.07-src/src/stub/src/c/lzma_d_c.c.use-lib 2010-09-08 11:07:00.000000000 -0400
+++ upx-3.07-src/src/stub/src/c/lzma_d_c.c 2011-08-09 14:43:45.098077915 -0400
@@ -100,11 +100,6 @@ int LzmaDecode(CLzmaDecoderState *, cons
#if (ACC_CC_BORLANDC)
#include "LzmaDecode.c"
#else
-#if (WITH_LZMA >= 0x449)
-# include "C/Compress/Lzma/LzmaDecode.c"
-#else
-# include "C/7zip/Compress/LZMA_C/LzmaDecode.c"
-#endif
#endif
#undef char
#undef CLzmaDecoderState
--- upx-3.91-src/src/compress_lzma.cpp~ 2013-10-28 07:35:17.000000000 -0500
+++ upx-3.91-src/src/compress_lzma.cpp 2013-10-28 07:37:45.121258359 -0500
@@ -233,8 +233,6 @@
#define _7ZIP_ST 1
#define kLiteralNextStates kLiteralNextStates_enc
#include "C/LzmaEnc.h"
-#include "C/LzmaEnc.c"
-#include "C/LzFind.c"
#undef kLiteralNextStates
#undef kNumFullDistances