Initial commit

This commit is contained in:
domenico
2025-06-24 15:51:28 +02:00
commit 22031d9dab
6862 changed files with 1462554 additions and 0 deletions

36
tools/lzma/Makefile Normal file
View File

@@ -0,0 +1,36 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=lzma
PKG_VERSION:=4.65
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
PKG_HASH:=dcbdb5f4843eff638e4a5e8be0e2486a3c5483df73c70823618db8e66f609ec2
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/host-build.mk
UTIL_DIR=$(HOST_BUILD_DIR)/C/LzmaUtil
ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Compress/LZMA_Alone
define Host/Compile
$(MAKE) -C $(UTIL_DIR) -f makefile.gcc
$(MAKE) -C $(ALONE_DIR) -f makefile.gcc
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/CPP/7zip/Compress/LZMA_Alone/lzma_alone $(STAGING_DIR_HOST)/bin/lzma
endef
define Host/Clean
endef
$(eval $(call HostBuild))

View File

@@ -0,0 +1,13 @@
Index: lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
===================================================================
--- lzma-4.65.orig/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-05-15 23:33:51.000000000 +0200
+++ lzma-4.65/CPP/7zip/Compress/LZMA_Alone/makefile.gcc 2009-06-01 22:00:54.000000000 +0200
@@ -3,7 +3,7 @@
CXX_C = gcc -O2 -Wall
LIB = -lm
RM = rm -f
-CFLAGS = -c
+CFLAGS = -c -D_FILE_OFFSET_BITS=64
ifdef SystemDrive
IS_MINGW = 1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
diff -urN lzma-4.65/CPP/7zip/Common/FileStreams.h lzma-4.65.new/CPP/7zip/Common/FileStreams.h
--- lzma-4.65/CPP/7zip/Common/FileStreams.h 2009-05-15 23:33:51.000000000 +0200
+++ lzma-4.65.new/CPP/7zip/Common/FileStreams.h 2009-06-01 22:30:01.000000000 +0200
@@ -72,6 +72,7 @@
public IOutStream,
public CMyUnknownImp
{
+public:
#ifdef USE_WIN_FILE
NWindows::NFile::NIO::COutFile File;
#else
diff -urN lzma-4.65/CPP/Common/MyWindows.h lzma-4.65.new/CPP/Common/MyWindows.h
--- lzma-4.65/CPP/Common/MyWindows.h 2009-05-15 23:33:51.000000000 +0200
+++ lzma-4.65.new/CPP/Common/MyWindows.h 2009-06-01 22:29:26.000000000 +0200
@@ -101,8 +101,11 @@
#ifdef __cplusplus
+#ifndef INITGUID
+#define INITGUID
DEFINE_GUID(IID_IUnknown,
0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+#endif
struct IUnknown
{
STDMETHOD(QueryInterface) (REFIID iid, void **outObject) PURE;

View File

@@ -0,0 +1,70 @@
--- a/C/LzmaUtil/makefile.gcc
+++ b/C/LzmaUtil/makefile.gcc
@@ -1,44 +1,53 @@
PROG = lzma
-CXX = g++
-LIB =
+CC = gcc
+LIB = liblzma.a
RM = rm -f
CFLAGS = -c -O2 -Wall
+AR = ar
+RANLIB = ranlib
OBJS = \
- LzmaUtil.o \
Alloc.o \
LzFind.o \
LzmaDec.o \
LzmaEnc.o \
+ LzmaLib.o \
7zFile.o \
7zStream.o \
-
all: $(PROG)
-$(PROG): $(OBJS)
- $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)
+$(PROG): LzmaUtil.o $(LIB)
+ $(CC) -o $(PROG) $(LDFLAGS) $< $(LIB)
LzmaUtil.o: LzmaUtil.c
- $(CXX) $(CFLAGS) LzmaUtil.c
+ $(CC) $(CFLAGS) LzmaUtil.c
+
+$(LIB): $(OBJS)
+ rm -f $@
+ $(AR) rcu $@ $(OBJS)
+ $(RANLIB) $@
Alloc.o: ../Alloc.c
- $(CXX) $(CFLAGS) ../Alloc.c
+ $(CC) $(CFLAGS) ../Alloc.c
LzFind.o: ../LzFind.c
- $(CXX) $(CFLAGS) ../LzFind.c
+ $(CC) $(CFLAGS) ../LzFind.c
LzmaDec.o: ../LzmaDec.c
- $(CXX) $(CFLAGS) ../LzmaDec.c
+ $(CC) $(CFLAGS) ../LzmaDec.c
LzmaEnc.o: ../LzmaEnc.c
- $(CXX) $(CFLAGS) ../LzmaEnc.c
+ $(CC) $(CFLAGS) ../LzmaEnc.c
+
+LzmaLib.o: ../LzmaLib.c
+ $(CC) $(CFLAGS) ../LzmaLib.c
7zFile.o: ../7zFile.c
- $(CXX) $(CFLAGS) ../7zFile.c
+ $(CC) $(CFLAGS) ../7zFile.c
7zStream.o: ../7zStream.c
- $(CXX) $(CFLAGS) ../7zStream.c
+ $(CC) $(CFLAGS) ../7zStream.c
clean:
- -$(RM) $(PROG) $(OBJS)
+ -$(RM) $(PROG) *.o *.a

View File

@@ -0,0 +1,20 @@
--- a/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
+++ b/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
@@ -101,6 +101,8 @@ static const int kNumSwitches = sizeof(k
static void PrintHelp()
{
+ fprintf(stderr, "\nLZMA " MY_VERSION_COPYRIGHT_DATE "\n");
+
fprintf(stderr, "\nUsage: LZMA <e|d> inputFile outputFile [<switches>...]\n"
" e: encode file\n"
" d: decode file\n"
@@ -168,8 +170,6 @@ int main2(int n, const char *args[])
g_IsNT = IsItWindowsNT();
#endif
- fprintf(stderr, "\nLZMA " MY_VERSION_COPYRIGHT_DATE "\n");
-
if (n == 1)
{
PrintHelp();