From 030d46f21804d8dd82edf7d5d2875e8f034dd86a Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 28 Aug 2010 23:09:29 +0200 Subject: attempt to get tiny C for i386 to work --- rod/tccgen.nim | 3 ++- tinyc/config.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rod/tccgen.nim b/rod/tccgen.nim index 0a588fda0..ca7bac193 100755 --- a/rod/tccgen.nim +++ b/rod/tccgen.nim @@ -30,6 +30,8 @@ proc addFile(filename: string) = proc setupEnvironment = when defined(amd64): defineSymbol(gTinyC, "__x86_64__", nil) + elif defined(i386): + defineSymbol(gTinyC, "__i386__", nil) when defined(linux): defineSymbol(gTinyC, "__linux__", nil) defineSymbol(gTinyC, "__linux", nil) @@ -40,7 +42,6 @@ proc setupEnvironment = addSysincludePath(gTinyC, nimrodDir / "tinyc/win32/include") addSysincludePath(gTinyC, nimrodDir / "tinyc/include") when defined(windows): - defineSymbol(gTinyC, "__i386__", nil) defineSymbol(gTinyC, "_WIN32", nil) # we need Mingw's headers too: var gccbin = getConfigVar("gcc.path") % ["nimrod", nimrodDir] diff --git a/tinyc/config.h b/tinyc/config.h index ceb34f784..edaf335bb 100755 --- a/tinyc/config.h +++ b/tinyc/config.h @@ -6,6 +6,11 @@ # define TCC_TARGET_PE 1 # define TCC_TARGET_I386 # define CONFIG_TCCDIR "." +#elif defined(__i386__) +# define TCC_TARGET_I386 +# define CONFIG_TCCDIR "/usr/local/lib/tcc" +# define GCC_MAJOR 4 +# define HOST_I386 1 #else # define TCC_TARGET_X86_64 # define CONFIG_TCCDIR "/usr/local/lib/tcc" -- cgit 1.4.1-2-gfad0