From 71343e117888b9e497f7e1dd25e73725ff34a861 Mon Sep 17 00:00:00 2001 From: turbocat Date: Mon, 7 Jun 2021 12:40:48 +0000 Subject: [PATCH] Minizip and Miniunz: - Deleted kos_dir.c - Fixed Makefiles - Added to autobuild git-svn-id: svn://kolibrios.org@8776 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/fs/minizip/Makefile.miniunz | 2 +- programs/fs/minizip/Makefile.minizip | 3 +- programs/fs/minizip/Tupfile.lua | 28 +++++++++++++++ programs/fs/minizip/kos_dir.c | 51 ---------------------------- 4 files changed, 31 insertions(+), 53 deletions(-) create mode 100644 programs/fs/minizip/Tupfile.lua delete mode 100755 programs/fs/minizip/kos_dir.c diff --git a/programs/fs/minizip/Makefile.miniunz b/programs/fs/minizip/Makefile.miniunz index 911f0bfe22..49504bbf3e 100755 --- a/programs/fs/minizip/Makefile.miniunz +++ b/programs/fs/minizip/Makefile.miniunz @@ -9,7 +9,7 @@ LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib -OBJECTS = miniunz.o unzip.o ioapi.o kos_dir.o +OBJECTS = miniunz.o unzip.o ioapi.o default: $(OBJECTS) kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o miniunz $(OBJECTS) -lgcc -lc.dll -lz.dll diff --git a/programs/fs/minizip/Makefile.minizip b/programs/fs/minizip/Makefile.minizip index 4c0cf809eb..e5aaa39910 100755 --- a/programs/fs/minizip/Makefile.minizip +++ b/programs/fs/minizip/Makefile.minizip @@ -9,10 +9,11 @@ LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib -OBJECTS = minizip.o zip.o ioapi.o kos_dir.o +OBJECTS = minizip.o zip.o ioapi.o default: $(OBJECTS) kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o minizip $(OBJECTS) -lgcc -lc.dll -lz.dll + strip -S minizip objcopy minizip -O binary %.o : %.c Makefile.minizip diff --git a/programs/fs/minizip/Tupfile.lua b/programs/fs/minizip/Tupfile.lua new file mode 100644 index 0000000000..bd2c0cef1e --- /dev/null +++ b/programs/fs/minizip/Tupfile.lua @@ -0,0 +1,28 @@ +if tup.getconfig("NO_GCC") ~= "" then return end +if tup.getconfig("HELPERDIR") == "" +then + HELPERDIR = "../.." +end +tup.include(HELPERDIR .. "/use_gcc.lua") +tup.include(HELPERDIR .. "/use_newlib.lua") + +CFLAGS = CFLAGS .. " -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -Dunix -I. -I../../../contrib/sdk/sources/zlib" + +LDFLAGS = LDFLAGS .. " --subsystem console -L../../../contrib/sdk/sources/zlib" + +table.insert(LIBDEPS,"../../../contrib/sdk/lib/") +LIBS = LIBS .. " -lz.dll" + +-- Compile -- +compile_gcc{ + "miniunz.c", "unzip.c", "ioapi.c", "minizip.c", "zip.c", +} + +-- Link miniunz +link_gcc({"miniunz.o", "unzip.o", "ioapi.o"},"miniunz") + +-- Link minizip +link_gcc({"minizip.o", "zip.o", "ioapi.o"}, "minizip") + + + diff --git a/programs/fs/minizip/kos_dir.c b/programs/fs/minizip/kos_dir.c deleted file mode 100755 index 1021fc4aa4..0000000000 --- a/programs/fs/minizip/kos_dir.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 2019-2021 Logaev Maxim (turbocat2001), GPLv3 */ - -#include -#include - -#pragma pack(push,1) -typedef struct { - unsigned p00; - unsigned long long p04; - unsigned p12; - unsigned p16; - char p20; - char *p21; -} kol_struct70; -#pragma pack(pop) - -int kol_file_70(kol_struct70 *k) -{ - asm volatile ("int $0x40"::"a"(70), "b"(k)); -} - -bool dir_operations(unsigned char fun_num, char *path) -{ - kol_struct70 inf; - inf.p00 = fun_num; - inf.p04 = 0; - inf.p12 = 0; - inf.p16 = 0; - inf.p20 = 0; - inf.p21 = path; - if(!kol_file_70(&inf)){ - return true; - } - else { - return false; - } -} - -int chdir(const char* cwd) -{ - __asm__ __volatile__( - "int $0x40" - ::"a"(30),"b"(1),"c"(cwd)); - - return 0; -} - -bool mkdir(const char* dir, int a) -{ - return dir_operations(9, (char*)dir); -}