Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2.     TinyCC
  3.     ======
  4.  
  5.     This file contains specific information for usage of TinyCC
  6.     under MS-Windows.  See tcc-doc.html to have all the features.
  7.  
  8.  
  9.     Installation from the binary ZIP package:
  10.     -----------------------------------------
  11.     Unzip the package to a directory of your choice.
  12.    
  13.  
  14.     Set the system PATH:
  15.     --------------------
  16.     To be able to invoke the compiler from everywhere on your computer by
  17.     just typing "tcc", please add the directory containing tcc.exe to your
  18.     system PATH.
  19.  
  20.  
  21.     Include and library search paths
  22.     --------------------------------
  23.     On windows,  the standard "include" and "lib" directories are searched
  24.     relatively from the location of the executables (tcc.exe, libtcc.dll).
  25.  
  26.  
  27.     Examples:
  28.     ---------
  29.     Open a console window (DOS box) and 'cd' to the examples directory.
  30.  
  31.     For the 'Fibonacci' example type:
  32.  
  33.         tcc fib.c
  34.  
  35.     For the 'Hello Windows' GUI example type:
  36.  
  37.         tcc hello_win.c
  38.  
  39.     For the 'Hello DLL' example type
  40.  
  41.         tcc -shared dll.c
  42.         tiny_impdef dll.dll (optional)
  43.         tcc hello_dll.c dll.def
  44.  
  45.  
  46.     Using libtcc as JIT compiler in your program
  47.     --------------------------------------------
  48.     Check out the 'libtcc_test' example:
  49.  
  50.     - Running it from source:
  51.         tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c
  52.  
  53.     - Compiling with TCC:
  54.         tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
  55.  
  56.     - Compiling with MinGW:
  57.         gcc examples/libtcc_test.c -I libtcc libtcc.dll
  58.  
  59.     - Compiling with MSVC:
  60.         lib /def:libtcc\libtcc.def /out:libtcc.lib
  61.         cl /MD examples/libtcc_test.c -I libtcc libtcc.lib
  62.  
  63.  
  64.     Import Definition Files:
  65.     ------------------------
  66.     To link with Windows system DLLs, TCC uses import definition
  67.     files (.def) instead of libraries.
  68.  
  69.     The included 'tiny_impdef' program may be used to make additional
  70.     .def files for any DLL. For example:
  71.  
  72.         tiny_impdef.exe opengl32.dll
  73.  
  74.     Put opengl32.def into the tcc/lib directory.  Specify -lopengl32 at
  75.     the TCC commandline to link a program that uses opengl32.dll.
  76.  
  77.  
  78.     Header Files:
  79.     -------------
  80.     The system header files (except _mingw.h) are from the MinGW
  81.     distribution:
  82.  
  83.         http://www.mingw.org/
  84.  
  85.     From the windows headers, only a minimal set is included.  If you need
  86.     more,  get MinGW's "w32api" package.  Extract the files from "include"
  87.     into your "tcc/include/winapi" directory.
  88.  
  89.  
  90.     Resource Files:
  91.     ---------------
  92.     TCC can link windows resources in coff format as generated by MinGW's
  93.     windres.exe.  For example:
  94.  
  95.         windres -O coff app.rc -o appres.o
  96.         tcc app.c appres.o -o app.exe
  97.  
  98.  
  99.     Tiny Libmaker:
  100.     --------------
  101.     The included tiny_libmaker tool by Timovj Lahde can be used as
  102.     'ar' replacement to make a library from several object files:
  103.  
  104.         tiny_libmaker [rcs] library objectfiles ...
  105.  
  106.  
  107.     Compilation from source:
  108.     ------------------------
  109.     * You can use the MinGW and MSYS tools available at
  110.  
  111.         http://www.mingw.org
  112.  
  113.       Untar the TCC archive and type in the MSYS shell:
  114.  
  115.         ./configure [--prefix installpath]
  116.         make
  117.         make install
  118.  
  119.     The default install location is c:\Program Files\tcc
  120.  
  121.     * Alternatively you can compile TCC with just GCC from MinGW using
  122.  
  123.         build-tcc.bat (from the win32 directory)
  124.  
  125.       To install, copy the entire contents of the win32 directory to
  126.       where you want.
  127.  
  128.  
  129.     Limitations:
  130.     ------------
  131.     - On the object file level, currently TCC supports only the ELF format,
  132.       not COFF as used by MinGW and MSVC.  It is not possible to exchange
  133.       object files or libraries between TCC and these compilers.  However
  134.       libraries for TCC from objects by TCC can be made using tiny_libmaker
  135.       or MinGW's ar.
  136.  
  137.     - No leading underscore is generated in the ELF symbols.
  138.  
  139.     - Bounds checking (option -b) is not supported on 64-bit OS.
  140.  
  141.  
  142.     Documentation and License:
  143.     --------------------------
  144.     TCC is distributed under the GNU Lesser General Public License. (See
  145.     COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html)
  146.  
  147.     TinyCC homepage is at:
  148.  
  149.         http://fabrice.bellard.free.fr/tcc/
  150.  
  151.  
  152.     WinAPI Help and 3rd-party tools:
  153.     --------------------------------
  154.     The Windows API documentation (Win95) in a single .hlp file is
  155.     available on the lcc-win32 site as "win32hlp.exe" or from other
  156.     locations as "win32hlp_big.zip".
  157.  
  158.     A nice RAD tool to create windows resources (dialog boxes etc.) is
  159.     "ResEd", available at the RadASM website.
  160.  
  161.  
  162.     --- grischka
  163.