WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tcc.{tce,tcz}  (Read 2703 times)

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9661
tcc.{tce,tcz}
« on: January 12, 2009, 06:50:39 PM »
Here is tcc.tce and tcc.tcz, the Tiny C Compiler.

Code: [Select]
Title:          tcc.tce
Description:    Tiny C compiler.
Version:        0.9.24
Author:         Fabrice Bellard
Original-site:  http://bellard.org/tcc/
Copying-policy: LGPL
Size: 227KB
Extension_by:   Jason W
Comments:       Built with-----
export PKG=/mnt/hda2/tcc
export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
./configure --prefix=/usr/local
make
make prefix=$PKG/usr/local \
      bindir=$PKG/usr/local/bin \
      tccdir=$PKG/usr/local/lib/tcc \
      libdir=$PKG/usr/local/lib \
      includedir=$PKG/usr/local/include \
      mandir=$PKG/usr/local/man \
      docdir=$PKG/usr/local/share/tcc/doc \
      install
Change-log:     First version
Current:        2009/01/12

Offline florian

  • Full Member
  • ***
  • Posts: 116
    • Home Page
Re: tcc.{tce,tcz}
« Reply #1 on: January 13, 2009, 10:05:39 AM »
tcc is great!
I like it for it compiles ultra fast and can be used for C scripting by add this shebang in front on top of your C file:
Code: [Select]
#!/usr/local/bin/tcc -run

<crazy talk>is there a C wrapper for FLTK? It would allow to write GUI scripts instead of having binaries</crazy talk>

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9661
Re: tcc.{tce,tcz}
« Reply #2 on: January 13, 2009, 10:23:12 AM »
It does work fast.  Leafpad compiled with tcc in 9 seconds, and it took gcc 28 seconds to do the same.  I didn't test the resulting binaries much for comparison, but I was impressed with the fast compile time.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10050
Re: tcc.{tce,tcz}
« Reply #3 on: January 13, 2009, 11:03:01 AM »
@florian: No, but as long as you don't use the special features of C++, you can just mix-n-match; the only C++ parts will be the FLTK interfacing ones, everything else in C, using only C includes. See the watcher source for the project that helped me realize this would work :)

edit: But you do have to compile it with g++ and link with stdc++ for it to work. So I guess tcc is out of the question..
The only barriers that can stop you are the ones you create yourself.