tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Compiling tcc under Windows using tcc?


From: Tom Hartnett
Subject: Re: [Tinycc-devel] Compiling tcc under Windows using tcc?
Date: Thu, 01 Dec 2011 17:14:27 -0500
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 11/30/2011 12:44 AM, Xianwen Chen wrote:
Hi,

I was reading the tcc win32 compiling help file (http://repo.or.cz/w/tinycc.git/blob/HEAD:/win32/tcc-win32.txt) and failed to find information on compiling tcc using tcc.

Here is my thought. First, since tcc is able to compile c programs under Windows. Isn't it possible to compile tcc itself? Second, as tcc can compile programs without using MinGW or Cygwin, is it possible to compile tcc itself without using MinGW or Cygwin?

Any comment? ;)

Kind regards,

Xianwen


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Xianwen,

I use TCC (win32) to compile TCC "all the time" under Cygwin, MinGW, *AND* Windows ("DOS").

But first, some particulars about my environment:
1. I run Window XP and/or Windows 7.
2. I am really only interested in "console" apps (i.e., main(argc, argv) stuff).  (I also do a lot of embedded stuff and in that case I have my own version of CRT1 and there are no DLLs involved at all.)
3. When I compile TCC under MinGW, Cygwin, or ** cmd.exe ** (i.e., a "DOS" window), it works.. and the only DLLs it picks up are MSVCRT.DLL and KERNEL32.DLL, so it pretty much works in any (Windows) environment.
4. I also organized the directories slightly differently than the "standard" 0.9.25 distribution (mostly, I have SRC, LIB, and INCLUDE subdirectories, instead of having the source in the same directory and/or the parent directory of where I'm building the compiler.
5. I use a makefile and/or a bash script for building under MinGW or Cygwin, but in "DOS" I use a simple batch file (below).
6. I modified the source code so that the "TCC_VERSION" is a string that includes the TCC_VERSION of the compiler that I used to "compile the compiler" (a TCC "family tree").

With all those caveats.. here is the batch script I use to build TCC.  (I have the 0.9.25 distribution copy of TCC in c:\tcc\win32.)
c:\tcc\win32\tcc -DTCC_VERSION="\"0.9.25 (tmp)\"" -o tcc.exe src\tcc.c

tcc -o libmaker.exe src/tools/libmaker.c src/lib/crt1.c
tcc -o impdef.exe src/tools/impdef.c src/lib/crt1.c

tcc -c src/lib/crt1.c
tcc -c src/lib/chkstk.S
tcc -c src/lib/libtcc1.c
tcc -c src/lib/alloca86.S
libmaker rcs lib/libtcc1.a crt1.o chkstk.o libtcc1.o alloca86.o
I don't expect this to be directly useful to you, except to say that (a) your though about using TCC to build TCC *without* Cygwin or MinGW is right on the money, and (b) it's fairly simple.

If any of this doesn't make sense, just shoot me a reply.

Regards,

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]