2021-01-08 12:06:19 +01:00
|
|
|
if tup.getconfig("NO_GCC") ~= "" then return end
|
|
|
|
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../../programs" or tup.getconfig("HELPERDIR")
|
|
|
|
tup.include(HELPERDIR .. "/use_gcc.lua")
|
|
|
|
tup.include(HELPERDIR .. "/use_newlib.lua")
|
|
|
|
|
2024-05-21 16:45:21 +02:00
|
|
|
VAR_LIB = tup.getvariantdir() .. "/../../lib"
|
|
|
|
|
|
|
|
LDFLAGS = " -shared -s -T dll.lds --entry _DllStartup --image-base=0 --out-implib " .. VAR_LIB .. "/libz.dll.a -L" .. VAR_LIB
|
2021-06-05 23:12:11 +02:00
|
|
|
|
2021-01-08 12:06:19 +01:00
|
|
|
CFLAGS = CFLAGS .. " -DHAVE_UNISTD_H -U_Win32 -U_WIN32 -U__MINGW32__"
|
|
|
|
|
|
|
|
compile_gcc{"adler32.c", "compress.c", "crc32.c", "deflate.c", "gzclose.c", "gzlib.c", "gzread.c", "gzwrite.c", "infback.c", "inffast.c", "inflate.c", "inftrees.c", "trees.c", "uncompr.c", "zutil.c"}
|
2021-06-05 23:12:11 +02:00
|
|
|
|
2021-06-06 03:51:04 +02:00
|
|
|
OBJS.extra_inputs = {"../../lib/<libc.dll.a>", "../../lib/<libdll.a>"}
|
2021-06-05 23:44:42 +02:00
|
|
|
|
2024-05-21 16:45:21 +02:00
|
|
|
tup.rule(OBJS, "kos32-ld zlib.def " .. LDFLAGS .. " -o %o %f -lgcc -lc.dll -ldll " .. tup.getconfig("KPACK_CMD"),
|
2021-06-05 23:12:11 +02:00
|
|
|
{"../../bin/libz.dll", extra_outputs = {"../../lib/libz.dll.a", "../../lib/<libz.dll.a>"}})
|