From e08cff4a2a1f3af5e4311534bc656c11f374c41d Mon Sep 17 00:00:00 2001 From: turbocat Date: Wed, 25 Aug 2021 18:30:26 +0000 Subject: [PATCH] ktcc: - added definitions of _KOLIBRI, _KOLIBRI, _KOLIBRI_ by default - added ktcc for Windows and Linux to autobuild git-svn-id: svn://kolibrios.org@9153 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/ktcc/trunk/source/Tupfile.lua | 4 ++++ programs/develop/ktcc/trunk/source/libtcc.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/programs/develop/ktcc/trunk/source/Tupfile.lua b/programs/develop/ktcc/trunk/source/Tupfile.lua index 424e669551..2fec825db8 100644 --- a/programs/develop/ktcc/trunk/source/Tupfile.lua +++ b/programs/develop/ktcc/trunk/source/Tupfile.lua @@ -6,3 +6,7 @@ CFLAGS = "-U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32" compile_gcc{"tcc.c"} compile_gcc{"libtcc.c"} link_gcc("tcc") + +CFLAGS = " -static -m32 -DTCC_TARGET_MEOS_LINUX " +tup.rule({"tcc.c", "libtcc.c"}, "gcc" .. CFLAGS .. "%f -o %o" , "kos32-tcc") +tup.rule({"tcc.c", "libtcc.c"}, "i686-w64-mingw32-gcc" .. CFLAGS .. "%f -o %o" , "kos32-tcc.exe") diff --git a/programs/develop/ktcc/trunk/source/libtcc.c b/programs/develop/ktcc/trunk/source/libtcc.c index 54850452f8..bdb0b24a10 100644 --- a/programs/develop/ktcc/trunk/source/libtcc.c +++ b/programs/develop/ktcc/trunk/source/libtcc.c @@ -1174,6 +1174,10 @@ LIBTCCAPI TCCState *tcc_new(void) # ifdef TCC_TARGET_X86_64 tcc_define_symbol(s, "_WIN64", NULL); # endif +#elif defined(TCC_TARGET_MEOS) || defined(TCC_TARGET_MEOS_LINUX) + tcc_define_symbol(s, "KOLIBRI", NULL); + tcc_define_symbol(s, "_KOLIBRI", NULL); + tcc_define_symbol(s, "_KOLIBRI_",NULL); #else tcc_define_symbol(s, "__unix__", NULL); tcc_define_symbol(s, "__unix", NULL); @@ -1196,7 +1200,7 @@ LIBTCCAPI TCCState *tcc_new(void) tcc_define_symbol(s, "__NetBSD__", str( __NetBSD__)); # undef str # endif - + /* TinyCC & gcc defines */ #if defined TCC_TARGET_PE && defined TCC_TARGET_X86_64 tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned long long");