Minizip and Miniunz:

- Deleted kos_dir.c
- Fixed Makefiles
- Added to autobuild

git-svn-id: svn://kolibrios.org@8776 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2021-06-07 12:40:48 +00:00
parent b1b61a4f19
commit 71343e1178
4 changed files with 31 additions and 53 deletions

View File

@ -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

View File

@ -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

View File

@ -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/<libz.dll.a>")
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")

View File

@ -1,51 +0,0 @@
/* Copyright (C) 2019-2021 Logaev Maxim (turbocat2001), GPLv3 */
#include <stdlib.h>
#include <stdbool.h>
#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);
}