From 23e31695bd84a7acbbf3ee279cce85b28751aad2 Mon Sep 17 00:00:00 2001 From: turbocat Date: Tue, 18 Jan 2022 19:50:12 +0000 Subject: [PATCH] Whois: Now uses auto-import. git-svn-id: svn://kolibrios.org@9658 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/whois/Tupfile.lua | 21 ++++++++++----------- programs/network/whois/whois.c | 5 +---- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/programs/network/whois/Tupfile.lua b/programs/network/whois/Tupfile.lua index 5b84f97436..5186b20bed 100644 --- a/programs/network/whois/Tupfile.lua +++ b/programs/network/whois/Tupfile.lua @@ -1,11 +1,10 @@ -if tup.getconfig("NO_TCC") ~= "" then return end - -TCC="kos32-tcc" - -CFLAGS = "-I../../develop/ktcc/trunk/libc.obj/include" -LDFAGS = "-nostdlib -L../../develop/ktcc/trunk/bin/lib ../../develop/ktcc/trunk/bin/lib/crt0.o" - -LIBS = "-ltcc -lnetwork -lc.obj" - -COMMAND=string.format("%s %s %s %s %s", TCC, CFLAGS, LDFAGS, "%f -o %o", LIBS) -tup.rule("whois.c", COMMAND .. tup.getconfig("KPACK_CMD"), "whois") +if tup.getconfig("NO_TCC") ~= "" then return end +if tup.getconfig("HELPERDIR") == "" +then + HELPERDIR = "../../../programs" +end +tup.include(HELPERDIR .. "/use_tcc.lua") + +LIBS = "-lnetwork" + +link_tcc("whois.c", "whois"); diff --git a/programs/network/whois/whois.c b/programs/network/whois/whois.c index c728c6e3ff..8b68b1b7c7 100644 --- a/programs/network/whois/whois.c +++ b/programs/network/whois/whois.c @@ -5,8 +5,6 @@ https://www.binarytides.com/whois-client-code-in-c-with-linux-sockets/ */ #include -int errno; - #include #include #include @@ -41,7 +39,6 @@ char* str_copy(char*); int main(int argc , char *argv[]) { - networklib_init(); char *domain , *data = NULL; int f_flag=0; @@ -60,7 +57,7 @@ int main(int argc , char *argv[]) exit(0); } if(out==stdout){ - con_init_opt(-1,-1,-1,-1, "Whois"); + (*con_init_opt)(-1,-1,-1,-1, "Whois"); } get_whois_data(domain , &data); exit(0);