Browse Source

Import TIGCC/*nix-specific files.

git-svn-id: file:///var/svn/tigccpp/branches/tigcc_linux@326 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 years ago
commit
e0b997bfbf
52 changed files with 5368 additions and 0 deletions
  1. 52 0
      tigcc-linux/AUTHORS
  2. 3 0
      tigcc-linux/BUGS
  3. 575 0
      tigcc-linux/CHANGELOG
  4. 340 0
      tigcc-linux/COPYING
  5. 26 0
      tigcc-linux/DIRECTORIES
  6. 16 0
      tigcc-linux/HOWTO
  7. 286 0
      tigcc-linux/INSTALL
  8. 21 0
      tigcc-linux/Install.sh
  9. 232 0
      tigcc-linux/README.linux
  10. 98 0
      tigcc-linux/README.osX
  11. 21 0
      tigcc-linux/scripts/Install
  12. 11 0
      tigcc-linux/scripts/Install_All
  13. 10 0
      tigcc-linux/scripts/Install_All_nopatch
  14. 55 0
      tigcc-linux/scripts/Install_step_1
  15. 10 0
      tigcc-linux/scripts/Install_step_2
  16. 16 0
      tigcc-linux/scripts/Install_step_3
  17. 10 0
      tigcc-linux/scripts/Install_step_4
  18. 38 0
      tigcc-linux/scripts/Install_step_5
  19. 25 0
      tigcc-linux/scripts/SCRIPTS
  20. 10 0
      tigcc-linux/scripts/launch.a68k
  21. 70 0
      tigcc-linux/scripts/launch.binutils
  22. 10 0
      tigcc-linux/scripts/launch.envreg
  23. 49 0
      tigcc-linux/scripts/launch.gcc
  24. 11 0
      tigcc-linux/scripts/launch.ld-tigcc
  25. 10 0
      tigcc-linux/scripts/launch.patcher
  26. 10 0
      tigcc-linux/scripts/launch.tigcc
  27. 10 0
      tigcc-linux/scripts/launch.tprbuilder
  28. 18 0
      tigcc-linux/scripts/package_bin
  29. 14 0
      tigcc-linux/scripts/package_src
  30. 44 0
      tigcc-linux/scripts/updatedoc
  31. 115 0
      tigcc-linux/scripts/updatesrc
  32. 12 0
      tigcc-linux/sources/DIRECTORIES
  33. 1 0
      tigcc-linux/sources/envreg/AUTHORS
  34. 340 0
      tigcc-linux/sources/envreg/COPYING
  35. 8 0
      tigcc-linux/sources/envreg/ChangeLog
  36. 29 0
      tigcc-linux/sources/envreg/README
  37. 16 0
      tigcc-linux/sources/envreg/src/Makefile
  38. 200 0
      tigcc-linux/sources/envreg/src/envreg.c
  39. 2 0
      tigcc-linux/sources/patcher/AUTHORS
  40. 340 0
      tigcc-linux/sources/patcher/COPYING
  41. 68 0
      tigcc-linux/sources/patcher/ChangeLog
  42. 29 0
      tigcc-linux/sources/patcher/README
  43. 16 0
      tigcc-linux/sources/patcher/src/Makefile
  44. 264 0
      tigcc-linux/sources/patcher/src/patcher.c
  45. 35 0
      tigcc-linux/sources/patcher/src/patcher.h
  46. 7 0
      tigcc-linux/sources/tigcc/AUTHORS
  47. 340 0
      tigcc-linux/sources/tigcc/COPYING
  48. 162 0
      tigcc-linux/sources/tigcc/ChangeLog
  49. 81 0
      tigcc-linux/sources/tigcc/README
  50. 16 0
      tigcc-linux/sources/tigcc/src/Makefile
  51. 1088 0
      tigcc-linux/sources/tigcc/src/tigcc.c
  52. 98 0
      tigcc-linux/sources/tigcc/src/tigcc.h

+ 52 - 0
tigcc-linux/AUTHORS

@@ -0,0 +1,52 @@
+Current maintainer:
+===================
+
+Kevin Kofler
+	web: http://tigcc.ticalc.org/linux/
+	mail: Kevin@tigcc.ticalc.org
+
+
+Previous maintainers/developers :
+=================================
+
+Romain Lievin: Linux platform
+	web: http://lpg.ticalc.org/prj_tigcc/index.html
+	mail: roms@lpg.ticalc.org
+
+John David Ratliff: UNIX platforms
+	web: http://www.technoplaza.org
+	mail: jdratlif@cs.indiana.edu
+
+
+Creator of the TIGCC/Linux project :
+====================================
+
+Henri Moilanen <henri.moilanen@pp.phnet.fi>
+
+
+(Former?) packagers :
+=====================
+
+- Julien Blache <jb@jblache.org>: Linux Debian
+- Benjamin Gordon: <ben@bxg.org>: Linux Redhat
+
+
+Parts :
+=======
+
+Some programs included in this package are from the following authors:
+- GCC and binutils: Free Software Foundation and various contributors
+- A68k: originally by Brian Anderson and Charlie Gibbs, now maintained by Kevin
+        Kofler
+        fixes contributed by Kevin Kofler, Paul Froissart, Julien Muchembled
+        and David Ellsworth
+- ld-tigcc and ar-tigcc: linker by Sebastian Reichelt and Kevin Kofler
+- TIGCC Tools Suite: the TICT (TI-Chess Team), Thomas Nussbaumer
+- GCC and as patch: maintained by Kevin Kofler <Kevin@tigcc.ticalc.org> and
+                    Sebastian Reichelt <Sebastian@tigcc.ticalc.org>
+                    If you think that you have found a bug in the compiler, you
+                    should fill out a bug report form at
+                    http://tigcc.ticalc.org . (Don't forget to fill in your OS.
+                    It might be a problem with the Linux/Unix port.)
+- patcher: Kevin Kofler (and a few lines by Romain Liévin)
+- parser: Kevin Kofler

+ 3 - 0
tigcc-linux/BUGS

@@ -0,0 +1,3 @@
+List of known bugs:
+
+- Unlike the Win32 version, there is no IDE yet in the current release.

+ 575 - 0
tigcc-linux/CHANGELOG

@@ -0,0 +1,575 @@
+Changelog for TIGCC For Linux
+
+- 2005-12-18, CVS HEAD (Kevin Kofler)
+        * Updated import scripts to use a separate CVS checkout.
+        * Removed empty "ide" directory, KTIGCC will be distributed separately.
+        * TIGCC/*nix is now in CVS too.
+
+- 2005-10-02, version 0.96 beta 6 r1 (Kevin Kofler)
+        * Synced Win32 TIGCC 0.96 Beta 6 source tree.
+        * Updated installation instructions for the GCC update.
+        * Added support for -isystem in the command-line compiler.
+
+- 2005-07-02, version 0.96 beta 5 r1 (Kevin Kofler)
+        * Updated build system to Fedora Core 4.
+        * Fixed package_bin and updatedoc scripts for FC4 tar.
+        * Synced Win32 TIGCC 0.96 Beta 5 source tree.
+        * Updated build scripts for the Binutils update.
+        * Updated installation instructions for the GCC and Binutils updates.
+        * Using type (bash builtin) instead of which (broken on OS X) in the
+          installation wizards.
+        * Using $CC -v rather than $CC --version to check for Apple GCC because
+          the --version output doesn't always contain "Apple" for some reason.
+
+- 2005-04-30, version 0.96 beta 4 r1 (Kevin Kofler)
+        * Synced Win32 TIGCC 0.96 Beta 4 source tree.
+        * Ported patcher .ascii "_ROM_CALL_nnn" fix from Win32 TIGCC.
+        * Changed tigcc -g to use DWARF 2 debugging info instead of parser.
+        * Deleted parser.
+        * Fixed the default output name in the tigcc frontend.
+
+- 2005-03-24, version 0.96 beta 3 r1 (Kevin Kofler)
+        * Synced Win32 TIGCC 0.96 Beta 3 source tree.
+        * Build system for the binaries upgraded to Fedora Core 3.
+        * Updated build scripts for GCC 4.0.0 (prerelease).
+        * Added -fomit-frame-pointer to default CFLAGS.
+        * Fixed Apple GCC test to actually probe the chosen $CC, not "gcc".
+
+- 2005-02-09, version 0.96 beta 2 r1 (Kevin Kofler)
+        * Synced Win32 TIGCC 0.96 Beta 2 source tree.
+
+- 2005-02-02, version 0.96 beta 1 r1 (Kevin Kofler)
+        * Reorganized source tree slightly and wrote an import script for the
+          Win32 TIGCC CVS tree.
+        * Updated GNU as to 2.15.
+        * Synced Win32 TIGCC 0.96 Beta 1 source tree.
+        * Updated A68k to 2.71.F3u (fixes build with GCC 3.4).
+        * Fixed ld-tigcc reorder.c build with GCC 2.95/2.96.
+        * Using gcc34 -static-libgcc -Wdeclaration-after-statement instead of
+          GCC 2.96-rh to compile the binary.
+
+- 2004-11-13, version 0.95 r3 (Kevin Kofler)
+        * Fixed 0.95 r2 regression in the tigcc frontend: now works properly
+          again if no -Wa and/or -WA switch is used.
+
+- 2004-10-31, version 0.95 r2 (Kevin Kofler)
+        * Fixed verbosity switches in the tigcc frontend.
+        * Fixed handling of -Wa and -WA in the tigcc frontend.
+
+- 2004-10-25, version 0.95 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) to TIGCC 0.95.
+
+- 2004-10-16, version 0.95 beta 20 r1 (Kevin Kofler)
+        * Added scripts (regendoc.sh for Windows, updatedoc for Linux) to
+          automate the importing of the documentation.
+        * Updated TIGCCLIB (documentation and includes) to TIGCC 0.95 Beta 20.
+        * Updated ld-tigcc to 1.06.6 from TIGCC 0.95 Beta 20.
+        * Updated GCC to 3.3.3-tigcc-8.
+        * The install scripts no longer try to use X11-based dialog utilities
+          if no X11 connection is open.
+        * The install scripts now also work without a dialog program (by
+          presenting a simple bash-based interface). Set $DIALOG to "none" to
+          force this mode even if a dialog program is detected.
+
+- 2004-09-23, version 0.95 beta 19 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) to TIGCC 0.95
+          Beta 19.
+        * Updated ld-tigcc to 1.06.5 from TIGCC 0.95 Beta 19.
+        * Updated GNU as to 2.14-tigcc-11.
+        * Updated A68k to 2.71.F3s.
+        * Updated tprbuilder to 1.0.13.
+        * Fixed handling of multiple patches on the same line in patcher.
+        * The tigcc frontend now deletes leftover "-titanium" launchers when
+          rebuilding (relinking) a compressed program.
+        * tigcc --version now displays the TIGCC version.
+
+- 2004-09-06, version 0.95 beta 17 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) to TIGCC 0.95
+          Beta 17.
+        * Updated the ExePack launcher (pstarter.o) to ttstart-universal 1.21
+          (TIGCC 0.95 Beta 17). Dropped no longer needed pstarter-titanium.o.
+          Changed tigcc frontend accordingly.
+        * Updated ld-tigcc to 1.06.3 from TIGCC 0.95 Beta 17.
+        * Updated GNU as to 2.14-tigcc-10.
+        * The patcher now deletes any :w or (%pc) addressing for ROM_CALLs
+          which may be generated by the compiler for -mpcrel.
+
+- 2004-08-10, version 0.95 beta 16 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs and includes) to TIGCC 0.95 Beta 16.
+        * Updated the ExePack launchers (pstarter*.o) to the fixed ttstart
+          1.21 in TIGCC 0.95 Beta 16.
+        * Updated ld-tigcc to 1.06.2 from TIGCC 0.95 Beta 16.
+        * Updated GCC to 3.3.3-tigcc-7.
+        * Updated GNU as to 2.14-tigcc-9.
+        * Fixed handling of keyword disambiguators in chm2dcf.
+
+- 2004-08-06, version 0.95 beta 15 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (documentation and includes) to TIGCC 0.95 Beta 15.
+        * Updated the ExePack launchers (pstarter*.o) to ttstart 1.21.
+        * Updated ld-tigcc to 1.06.1 from TIGCC 0.95 Beta 15.
+        * Updated GCC to 3.3.3-tigcc-6.
+        * Updated GNU as to 2.14-tigcc-8.
+        * Updated tprbuilder to 1.0.12.
+        * Added support for string/constant merging to the tigcc frontend.
+        * The packaging scripts (package_*) now scan the distribution folders
+          for viruses before packaging them (as a precaution).
+        * The packaging scripts (package_*) no longer use verbose tar.
+        * Fixed compilation of ld-tigcc constmrg.c with GCC 2.95/2.96.
+
+- 2004-07-21, version 0.95 beta 13 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) to TIGCC 0.95
+          Beta 13.
+        * Updated ld-tigcc to 1.05.2 from TIGCC 0.95 Beta 13.
+        * Updated GCC to 3.3.3-tigcc-4.
+        * Updated GNU as to 2.14-tigcc-7.
+        * Updated A68k to 2.71.F3r.
+        * Fixed compilation of reorder.c with GCC 2.95/2.96 (again).
+
+- 2004-06-22, version 0.95 beta 11 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.95 Beta 11.
+        * Updated ld-tigcc to 1.05.1 from TIGCC 0.95 Beta 11.
+        * Updated GCC to 3.3.3-tigcc-3.
+        * Fixed output file handling in the command-line frontend.
+
+- 2004-06-14, version 0.95 beta 10 r2 (Kevin Kofler)
+        * Fixed omission of reorder.c in the ld-tigcc source code and the
+          resulting omission of ld-tigcc and ar-tigcc in the binaries.
+        * Fixed compilation of reorder.c with GCC 2.95/2.96.
+
+- 2004-06-11, version 0.95 beta 10 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and the ExePack
+          launchers to TIGCC 0.95 Beta 10.
+        * Updated ld-tigcc to 1.05.
+        * Updated tprbuilder to 1.0.11.
+        * Added support for section reordering to the tigcc frontend.
+        * OPTIMIZE_CALC_CONSTS now works with -mpcrel (patcher bugfix).
+
+- 2004-04-27, version 0.95 beta 8 r1 (Kevin Kofler)
+        * Updated TIGCCLIB documentation and includes to TIGCC 0.95 Beta 8.
+        * Updated tprbuilder to 1.0.9. (Why did I miss this before?)
+        * Added support for Flash OSes and fixed --clean in tprbuilder (1.0.10).
+
+- 2004-04-15, version 0.95 beta 7 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) to TIGCC 0.95 Beta
+          7.
+        * Updated ld-tigcc to 1.04.
+        * Updated GCC to 3.3.3-tigcc-2.
+        * Using --stdout instead of 2>&1 in the installation scripts.
+        * No longer using a temporary file in the installation scripts.
+        * Binary tarballs no longer contain a "usr/local/tigcc" path.
+        * Fixed all-reloc mode enabling in the tigcc frontend.
+        * Adding --keep-locals/-d when return optimization is enabled or for -ar
+          in the tigcc frontend, as in the Win32 Beta 7.
+        * Added Flash OS upgrade support to the tigcc frontend.
+
+- 2004-03-14, version 0.95 beta 6 r1 (Kevin Kofler)
+        * Handle keyword disambiguators in chm2dcf.
+        * Updated TIGCCLIB (libs, documentation and includes) to TIGCC 0.95 Beta
+          6.
+        * Updated GCC to 3.3.3-tigcc-1.
+        * Updated ld-tigcc to 1.03.
+        * Added support for Titanium ExePack.
+        * Updated -freg-relative detection in the patcher to Beta 6 behavior.
+        * The parser no longer crashes when passed an invalid line number by GCC
+          (ported from the corresponding tigcc.exe bugfix in Beta 6).
+
+- 2004-01-24, version 0.95 beta 5 r2 (Kevin Kofler)
+        * Added envreg tool to write $TIGCC and $PATH settings into bashrc.
+        * Added source installation wizard and binary installation wizard.
+
+- 2004-01-12, version 0.95 beta 5 r1 (Kevin Kofler)
+        * Updated some of the text documentation files.
+        * Removed unneeded scripts/utils directory.
+        * Filter out duplicate keyword entries in CHM to DCF converter.
+        * Fixed unescaped quotes around "3.2.0" in DCF to ADP converter.
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.95 Beta 5.
+        * Updated A68k to 2.71.F3q.
+        * Updated GCC to 3.3.1-tigcc-pre26.
+        * Now automatically deleting the temporary GCC/Binutils build directory.
+
+- 2003-12-29, version 0.95 beta 4 r4 (Kevin Kofler)
+        * Added DCF file for QT Assistant 3.1 to the documentation.
+        * Added untested ADP file for QT Assistant 3.2 to the documentation.
+        * Added shell script to launch QT Assistant 3.2 with the ADP file.
+
+- 2003-12-25, version 0.95 beta 4 r3 (Kevin Kofler)
+        * Fixed installation script typo reported by Christian Walther: the
+          parser is now actually installed.
+        * Now automatically creates $TIGCC if the directory doesn't exist yet.
+        * Updated README.osX with current information from Christian Walther.
+
+- 2003-12-24, version 0.95 beta 4 r2 (Kevin Kofler)
+        * Rewrote parser in C.
+
+- 2003-12-23, version 0.95 beta 4 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.95 Beta 4.
+        * Updated the ExePack launcher (pstarter.o) with the one updated by
+          Lionel Debroux, Sebastian Reichelt and me for TIGCC 0.95 Beta 4.
+        * Updated ld-tigcc to 1.02.
+        * Updated GCC to 3.3.1-tigcc-pre25.
+        * Updated A68k to 2.71.F3p.
+        * New build platform for the binaries (Fedora Core 1 instead of RedHat
+          7.3, but using compat-gcc).
+
+- 2003-10-19, version 0.95 beta 2 r1 (Kevin Kofler)
+        * Updated A68k to 2.71.F3o.
+        * Updated ld-tigcc to 1.01.
+        * Updated GCC to 3.3.1-tigcc-pre22b.
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.95 Beta 2.
+        * Updated patcher to match Win32 TIGCC 0.95 Beta 2 behavior.
+        * Fixed handling of -S and -c without -o in the tigcc frontend.
+        * Removed obsolete install.sh and clean.sh scripts.
+
+- 2003-09-28, version 0.95 beta 1 r1 (Kevin Kofler)
+        * Updated GCC to 3.3.1-tigcc-pre19 and Binutils to 2.14-tigcc-5.
+        * The installation scripts now remove unneeded Binutils and GCC
+          directories in step 1 (patching).
+        * No longer building AmigaOS objcopy in step 2, we don't need it
+          anymore.
+        * Now installing GNU as by hand rather than using Binutils make install.
+        * Other GCC and Binutils installation script cleanups.
+        * Updated A68k to 2.71.F3n (NOT the messed-up 2.71.F3m in TIGCC 0.95
+          Beta 1 for Windows, so the separate update is not needed here).
+        * Unautoconfiscated A68k. The configure script only wasted build time,
+          the results weren't even being used. Also removed the unmaintained
+          manpage.
+        * Replaced the obsolete obj2ti linker with the new TIGCC linker.
+        * Removed support for tipatch.lib and tipatchmain.lib in the patcher.
+        * Unautoconfiscated patcher.
+        * Unautoconfiscated the TIGCC frontend. The configure script only
+          wasted build time, the results weren't even being used. Also removed
+          the unmaintained manpage.
+        * Unautoconfiscated the TPRbuilder. Also removed the manpage, after
+          merging its contents into README.
+        * Updated patcher, TIGCC frontend and TPRbuilder to match Win32 TIGCC
+          0.95 Beta 1 behavior.
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.95 Beta 1.
+        * Updated the ExePack launcher (pstarter.o) with the one updated by
+          Lionel Debroux, Sebastian Reichelt and me for TIGCC 0.95 Beta 1.
+
+- 2003-09-18, version 0.94 SP4 r2 (Kevin Kofler)
+        * A few bugfixes in the tigcc frontend by Nils Gesbert and myself.
+
+- 2003-02-17, version 0.94 SP4 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.94 SP4.
+        * Fixed handling of 4-digit error codes in the patcher.
+
+- 2003-01-19, version 0.94 SP3 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.94 SP3.
+
+- 2002-12-22, version 0.94 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.94 (release).
+        * Updated GCC patch to 3.2.1-tigcc-2 as in the Win32 version of 0.94
+          (release).
+        * The Linux/x86 binary release now links libstdc++ statically into
+          obj2ti for compatibility reasons.
+
+- 2002-11-30, version 0.94 beta 22 r1 (Kevin Kofler)
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.94 beta 22.
+        * Updated GCC to 3.2.1-tigcc-1 as in the Win32 beta 22.
+        * Fixed a few bugs in the tigcc frontend.
+
+- 2002-11-16, version 0.94 beta 21 r1 (Kevin Kofler)
+        * NOTE: Beta 20 r1 was skipped because the Win32 beta 20 was immediately
+                superceded by beta 21, which fixed 2 bugs in beta 20.
+        * Updated some outdated Obj2Ti and tprbuilder documentation files.
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.94 beta 21.
+        * Updated Binutils to 2.13.1 as in the Win32 betas 20/21.
+        * (Hopefully) fixed tprbuilder compiling problem on IRIX reported by
+          John David Ratliff (can't test).
+        * (Hopefully) fixed obj2ti compiling problem on Darwin / OS X reported
+          by James Longstreet (can't test).
+        * (Hopefully) fixed A68k miscompilation (due to an invalid implicit
+          declaration) on Darwin / OS X reported by Christian Walther (can't
+          test).
+        * tt/makelinux.sh now honors $CC and $CFLAGS settings. This should solve
+          the problems some users had compiling the TIGCC Tools Suite on OS X.
+          (Apple's gcc is called cc by default for some reason. Reported by
+          Alfredo Aldundo.)
+        * Fixed tigcc frontend bug which caused PPG launchers to sometimes be
+          created with a double extension (.c.??z).
+        * Updated tigcc frontend to reflect Win32 beta 20/21 changes:
+          - support for the $TIGCC/include/s GNU assembly directory added. (That
+            directory currently contains only a GNU as version of os.h.)
+          - Now escaping arguments passed to GCC in order to allow -D switches
+            with definitions containing spaces or other shell metacharacters.
+        * Added README.osX with Darwin / OS X platform-specific building
+          instructions.
+
+- 2002-09-17, version 0.94 beta 19 r1 (Kevin Kofler)
+        * Fixed issues in the install scripts on IRIX (a command line was
+          exceeding the maximum length) and OS X (-v switch not recognized by
+          Apple's cp, mv and rm - removed the -v switch).
+        * Updated TIGCCLIB (libs, documentation and includes) and examples to
+          TIGCC 0.94 beta 19.
+        * Added tool to autogenerate os.h and doorsos.h (A68k include files)
+          from TIGCCLIB documentation sources to the documentation sources
+          (hsf2rc.tar.bz2, written by Loïc Yhuel and released under the GPL).
+        * Updated GCC and Binutils (and the corresponding TIGCC patches) to GCC
+          3.2 and Binutils 2.13 (TIGCC 0.94 beta 19).
+        * Updated patcher to match TIGCC 0.94 beta 19 behavior (changed
+          -freg-relative handling)
+        * Updated tigcc frontend to match TIGCC 0.94 beta 19 behavior (added
+          the missing -keep switch and the new -save-temps switch, fixed passing
+          of -include and -x to GCC and of -8 and -9 to Obj2Ti, added the
+          synonyms of the form "--switch" supported by the Windows version)
+        * Added check to Install_All and Install_All_nopatch to make sure $TIGCC
+          is defined when starting the installation. (WARNING: Do NOT set $TIGCC
+          to / or /usr! Doing so WILL delete system files during installation.
+          This is currently NOT detected by the installation script - it only
+          checks whether it is set to something non-empty.)
+
+- 2002-07-22, version 0.94 beta 18 r5 (Kevin Kofler)
+        * Fixed a bug in the patcher, which was causing the tipatch.lib parts
+          intended for the main .s file only to be added to all .s files.
+        * Fixed various compilation problems on non-Linux systems.
+        * Various Obj2Ti compile fixes (no longer needs Linux-specific endian.h
+          header, should now compile with GCC 3.x).
+
+- 2002-07-14, version 0.94 beta 18 r4 (Kevin Kofler)
+        * Implemented a new "patcher" in C. This should add support for other
+          platforms than Linux/x86. "tigcc -g" won't work on those platforms yet
+          though. (The "parser" still needs to be ported.)
+        * Removed unneeded directory m68k-coff from the binary distribution.
+
+- 2002-07-07, version 0.94 beta 18 r3 (Kevin Kofler)
+        * Added support for _nostub DLLs.
+        * Added support for Zeljko Juric's Quill Adventure Writer.
+        * Removed unneded empty subdirectories in $TIGCC/lib.
+
+- 2002-07-06, version 0.94 beta 18 r2 (Kevin Kofler)
+        * A few fixes in the scripts used to compile and install from sources.
+        * Fixed the problems with our stripped-down GCC and Binutils sources.
+        * Removed GCC info documentation, because it cannot be built from the
+          stripped-down sources and because it is redundant with our HTML
+          documentation anyway.
+        * Removed Binutils info documentation and most Binutils manfiles,
+          because they cannot be built from the stripped-down sources and
+          because they are either redundant with our HTML documentation or
+          documenting tools which are not intended for direct use in TIGCC.
+        * Do not automatically symlink the manfiles into /usr/man/man1 when
+          installing from source. TIGCC should not clutter system directories
+          (but install all its files into $TIGCC). Moreover, the source and
+          binary installs should install the same files.
+
+- 2002-06-29, version 0.94 beta 18 r1 (first release by Kevin Kofler)
+        * Updated all tools once again. They should now be the same as in TIGCC
+          0.94 beta 18 for Windows.
+        * Fixed static library support (-ar switch to create static libraries in
+          the tigcc frontend, linking with static libraries in tprbuilder)
+        * Fixed a few bugs in tprbuilder.
+
+Previous versions by Romain Liévin:
+
+Shortcuts:
+SR: Sebastian Reichelt <Sebastian@tigcc.ticalc.org>
+JM: Julien Muchembled <jm@netcourrier.com>
+KK: Kevin Kofler <Kevin@tigcc.ticalc.org>
+
+- 27/05/2002, version 1.3.4: [??
+        Upgraded.
+        Added a verbosity level to tprbuilder (for making tigcc verbose).
+
+- 19/05/2002, version 1.3.3: [May 16, 2002: TIGCC v0.94 Beta 16, Obj2TI v1.01c, Library v2.5, IDE v2.91]
+        Upgraded the following stuffs:
+        - TIGCC: gcc 3.1, binutils 2.12, html doc, includes, archive & patch,
+                examples
+        - TIGCC tools: v1.25
+        - obj2ti: 1.01c
+        - a68k: 2.71.F3i
+
+- 29/03/2002, version 1.3.2: [March ??, 2002: TIGCC v0.94 Beta 8, Obj2TI v1.01, Library v2.5, IDE v2.9]
+        Upgraded to v0.94 Beta 8 (gcc-3.0.4, html doc, examples, tigcclib,
+        archive).
+        Moved pstarter.o, tigcc.a, tipatch.lib to $TIGCC/lib: done !
+
+- 23/03/2002, version 1.3.1:
+        Html doc updated from Win32 CHM files.
+        Bug fix in tigcc (packing without extension).
+
+- 20/03/2002, version 1.3.0:
+        Problems reported by KK:
+        - tprbuilder does not build project which include archives files
+        - added a link from include/asm/os.h to OS.h (thanks to KK).
+        Compilation of multiple files in project was wrong with tprbuilder and
+        long filenames was not removed with --clean.
+        Fixed a problem with tigcc: obj2ti & long filenames.
+
+- 10/03/2002, version 1.2.9: [February 3, 2002: TIGCC v0.93 Beta, Obj2TI v1.01, Library v2.41, IDE v2.9]
+        Upgraded to v0.93.
+        Doc to update.
+        Officially released on ticalc.org.
+
+
+- 06/03/2002, version 1.2.8:
+        - SR has done some modifications on the Windows source code.
+        - I have developed a TIGCC Project Builder for building .tpr files.
+        - all the tools can use long filenames (such as 'Hello World').
+
+- 22/02/2002, version 1.2.7: [November 25, 2001: TIGCC v0.92 Beta SP2, Obj2TI v1.01, Library v2.4 SP1, IDE v2.8 SP4]
+        TiLP is finished, I can work on TIGCC/UNIX at full time now !
+        I am also working in relation wtih K. Kofler for some stuffs.
+
+        A lot of changes:
+        - A68k: upgraded to 2.71.F3i:
+        - Obj2ti: upgraded
+        - Binutils: upgraded to 2.11.2 (m68k-opc.c et write.c patched)
+        - Binutils-GeekGadgets: added (not yet)
+        - Gcc: upgraded to 3.0.2
+        - TIGCC tools: upgraded
+        - TIGCC lib: upgraded
+        - binutils & gcc are compiled with the following flags:
+                ./configure --disable-nls --disable-multilib
+                make CFLAGS='-Os -s' -> reduce size & strip executable
+        - tigcc front-end updated & improved (supports pathcing and debug)
+        - I have modified and recompiled some parts of TiGcc with Kylix for
+        building a temporary patcher (patcher) and a temporary parser (parser).
+
+-----
+
+- 23/12/2001, version 1.2.6: (official release)
+        No core programs have been updated (same linker and libraries than
+        TIGCC/Win32). Only few improvements have been done.
+        Scrips have been put together in the scripts directory. Most of them
+        have been removed or cleaned up.
+
+        John David Ratlif has worked on the 1.2.0 release for developing
+        a TIGCC/Unix package. I have merged his modifications and docs.
+        He has also written from scratch a tigcc front-end which is better
+        than the front-end I have written so I kept it.
+
+- 03/09/2001, version 1.2.5:
+        Tested the main installer script ('install_all'): OK.
+        Things to do: apply tipatch.lib & tipatchmain.lib
+
+- 02/09/2001, version 1.2.4:
+        I have done some snapshots of binutils-2.9.1, binutils-2.11.2,
+        gcc-2.95.2 and gcc-3.0 installation tree.
+        I migrated to gcc-3.0. All works fine (tested with examples &
+        ExtGraph library & demos).
+
+- 01/09/2001, version 1.2.3:
+        SR sent to me the latest tigcclib headers with patch.
+        These headers are gcc3.0 compliant (one line per asm statement).
+
+- 31/09/2001, version 1.2.2:
+        I have tested migration from gcc-2.95.2 to gcc-3.0. Not finalized yet.
+
+- 29/08/2001, version 1.2.1:
+        The JM's linker (obj2ti) have been fixed (crashes when linking
+        pstarter.o).
+
+- 23/08/2001, version 1.2.0: (official release)
+        This release has been extensively tested with
+        several apps: TIGCC Tools Suite, ExtGraph lib & demos, TIGCC examples,
+        some other programs.
+
+- 22/08/2001, version 1.1.6:
+        tigcc front-end finished.
+        Added links so that anyone can read manpages.
+
+- 21/08/2001, version 1.1.6:
+        I have written a TIGCC front-end for Linux.
+        Should be equivalent to the tigcc.exe of Windows which has been 
+        written in Delphi by Sebastian Reichelt.
+
+- 20/08/2001, version 1.1.5:
+        I have recompiled some TT programs (ebook, tthex, ...) for testing
+        tigcc. They works fine. Nethertheless, they are big (11173 bytes
+        instead of 7549 bytes for ebook).
+
+- 19/08/2001, version 1.1.4:
+        Latest version of the files needed for building tigcc.a. In fact,
+        the Win32 pack had some missing files.
+        Modified Makefile of the /examples directory for using Exe Pack
+        technology.
+        SR mail: he is working on TIGCC based on gcc v3.0.
+
+- 18/08/2001, version 1.1.3:
+        Latest release (v0.99.1) of the TIGCC Tools Suite have been included
+        with the ebook patch.
+        I have also written a small documentation on the development of
+        apps with the common Linux tools.
+
+- 16/08/2001, version 1.1.2:
+        I have applied the 'tipatch.lib' patch to the headers provided with the
+        IDE (I used those provided with tigcclib which were older).
+        All works fine now.
+        Maybe, I will do a parser and/or a 'tigcc' program.
+
+- 16/08/2001, version 1.1.1:
+        Included the latest release of a68k (2.71.F3e)
+
+- 09/08/2001, version 1.1.0: (official release)
+        Official release.
+
+- 28/07/2001, version 1.0.9:
+        I have integrated the latest a68k assembler (fixed by Kevin Kofler).
+        All scripts work fine now.
+        I have reduced the size of the binary package.
+
+- 25/07/2001, version 1.0.8:
+        I have completed the 'launch.gcc' script for installing gcc files.
+        I have added the TiGCC Tools Suite.
+
+- 22/07/2001, version 1.0.7:
+        I have applied the JM TIGCC patch. It seems to work but with TIGCCLib
+        headers.
+        Unfortunately, it works but not completely that is to say it stops
+        when he has finished but too early. Si, it is impossible to do a
+        'make install'.
+
+- 15/07/2001, version 1.0.6:
+        The GrayTst example links now (partial linking with tigcc.a through
+        ld and next, final linking with l68k).
+        I have packaged and added the Julien Muchembled's linker to
+        TIGCC/Linux. It seems to not work (but my gcc is not completely
+        patched yet).
+        Latest version of headers (it seems that TIGCC/Win32 headers are more
+        recent than TIGCCLib ones).
+
+- 13/07/2001, version 1.0.5:
+        I have noticed that the compilation phase produced very big binaries.
+        JB suggest me to use 'strip' and it works. File size is divided by a 
+        4:1 ratio !!!
+
+- 12/07/2001, version 1.0.4:
+        The linker has been modified for accepting long filenames and in
+        order to be conform with the UNIX cmd line standard.
+        Letter sensitivity is now fixed but long filenames are still rejected.
+        To fix...
+        A new directory has been added: archive. This directory contains
+        source code of the tigcc.a archive.
+
+- 11/07/2001, version 1.0.3:
+        The linker has been updated from v1.0.1 to v1.2
+
+- 02/07/2001, version 1.0.2:
+        I (Romain Lievin) have taken over the development of TIGCC/Linux.
+        TiGCC has been recompiled with binutils-2.10.1. The original binutils
+        did not compile properly.
+        The original tree has been reshaped.
+        Installation procedure has been improved thanks to some scripts
+        The assembler and the linker have been properly packaged with
+        Automake/Autoconf.
+        The tigcc-lib has been added to the package.        
+        Examples from TIGCC-Win32 SDK added.
+        The doc has been updated.
+
+- ??, version 1.0.1:
+        Same version numbering as Linux kernel. Added the previously
+        forgotten a68k. And updated documentation for information about
+        a68k's copyright.
+
+- ??, version 1.0.0:
+        First public version.

+ 340 - 0
tigcc-linux/COPYING

@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

+ 26 - 0
tigcc-linux/DIRECTORIES

@@ -0,0 +1,26 @@
+Some explanations about the directory tree:
+
+Directories present in the source release:
+- scripts: contains some automated scripts for development (see installation
+           instructions for the ones you might want to use)
+- sources: contains source code of various tools: patches to GCC and binutils,
+           A68k, ld-tigcc, tigcc frontend and the tools used internally by it
+           (patcher, parser), tprbuilder
+- tigcclib: the TIGCC library developed by Zeljko Juric, including examples (the
+            TPR projects provided with TIGCC for Windows), an ExePack launcher
+            (pstarter) and documentation
+- tt: TIGCC Tools Suite of the TICT (Ti Chess Team)
+
+Directories which need to be created for building:
+- build: this temporary directory is created automatically during installation
+- download: the location where gcc and binutils must be decompressed (see
+            installation instructions)
+
+Directories created in the chosen prefix ($TIGCC):
+- bin: binaries
+- doc: documentation (howto, install, assembler, linker, ...)
+- examples: the TPR projects provided with TIGCC for Windows
+- include: TIGCCLIB and A68k headers
+- lib: TIGCCLIB static library and ExePack launcher object file
+- projects: empty folder intended for storing your projects. Can be removed or
+            replaced with a symlink to somewhere in your home directory.

+ 16 - 0
tigcc-linux/HOWTO

@@ -0,0 +1,16 @@
+How to compile a project using the TIGCC frontend:
+==================================================
+
+* Just like you would do it on Win32.
+* Use: tigcc -Os mainfile.c file2.c file3.asm file4.s file5.a
+* Try tigcc --help for additional command-line parameters. The
+  recommended minimum flags for all TIGCC programs are:
+  -Os -ffunction-sections -fdata-sections --optimize-code
+  --cut-ranges --reorder-sections --merge-constants --remove-unused
+  -Wall -W -Wwrite-strings
+
+
+How to compile a TPR project:
+=============================
+
+* That's easy! Just use: tprbuilder project.tpr

+ 286 - 0
tigcc-linux/INSTALL

@@ -0,0 +1,286 @@
+HOW TO COMPILE AND INSTALL TIGCC FROM SOURCE
+============================================
+
+Please note: read README.linux first. The instructions below apply only to
+compiling and installing the whole package from source if you need to do that. I
+recommend installing from binaries if possible.
+
+
+REQUIREMENTS
+------------
+
+You must have the following programs before you attempt
+to install tigcc-unix.
+
+REQUIRED:
+	1. gcc 2.95 or later (other compilers are NOT supported)
+
+	2. binutils 2.8 or later (gnu or equivalent --
+	   ld, ar, as, etc.)
+
+	3. gnu patch (Solaris patch will NOT work)
+
+	4. bzip2 (to decompress this archive)
+
+	5. tar (gnu tar is best, but Solaris and SGI should be okay)
+
+	6. gnu make
+
+	7. At least 130 MB of free space (archive expands to over 80,
+	build can take another 30-40 depending upon architecture)
+
+	8. bison or yacc
+
+	9. flex
+
+OPTIONAL:
+	10. Windows or (not tested) WINE to compile the documentation from
+	    source (optional: the source distribution includes pre-generated
+	    HTML documentation)
+
+	11. A dialog executable (any of: kdialog, xdialog, gdialog, cdialog or
+	    dialog), if and only if you want to use the wizard (optional: the
+	    wizard now uses plain bash if no dialog executable is available)
+
+If you run into any problems, please contact me and let me know
+where the install failed...
+
+If you want to recompile TIGCC-Linux, you will need to dowload:
+	gcc-core-4.0.2.tar.bz2 (gcc-core, full gcc may not compile !)
+	binutils-2.16.1.tar.bz2
+
+Depending on your machine, compilation can take some time !
+
+
+INSTALLING TIGCC FOR UNIX
+-------------------------
+
+The installation should be very simple. The package has worked on
+Linux, Solaris 8, and SGI IRIX 6 to try and make the scripts
+compatible. UN*X provides some things better, some things worse. Let we know
+if you have a problem with the worse...
+
+First, extract the source to a directory of your choosing such as /tmp.
+
+Unpack binutils & gcc-core packages to the download/ directory as this, and
+create symlinks download/gcc.ti and download/binutils.ti pointing to them.
+Note that the sources on tigcc.ticalc.org ONLY support Linux/x86 and Windows, so
+you will need the COMPLETE GCC (gcc-core only, not the whole compiler
+collection) and Binutils sources from a GNU mirror for all other platforms. So,
+you should have done it like this:
+
+	mkdir /tmp/tigcc-src
+	cd /tmp/tigcc-src
+	# substitute the directory you are using for /tmp
+	bunzip2 tigcc-src.tar.bz2
+	tar xfv tigcc-src.tar
+	mkdir download
+	cd download
+	bunzip2 binutils-2.16.1.tar.bz2 gcc-core-4.0.2.tar.bz2
+	tar xvf binutils-2.16.1.tar
+	tar xvf gcc-core-4.0.2.tar
+	ln -s binutils-2.16.1 binutils.ti
+	ln -s gcc-4.0.2 gcc.ti
+	cd ..
+
+At this point, you have 2 options:
+
+1. Use the installation wizard
+------------------------------
+
+All you need to do now is:
+	cd scripts; ./Install
+and follow the instructions. If you want a text-mode install on a system with
+KDE installed, you can use:
+	cd scripts; DIALOG=dialog ./Install
+to tell the script to use the text-mode (curses) dialog instead of kdialog.
+
+You will be prompted for:
+* the destination directory you want to install TIGCC to ($TIGCC)
+* the bootstrap compiler ($CC) you want to compile TIGCC with (usually "gcc")
+* the optimization flags ($CFLAGS) you want to compile TIGCC with (read the GCC
+  documentation or just use the defaults)
+
+The wizard will ask you whether you want to apply the TIGCC patch. The answer is
+usually "Yes". It will be "No" only if you are rebuilding the same source for a
+second (or more) time.
+
+When done, the wizard will ask you whether you want to add your $TIGCC setting
+to bashrc. If you answer "Yes", you are done here, you only need to restart
+bash. If you prefer to do things by hand, answer "No" and follow the
+instructions in section 2.1 below. (If you selected "No", but changed your mind,
+you can also run envreg by hand afterwards.)
+
+2. Use the install scripts directly
+-----------------------------------
+
+2.1. Environment variable settings
+----------------------------------
+
+Now, set the environment variable TIGCC to the directory you want to install
+TIGCC into (for example /usr/local/tigcc). You need to set this variable in your
+profile, because the compilation stage needs it to find some tools and tigcc
+front-end needs it to find the header files.
+
+If you use bash, add it to your .bashrc file in your home
+directory. You could also use your .profile or .login if
+you have those. If you use tcsh or csh, put it in your
+.cshrc file (or if you use .tcshrc, put it there).
+
+I've never used korn shell. You're on your own if you do.
+
+For bash/sh users
+
+	export TIGCC=/usr/local/tigcc
+	export PATH=$PATH:$TIGCC/bin
+
+For csh/tcsh users
+
+	setenv TIGCC /usr/local/tigcc
+	set path=($path $TIGCC/bin)
+
+I've had problems using setenv to reset the path in tcsh.
+setenv path "$path ${TIGCC}/bin"
+doesn't seem to work.
+
+You may need to logout and log back in for that to take
+effect. Or you can resource your profile.
+
+	source ~/.profile
+	source ~/.bashrc
+	source ~/.cshrc
+	source ~/.tcshrc
+
+You only need to resource the file you changed.
+
+2.2. Installation
+-----------------
+
+The hard part should be over. Now, just change into the directory
+you extracted tigcc into
+
+	cd /tmp/tigcc-src
+
+Optionally, you can now rebuild the HTML documentation from source: the required
+source code is in tigcclib/doc/source.tar.bz2 in your source tree. See the last
+section below for instructions to compile the documentation. Note that the tools
+to compile the documentation from source are for Windows only, so you will need
+Windows (or maybe WINE; I have not tested whether it works for those tools
+though) if you want to build the documentation from source. Unless of course you
+manage to port the Delphi sources of those tools yourself.
+Note that it comes precompiled, so you need not do this. (As for platform-
+independence: the documentation is "compiled" into platform-independent HTML
+files, so compiling it from source should usually not be necessary.)
+
+And run the installation script...
+
+	export CFLAGS='-Os -s'
+	cd scripts; ./Install_All
+
+Assuming you have all the required tools, you should have yourself
+a tigcc build in 5 - 60 minutes.
+
+I don't know how much time it will take you. It took less than
+10 minutes on a Linux system with a Pentium II 450 and 128 MB RAM.
+But, it took 45 minutes on a Linux system with a K6 233 and 112MB RAM.
+
+It took nearly 40 minutes on a Solaris Sparc 400 with 256 MB RAM,
+but it had to read off a network with many other users, so that
+may have had some impact on compile time.
+
+It took over an hour on an SGI O2 machine. I would assume it's due
+to the slow SGI c compiler, which binutils and gcc will try and
+compile themselves with. Since you have a recent version of gcc,
+try setting CC=gcc and CXX=g++ to speed things up. You must have
+gcc 2.95 or above for this to work.
+
+I hope this installation goes smoothly for you.
+
+2.3. ALTERNATE WAY for installation
+-----------------------------------
+
+The following is the "hard" way to do step 2.2. It is used primarily for
+development purposes. You can use this if you experience some problems with the
+automated script.
+
+At first, you will have to register a variable depending on the location you
+want to install TIGCC
+
+	export TIGCC=/usr/local/tigcc
+	export PATH=$PATH:$TIGCC/bin
+	export CFLAGS='-Os -s'
+
+Next, simply go into the scripts directory.
+Then you must apply the patch supplied with this package:
+
+	./Install_step_1
+
+Next, compile binutils and gcc. This may take a while...
+
+	./Install_step_2
+
+If everything went correctly, you now should have a working Tigcc for Linux
+compiler. For installing the TIGCC library, simply launch:
+
+	./Install_step_3
+
+If you want to be able to use it, you should add /usr/local/tigcc to your
+PATH. The compiler is named m68k-coff-gcc, to avoid namecollision with your
+system's gcc. The other utilities follow the same naming.
+
+You may need the TIGCC Tools Suite utilities (required for using the tigcc
+front-end). Simply do:
+
+	./Install_step_4
+
+At last, you have to install the full documentation by
+
+	./Install_step_5
+
+
+REBUILDING THE DOCUMENTATION FROM ITS TRUE SOURCE (REQUIRES WINDOWS)
+--------------------------------------------------------------------
+
+This section is lifted from Sebastian's Readme.txt accompanying the Windows
+source release. Note that the Linux/Unix source release includes pre-generated
+HTML documentation, so you only need to rebuild it if you modify the hs? files.
+
+First, modify the file HelpSystem.ini in the 'Programs' subfolder of the
+'Doc' folder to reflect your actual folder names. It exists so that the
+'Programs' folder can reside at any given place on the hard disk.
+Then, you need to call all 'Update...' programs once.
+
+UpdateInclude.exe and UpdateInfo.exe take one or more complete file name(s)
+as parameters. The actual names of the files are discarded, and the remaining
+folder name is the folder to be updated. If the first parameter is '/ALL' or
+no parameters are specified, all folders are updated, and in case of
+UpdateInclude.exe, a header file index is generated.
+
+UpdateKeywords.exe and UpdateIndex.exe do not take any parameters.
+
+To compile the documentation, download the HTML Help Workshop from
+http://msdn.microsoft.com. Then compile the project in the 'System\CHMFiles'
+folder.
+
+Tools to make editing help system files more convenient are also included in
+this distribution.
+
+A tools to create help system files from the original GNU Texinfo documents
+is included as well, but it might need a recompilation to work with future
+versions of the documentation. Anyway, the .texi files should be in the
+current directory, and you should specify one of them in the command line.
+The appropriate subfolders need to exist (e.g. gnuexts).
+
+If you need detailed information about the file formats, look at the
+Readme.txt file in the documentation folder.
+
+When done with building the CHM documentation, you can convert it to the QT
+assistant format using my converters:
+cd srcdir/doc/converter # substitute the directory you are using for srcdir
+gcc -Os -s -Wall -W -Wwrite-strings chm2dcf.c -o chm2dcf # compile chm2dcf
+cd ../html
+../converter/chm2dcf # convert the CHM to a Documentation Content File (DCF)
+../converter/dcf2adp # convert the DCF to an Assistant Document Profile (ADP)
+(There is also a script called updatedoc to automate the copying and
+converting of the documentation.)
+WARNING: chm2dcf is slooooow. You have been warned.

File diff suppressed because it is too large
+ 21 - 0
tigcc-linux/Install.sh


+ 232 - 0
tigcc-linux/README.linux

@@ -0,0 +1,232 @@
+LINUX/UNIX/OS X PLATFORM SPECIFIC NOTES FOR TIGCC:
+==================================================
+
+Note
+----
+
+	The current release SHOULD WORK on all Linux/Unix platforms, including
+	MacOS X.
+	Official binaries are provided ONLY for Linux/x86, so you will need to
+	compile TIGCC from source on other platforms, unless an unofficial
+	binary is made available for your platform.
+
+
+Copyright of the port:
+----------------------
+
+	The following copyright applies to the compilation and to the platform-
+	specific tools:
+
+	  TIGCC for Linux/Unix - GCC port targeting the TI89/89Ti/92+/V200
+	  Copyright (C) 2000 Henri Moilanen
+	  Copyright (C) 2001-2002 Romain Liévin
+	  Copyright (C) 2002-2005 Kevin Kofler
+	  Some parts from John David Ratliff (TechnoPlaza tutorials)
+
+
+History
+-------
+
+	Henri Moilanen:
+	I like Linux. TIGCC wasn't available as a Linux version, so I had to
+	create it. It hadn't source included, so I couldn't do any changes,
+	and I had to start from scratch. Couple of days of hacking and
+	searching the net, TIGCC For Linux was born. But as I worked alone - I
+	had no hurry. It waited in the depths of my HD for a month until one
+	person, Leonard Stiles, posted a question whether there is a ti-gcc
+	for linux available.
+	That was the push to get the job done. Like it or don't.
+
+	Romain Liévin:
+	I was developing TiLP (formerly GtkTiLink) when Henri was beginning
+	to develop its TiGCC.
+	Henri and some other people asked me whether I could develop a TI
+	emulator for Linux. I have done it.
+	Now, Henri asked me to take over the development of TiGCC/Linux.
+	As you can see, I have accepted and I am now the official maintainer.
+
+	John David Ratliff:
+	Ported & tested on various UNIXes.
+
+	Kevin Kofler:
+	Since Romain no longer had the time to work on TIGCC for Linux, and
+	since I always wanted it to be handled by someone of the TIGCC team, I
+	decided to take over the project. I am planning to work on getting it
+	to run again on platform/*nix combinations other than x86/Linux (now
+	achieved), and to implement all features known from the Win32 version
+	(IDE still missing, everything else done). See
+	http://tigcc.ticalc.org/linux/ for the current status of the project.
+
+
+Installation
+------------
+
+	Installing from the binary RPM:
+	-------------------------------
+
+	* into /usr/local/tigcc (requires root privileges): rpm -ivh tigcc*.rpm
+	* into ~/tigcc (user HOME dir): rpm -ivh tigcc*.rpm --prefix ~/tigcc
+
+	Installing from binaries with the setup wizard:
+	-----------------------------------------------
+
+	* Download tigcc_bin.tar.bz2 and Install.sh into the same directory.
+	* Make sure Install.sh is executable:
+	  chmod 755 Install.sh
+	* Run Install.sh:
+	  ./Install.sh
+	  and follow the instructions. If you want a text-mode install on a
+	  system with KDE installed, you can use:
+	  DIALOG=dialog ./Install.sh
+	  to tell the script to use the text-mode (curses) dialog instead of
+	  kdialog.
+
+	  You will be prompted for the destination directory you want to install
+	  TIGCC to ($TIGCC). Then the wizard will extract the files there.
+	  When done, the wizard will ask you whether you want to add your $TIGCC
+	  setting to bashrc. If you answer "Yes", you are done here, you only
+	  need to restart bash. If you prefer to do things by hand, answer "No"
+	  and follow the instructions below. (If you selected "No", but changed
+	  your mind, you can also run envreg by hand afterwards.)
+
+	Installing from binaries without the setup wizard:
+	--------------------------------------------------
+
+	First, copy your full tigcc binary package to '/'. You can use a
+	directory of your chosing but you will have to move the uncompressed
+	files.
+	Then, install it by:
+
+		bunzip2 tigcc_bin.tar.bz2
+		tar xvf tigcc_bin.tar
+
+	Now, set the environment variable TIGCC to the directory you
+	extracted into. You need to set this variable in your profile,
+	because the tigcc front-end needs it to find the header files.
+
+	If you use bash, add it to your .bashrc file in your home
+	directory. You could also use your .profile or .login if
+	you have those. If you use tcsh or csh, put it in your
+	.cshrc file (or if you use .tcshrc, put it there).
+
+	I've never used korn shell. You're on your own if you do.
+
+	For bash/sh users
+
+		export TIGCC=/usr/local/tigcc
+		export PATH=$PATH:$TIGCC/bin
+
+	For csh/tcsh users
+
+		setenv TIGCC /usr/local/tigcc
+		set path=($path $TIGCC/bin)
+
+	I've had problems using setenv to reset the path in tcsh.
+	setenv path "$path ${TIGCC}/bin"
+	doesn't seem to work.
+
+	You may need to logout and log back in for that to take
+	effect. Or you can resource your profile.
+
+		source ~/.profile
+		source ~/.bashrc
+		source ~/.cshrc
+		source ~/.tcshrc
+
+	You only need to resource the file you changed.
+
+
+	Compiling and installing from source:
+	-------------------------------------
+
+	See the INSTALL file for instructions for building from source.
+	Note that I recommend to use the binary release when possible though.
+
+
+Available programs
+------------------
+
+- a68k: AmigaOS assembler
+- as: GNU assembler
+- ar-tigcc: TIGCC archiver
+- gcc: GNU compiler
+- ld-tigcc: TIGCC linker
+- patcher: patches .s files generated by gcc (mainly for internal use)
+- tigcc: the front-end for using TIGCC
+- tprbuilder: a program for building .tpr files (Tigcc PRoject).
+- tt*: a lot of utilities from the TIGCC Tools Suite
+
+Only tigcc and tprbuilder are intended to be called directly. The TIGCC Tools
+Suite might be distributed separately in the future (as it is for Windows). Its
+continued presence as a part of the TIGCC for Linux/Unix package is not
+guaranteed. All other tools are intended to be called through the tigcc frontend
+only.
+
+In addition, there is a shell script called tigccdoc, which will open the HTML
+documentation in QT Assistant 3.2 or higher, a help viewer offering the same
+features Microsoft HTML Help offers under Windows: content hierarchy, alphabetic
+index and full-text search. The GPL version of QT Assistant can be obtained for
+free from http://www.trolltech.com . For binary packages, check with your
+Linux distributor or operating system vendor.
+
+For QT Assistant versions older than 3.2, you can manually add qt-assistant.dcf
+to your documentation sources. However, this has the disadvantage that the index
+and the full-text search will mix entries from the QT documentation with entries
+from the TIGCC documentation, so it is recommended to use QT Assistant 3.2 and
+tigccdoc instead.
+
+
+Usage
+-----
+
+	Simply call tigcc and pass your filenames and any desired flags (the
+	flags listed here are the minimum recommended flags for all TIGCC
+	programs):
+
+	'tigcc -Os -ffunction-sections -fdata-sections --optimize-code
+	--cut-ranges --reorder-sections --merge-constants --remove-unused
+	-Wall -W -Wwrite-strings test.c'
+
+
+	Once you have created your program, you can test it on an emulator 
+	(such as TiEmu) or directly on your calculator. For this, you have to 
+	transfer the program using a linking program (such as TiLP).
+
+
+Examples
+--------
+
+	You will find in the examples directory some projects which come from 
+	the TIGCC/Win32 SDK. You can build them by:
+
+		'tprbuilder myproject.tpr'
+
+	If you have installed TiLP (http://lpg.ticalc.org/prj_tilp), you can 
+	load the program. Simply do a 'tilp -cmdline foo.89z' (console) or 
+	'tilp foo.89z) (X11).
+
+
+Development platform used for the binary release
+------------------------------------------------
+
+	Machine: Pentium III running Fedora Core 4
+	Compiler: gcc version 4.0.1-4.fc4 (Fedora Core 4) (rpm -q gcc)
+	Kernel: Linux 2.6.13-1.1526_FC4 for i686 (Fedora Core 4) (uname -a)
+	Libc: glibc 2.3.5-10.3 for i686 (Fedora Core 4) (rpm -q glibc)
+
+
+Thanks
+------
+
+	By Romain Liévin:
+	  Rudolf Polzer   He was the first guy to test my (Romain) first release
+	                  of TIGCC and has helped me to understand the patch
+	                  mechanism.
+	  Kevin Kofler    Some information about the tipatch mechanism.
+
+	By Kevin Kofler:
+	  I would like to thank my collegues from the TIGCC team (Sebastian
+	  Reichelt, Zeljko Juric, ...) and the previous maintainers of TIGCC for
+	  Linux (Henri Moilanen, Romain Liévin) for the excellent work done,
+	  which allows me to release this package.
+

+ 98 - 0
tigcc-linux/README.osX

@@ -0,0 +1,98 @@
+DARWIN / MAC OS X PLATFORM SPECIFIC NOTES FOR TIGCC:
+====================================================
+
+Purpose of this document
+------------------------
+
+This document gives installation instructions specific to the Darwin / Mac OS X
+platform. This is necessary because, while compiling TIGCC is easy on most Unix-
+style operating systems, and while TIGCC can also be compiled on Darwin / OS X,
+installation on Darwin / OS X is unfortunately not an easy task. Please make
+sure you:
+1. read README, README.linux (which also applies to other Unix-style operating
+   systems than Linux, such as Darwin / OS X) and INSTALL
+2. read this document carefully
+3. start the installation only AFTER having read all these documents at least
+   once
+4. follow each of the steps given here
+5. report any problems you encounter to me. I do not have a Macintosh to test
+   TIGCC on (the only platforms I can test on are Windows/x86 and Linux/x86), so
+   I have to rely on user reports for other platforms.
+
+
+Credits
+-------
+
+Before I start, I have to mention the following people who helped me provide
+those instructions (as I said, I cannot test on OS X myself):
+- James Longstreet (generationxyu): He was the first to get TIGCC to compile on
+                                    OS X (with my help), and most of the
+                                    instructions below result from that
+                                    compilation session.
+- The GCC developers: Most of the tips about how to get GCC to compile with
+                      Apple's patched GCC shipped with OS X are in their
+                      platform-specific build notes. (Some of the needed flags
+                      are hidden in a comment in their target-specific settings
+                      for STAGE1_CFLAGS though - unfortunately, there is no
+                      "stage 1" when building a cross-compiler like TIGCC, so
+                      the flags have to be specified manually.)
+- Christian Walther: He reminded me that I should mention gcc-core should be
+                     used (not the full gcc compiler collection), and reported
+                     trouble with using '-s' in $CFLAGS.
+                     He also provided up-to-date information for OS X 10.2 and
+                     10.3.
+- James Longstreet, Christian Walther and Alfredo Aldundo for providing small
+  source code patches to fix compiling problems on Darwin / OS X.
+- Schlum for testing TIGCC 0.95 Beta 1 r1 on OS X.
+
+
+Instructions
+------------
+
+These are the instructions provided by the people listed above. Please report
+any errors in those instructions to me. Note that those are for OS X, running
+Apple's patched GCC. If you are running unpatched FSF GCC and/or other GNU
+utilities on Darwin, some steps might turn out not to be necessary.
+
+1. Use the full GCC-core (gcc-core ONLY, NOT full gcc with all the programming
+   language frontends - TIGCC only supports C at the moment) and Binutils
+   sources from a GNU mirror. Our local copy at tigcc.ticalc.org only supports
+   the platforms for which we are distributing binaries (for space reasons, and
+   because that's enough to comply with the GPL). I might add the necessary host
+   headers for OS X to our local copy at a later time though.
+2. Use the tar utility to unpack the GCC and Binutils tarballs (follow the build
+   instructions in README.linux). Stuffit Expander apparently does some strange
+   things when untarring (such as not extracting GCC to a gcc-3.2 subdirectory
+   as it should).
+3. For the shell, any shell should work. I got success reports for the old
+   default tcsh (Christian Walther), sh (James Longstreet) and the current
+   default bash (Schlum, Christian Walther). However, sh/bash is a more standard
+   shell and less likely to cause problems than tcsh. (Note that Apple changed
+   their default shell from tcsh to bash in OS X 10.3, probably for that very
+   reason.)
+4. Under older OS X versions (10.2 and older), you need to increase the stack
+   limit. Under csh/tcsh, you can do it with the following command:
+     limit stack 800
+   Under sh/bash, you can do it with the following command:
+     ulimit -s 800
+   The default stack limit on those versions of OS X was too low to compile GCC.
+   This is reportedly fixed since OS X 10.3 at least (the default stack limit is
+   now set to 8192, which is even more than enough), so you can skip this step
+   if you are running OS X 10.3 or higher.
+You now have 2 options. Either use the source installation wizard (Install),
+which does the rest for you, or follow the remaining instructions below:
+5. When using Apple's GCC, set CC to 'cc -no-cpp-precomp'. The Apple
+   preprocessor has bugs which keep huge projects like GCC and Binutils from
+   getting compiled correctly.
+6. Add the -DHAVE_DESIGNATED_INITIALIZERS=0 flag to $CC or $CFLAGS (needed when
+   building GCC with Apple's GCC, and it won't hurt when building the rest of
+   TIGCC, since only GCC tests for that #define).
+7. Don't forget to set $TIGCC, $PATH and $CFLAGS as explained in INSTALL. Also
+   note that the '-s' flag was not supported in older versions of the OS X
+   toolchain (OS X 10.1 or older). If you have that problem, use only CFLAGS=-Os
+   and run the 'strip' utility on the executables in $TIGCC/bin afterwards, the
+   result is the same. But this has reportedly been fixed in OS X 10.2.
+8. Only when done with all this, run the install script (Install_All).
+
+
+        Kevin Kofler, maintainer of TIGCC for Linux, Unix and OS X

File diff suppressed because it is too large
+ 21 - 0
tigcc-linux/scripts/Install


+ 11 - 0
tigcc-linux/scripts/Install_All

@@ -0,0 +1,11 @@
+#! /bin/sh
+if [ -z $TIGCC ]
+ then echo Install_All: error: \$TIGCC not defined;exit 1
+fi
+mkdir $TIGCC
+
+./Install_step_1
+./Install_step_2
+./Install_step_3
+./Install_step_4
+./Install_step_5

+ 10 - 0
tigcc-linux/scripts/Install_All_nopatch

@@ -0,0 +1,10 @@
+#! /bin/sh
+if [ -z $TIGCC ]
+ then echo Install_All_nopatch: error: \$TIGCC not defined;exit 1
+fi
+mkdir $TIGCC
+
+./Install_step_2
+./Install_step_3
+./Install_step_4
+./Install_step_5

+ 55 - 0
tigcc-linux/scripts/Install_step_1

@@ -0,0 +1,55 @@
+#! /bin/sh
+#
+# Apply the patch to the original sources (download directory)
+#
+echo TIGCC script: Applying patch to original sources...
+cd ../download; 
+# Binutils
+echo Patching binutils...
+cd binutils.ti
+echo Removing unneeded directories
+rm -f .brik
+rm -f md5.sum
+rm -f -r INSTALL
+rm -f -r libiberty/testsuite
+rm -f -r maintainer-scripts
+rm -f -r bfd/doc
+rm -f -r bfd/po
+rm -f -r binutils
+rm -f -r cpu
+rm -f -r etc
+rm -f -r gas/doc
+rm -f -r gas/po
+rm -f -r gas/testsuite
+rm -f -r gprof
+rm -f -r include/nlm
+rm -f -r include/regs
+rm -f -r ld
+rm -f -r opcodes/po
+rm -f -r texinfo
+echo Applying TIGCC patch
+patch -p1 < ../../sources/gcc/gas-2.16-tigcc-patch.diff
+cd ..
+# Gcc
+echo Patching GCC...
+cd gcc.ti
+echo Removing unneeded directories
+rm -f .brik
+rm -f md5.sum
+rm -f -r INSTALL
+rm -f -r fixincludes
+rm -f -r gcc/ginclude
+rm -f -r gcc/po
+rm -f -r gcc/doc
+rm -f -r gcc/treelang
+rm -f -r libcpp/po
+rm -f -r libiberty/testsuite
+rm -f -r maintainer-scripts
+rm -f -r etc
+rm -f -r gprof
+rm -f -r include/nlm
+rm -f -r include/regs
+rm -f -r texinfo
+echo Applying TIGCC patch
+patch -p1 < ../../sources/gcc/gcc-4.0-tigcc-patch.diff
+echo Done.

+ 10 - 0
tigcc-linux/scripts/Install_step_2

@@ -0,0 +1,10 @@
+#! /bin/sh
+#
+# This script completely configures, compiles and installs the patched tools.
+# The download tree must have been patched before doing this.
+#
+mkdir ../build; cd ../build; mkdir binutils; mkdir gcc;
+cd ../scripts; ./launch.binutils; ./launch.gcc;
+rm -Rf ../build
+cd ../scripts; ./launch.a68k; ./launch.ld-tigcc; ./launch.tigcc; ./launch.tprbuilder; ./launch.patcher; ./launch.envreg
+rm -f $TIGCC/bin/parser

+ 16 - 0
tigcc-linux/scripts/Install_step_3

@@ -0,0 +1,16 @@
+#! /bin/sh
+#
+# This script installs the TIGCCLIB.
+# For this, 2 directories have to be created. One (include) contains header
+# files, the other (lib) contains libraries.
+#
+echo TIGCC script: Installing TIGCCLIB...
+rm -Rf $TIGCC/include
+cp -Rf ../tigcclib/include  $TIGCC
+ln -sf $TIGCC/include/asm/os.h $TIGCC/include/asm/OS.h
+rm -Rf $TIGCC/lib
+cp -Rf ../tigcclib/lib $TIGCC
+rm -Rf $TIGCC/examples
+cp -Rf ../tigcclib/examples $TIGCC
+
+#cd ../tigcclib/src; make; make clean; cp tigcc.a $TIGCC/include/c

+ 10 - 0
tigcc-linux/scripts/Install_step_4

@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# Install the TIGCC Tools Suite
+#
+echo TIGCC script: compiling and installing the 'TIGCC Tools Suite'
+cd ../tt/;
+./makelinux.sh
+cp -Rf linuxbin/* $TIGCC/bin
+rm -Rf linuxbin linuxsrc
+echo Done.

+ 38 - 0
tigcc-linux/scripts/Install_step_5

@@ -0,0 +1,38 @@
+#! /bin/sh
+#
+# This script installs the TIGCC documentation
+# For this, a directory "doc" has to be created.
+#
+echo TIGCC script: Installing TIGCC documentation...
+
+mkdir $TIGCC/doc
+cd ..; cp AUTHORS BUGS CHANGELOG COPYING DIRECTORIES HOWTO INSTALL README README.linux README.osX $TIGCC/doc
+
+mkdir $TIGCC/doc/a68k
+cd sources/a68k; cp Bugs.txt Doc.txt History.txt ToDo.txt $TIGCC/doc/a68k
+
+mkdir $TIGCC/doc/tigcc
+cd ../tigcc; cp AUTHORS  COPYING  ChangeLog  README $TIGCC/doc/tigcc
+
+mkdir $TIGCC/doc/tprbuilder
+cd ../tprbuilder; cp AUTHORS  COPYING  ChangeLog  README $TIGCC/doc/tprbuilder
+
+rm -Rf $TIGCC/doc/parser
+
+mkdir $TIGCC/doc/patcher
+cd ../patcher; cp AUTHORS  COPYING  ChangeLog  README $TIGCC/doc/patcher
+
+rm -Rf $TIGCC/doc/html
+cd ../../tigcclib/doc; cp -Rf html $TIGCC/doc
+rm -Rf $TIGCC/doc/tigcclib
+ln -sf $TIGCC/doc/html $TIGCC/doc/tigcclib
+cp ../../tigcclib/doc/converter/tigccdoc $TIGCC/bin
+
+mkdir $TIGCC/doc/tools
+cd ../../tt; cp history.txt  linux_readme.txt  readme.txt  tooldocs.txt $TIGCC/doc/tools
+
+
+echo TIGCC script: Creating TIGCC projects folder...
+mkdir $TIGCC/projects
+
+echo Done.

+ 25 - 0
tigcc-linux/scripts/SCRIPTS

@@ -0,0 +1,25 @@
+List of all scripts:
+
+User scripts:
+-------------
+
+- Install_All: call the Install_step_1 to Install_step_5 scripts
+- Install_All_nopatch: call the Install_step_2 to Install_step_5 scripts (if the sources are already patched)
+
+- Install_step_1: apply a patch on the unpacked sources (binutils and gcc, placed in the download directory)
+- Install_step_2: configure, compile, check and install both binutils & gcc from the download dir. Also compile and install a68k, ld-tigcc, tigcc, tprbuilder, patcher, parser.
+- Install_step_3: copy tigcclib files into the install tree
+- Install_step_4: install the TIGCC Tools Suite
+- Install_step_5: install several docs of the different programs
+
+
+Developer/Maintenance scripts:
+------------------------------
+
+- updatedoc: import the documentation generated under Windows
+- updatesrc: import the cross-platform sources from the Windows tree
+- launch.XYZ: compile, install and clean up XYZ
+- package_bin: create a bzip2 tarball of the $TIGCC directory. Used for
+               building a 'ready to install' binary package.
+- package_src: create a bzip2 tarball of the sources directory. Used for
+               building a source package.

+ 10 - 0
tigcc-linux/scripts/launch.a68k

@@ -0,0 +1,10 @@
+#! /bin/sh
+#
+# Compile and install the A68K assembler
+#
+echo Installing a68k assembler...
+cd ../sources/a68k/
+make -e
+cp A68k $TIGCC/bin/a68k
+make clean
+echo Done.

+ 70 - 0
tigcc-linux/scripts/launch.binutils

@@ -0,0 +1,70 @@
+#! /bin/sh
+#
+# This script launch configure with the right arguments
+# The tree must have been patched before doing this.
+#
+echo TIGCC script: Configuring, compiling and installing binutils...
+mkdir ../build; mkdir ../build/binutils;
+cd ../build/binutils; ../../download/binutils.ti/configure --disable-serial-configure --prefix=$TIGCC --target=m68k-coff --disable-shared --enable-static --disable-multilib --disable-nls --disable-win32-registry
+
+if [ $? -ne 0 ]
+    then echo "TIGCC script: Error while configuring"
+    exit 1
+fi
+
+#Binutils 2.14 is very annoying because of its habit to configure subdirectories only during make.
+#This keeps us from patching the generated makefile in advance.
+#So we have to call make 5 times to get it to work with our removed directories.
+
+make
+
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+# Create dummy libiberty testuite makefile
+rm -f libiberty/testsuite/Makefile
+echo all: >libiberty/testsuite/Makefile
+
+make
+
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+# We do not want to install any documentation. It is redundant with our HTML documentation.
+rm -f bfd/doc/Makefile
+echo all: >bfd/doc/Makefile
+# We do not want any po (NLS) makefiles either: we do not use any NLS anyway
+mkdir bfd/po
+rm -f bfd/po/Makefile
+echo all: >bfd/po/Makefile
+
+make
+
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+# We do not want any po (NLS) makefiles: we do not use any NLS anyway
+rm -f opcodes/po/Makefile
+echo all: >opcodes/po/Makefile
+
+make
+
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+# We do not want to install any documentation. It is redundant with our HTML documentation.
+mkdir gas/doc
+rm -f gas/doc/Makefile
+echo all: >gas/doc/Makefile
+# We do not want any po (NLS) makefiles either: we do not use any NLS anyway
+mkdir gas/po
+rm -f gas/po/Makefile
+echo all: >gas/po/Makefile
+
+#Now this one should really work...
+make
+if [ $? -ne 0 ]
+    then echo "TIGCC script: Error while making"
+    exit 2
+fi
+
+mkdir $TIGCC/bin/
+cp gas/as-new $TIGCC/bin/as
+
+echo Done.

+ 10 - 0
tigcc-linux/scripts/launch.envreg

@@ -0,0 +1,10 @@
+#! /bin/sh
+#
+# Compile and install the TIGCC environment registrator
+#
+echo Installing tigcc environment registrator...
+cd ../sources/envreg/src/
+make -e
+cp envreg $TIGCC/bin
+make clean
+echo Done.

+ 49 - 0
tigcc-linux/scripts/launch.gcc

@@ -0,0 +1,49 @@
+#! /bin/sh
+#
+# This script launches configure with the right arguments
+# The tree must have been patched before doing this.
+#
+echo TIGCC script: Configuring, compiling and installing gcc...
+
+CFLAGS_FOR_BUILD="$CFLAGS"
+export CFLAGS_FOR_BUILD
+CC_FOR_BUILD="$CC"
+export CC_FOR_BUILD
+
+mkdir ../build; mkdir ../build/gcc;
+cd ../build/gcc; ../../download/gcc.ti/configure --prefix=$TIGCC --target=m68k-coff --with-gnu-as --disable-nls --disable-multilib --disable-shared --enable-static --disable-threads --disable-win32-registry --disable-checking --disable-werror --disable-pch --disable-mudflap
+
+if [ $? -ne 0 ]
+    then echo "TIGCC script: Error while configuring GCC"
+    exit 1
+fi
+
+#GCC 4.0 is very annoying because of its habit to configure subdirectories only during make.
+#This keeps us from patching the generated makefile in advance.
+#So we have to call make 3 times to get it to work with our removed directories.
+
+make
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+# Create dummy libiberty testsuite makefile
+rm -f libiberty/testsuite/Makefile
+echo all: >libiberty/testsuite/Makefile
+
+make
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+# Create dummy build-libiberty testsuite makefile
+rm -f `ls -d build-*`/libiberty/testsuite/Makefile
+echo all: >`ls -d build-*`/libiberty/testsuite/Makefile
+
+make
+echo You should have seen an error. This is normal. TIGCC installation continues.
+
+cd ../../scripts
+
+# Finish gcc installation
+mkdir $TIGCC/bin/
+cp ../build/gcc/gcc/cc1  $TIGCC/bin/
+cp ../build/gcc/gcc/xgcc $TIGCC/bin/gcc
+
+echo Done.

+ 11 - 0
tigcc-linux/scripts/launch.ld-tigcc

@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+# Compile and install the TIGCC linker
+#
+echo Installing TIGCC linker...
+cd ../sources/ld-tigcc
+make -e
+cp ld-tigcc $TIGCC/bin
+cp ar-tigcc $TIGCC/bin
+make clean
+echo Done.

+ 10 - 0
tigcc-linux/scripts/launch.patcher

@@ -0,0 +1,10 @@
+#! /bin/sh
+#
+# Compile and install the TIGCC patcher
+#
+echo Installing tigcc patcher...
+cd ../sources/patcher/src/
+make -e
+cp patcher $TIGCC/bin
+make clean
+echo Done.

+ 10 - 0
tigcc-linux/scripts/launch.tigcc

@@ -0,0 +1,10 @@
+#! /bin/sh
+#
+# Compile and install the TIGCC front-end
+#
+echo Installing tigcc front-end...
+cd ../sources/tigcc/src/
+make -e
+cp tigcc $TIGCC/bin
+make clean
+echo Done.

+ 10 - 0
tigcc-linux/scripts/launch.tprbuilder

@@ -0,0 +1,10 @@
+#! /bin/sh
+#
+# Compile and install the TIGCC project builder
+#
+echo Installing tigcc project builder...
+cd ../sources/tprbuilder/src/
+make -e
+cp tprbuilder $TIGCC/bin
+make clean
+echo Done.

+ 18 - 0
tigcc-linux/scripts/package_bin

@@ -0,0 +1,18 @@
+#! /bin/sh
+#
+# This script creates a tarball of all binaries.
+#
+echo TIGCC script: Packaging binaries:
+#echo stripping...
+#strip $TIGCC/bin/*
+echo clamscan...
+clamscan -ir $TIGCC
+echo tar...
+OLDPWD="`pwd`"
+cd $TIGCC
+tar -c --exclude=projects/* --exclude=bin/quill.drv -f "$OLDPWD/../tigcc_bin.tar" bin doc examples include lib projects
+cd "$OLDPWD"
+echo bzip2...
+rm -f ../tigcc_bin.tar.bz2
+bzip2 -9 ../tigcc_bin.tar
+echo Done.

+ 14 - 0
tigcc-linux/scripts/package_src

@@ -0,0 +1,14 @@
+#! /bin/sh
+#
+# This script creates a tarball of the source
+#
+echo TIGCC script: Packaging source:
+echo clamscan...
+clamscan -ir --exclude=../build --exclude=../download ..
+echo tar...
+cd ..
+tar cf tigcc_src.tar scripts sources tigcclib tt AUTHORS BUGS CHANGELOG COPYING DIRECTORIES HOWTO INSTALL README README.linux README.osX;
+echo bzip2...
+rm -f tigcc_src.tar.bz2
+bzip2 -9 tigcc_src.tar;
+echo Done.

+ 44 - 0
tigcc-linux/scripts/updatedoc

@@ -0,0 +1,44 @@
+#!/bin/sh
+TIGCCCVSDIR=/e/TI-89/tigcccvs
+WINDOCDIR=/e/TI-89/tigccdoc
+
+echo Creating documentation source tarball...
+rm -f ../tigcclib/doc/source.tar.bz2
+OLDPWD=`pwd`
+cd $TIGCCCVSDIR/doc
+tar -c --exclude='[cC][vV][sS]' --exclude='.*/[cC][vV][sS]' -f source.tar Programs System
+bzip2 -9 source.tar
+cd $OLDPWD
+mv -f $TIGCCCVSDIR/doc/source.tar.bz2 ../tigcclib/doc/source.tar.bz2
+
+echo Copying documentation files...
+echo -n .
+rm -f ../tigcclib/doc/html/[a-e]*
+echo -n .
+rm -f ../tigcclib/doc/html/[f-j]*
+echo -n .
+rm -f ../tigcclib/doc/html/[k-o]*
+echo -n .
+rm -f ../tigcclib/doc/html/[p-t]*
+echo -n .
+rm -f ../tigcclib/doc/html/[u-z]*
+echo -n .
+cp -pf $WINDOCDIR/CHMFiles/[a-e]*.html ../tigcclib/doc/html/
+echo -n .
+cp -pf $WINDOCDIR/CHMFiles/[f-j]*.html ../tigcclib/doc/html/
+echo -n .
+cp -pf $WINDOCDIR/CHMFiles/[k-o]*.html ../tigcclib/doc/html/
+echo -n .
+cp -pf $WINDOCDIR/CHMFiles/[p-t]*.html ../tigcclib/doc/html/
+echo -n .
+cp -pf $WINDOCDIR/CHMFiles/[u-z]*.html ../tigcclib/doc/html/
+echo -n .
+cp -pf $WINDOCDIR/CHMFiles/*.css $WINDOCDIR/CHMFiles/*.gif \
+ $WINDOCDIR/CHMFiles/Contents.hhc $WINDOCDIR/CHMFiles/Index.hhk \
+ ../tigcclib/doc/html/
+echo .
+cd ../tigcclib/doc/html
+echo Converting...
+../converter/chm2dcf
+../converter/dcf2adp
+echo Done.

+ 115 - 0
tigcc-linux/scripts/updatesrc

@@ -0,0 +1,115 @@
+#!/bin/sh
+
+TIGCCCVSDIR=../../tigcccvs
+TIGCCLIBDIR=/e/TI-89/Compilers/tigcc/Lib
+A68KSRCDIR=/e/TI-89/a68k/source
+PSTARTERSRCDIR=/e/TI-89/pstarter
+TIGCCLINUXCVSDIR=../../tigcc-linux-cvs
+
+
+# TIGCCLIB components in CVS
+echo Updating archive \(tigcclib/src\)...
+rm -rf ../tigcclib/src/*
+cp -prf $TIGCCCVSDIR/archive/* ../tigcclib/src
+rm -rf ../tigcclib/src/CVS ../tigcclib/src/startup/CVS
+
+echo Updating examples...
+rm -rf ../tigcclib/examples/*
+cp -prf $TIGCCCVSDIR/examples/* ../tigcclib/examples
+rm -rf ../tigcclib/examples/CVS
+
+echo Updating hsf2rc...
+rm -rf ../tigcclib/hsf2rc/*
+cp -prf $TIGCCCVSDIR/hsf2rc/* ../tigcclib/hsf2rc
+rm -rf ../tigcclib/hsf2rc/CVS
+
+echo Updating include...
+rm -rf ../tigcclib/include/*
+cp -prf $TIGCCCVSDIR/include/C ../tigcclib/include/c
+cp -prf $TIGCCCVSDIR/include/ASM ../tigcclib/include/asm
+cp -prf $TIGCCCVSDIR/include/S ../tigcclib/include/s
+rm -rf ../tigcclib/include/CVS ../tigcclib/include/asm/CVS ../tigcclib/include/c/CVS \
+       ../tigcclib/include/c/Completion ../tigcclib/include/s/CVS
+
+
+# Toolchain components in CVS
+echo Updating gcc \(TIGCC patches\)...
+rm -rf ../sources/gcc/*
+cp -prf $TIGCCCVSDIR/gcc/* ../sources/gcc
+rm -rf ../sources/gcc/CVS
+
+echo Updating ld-tigcc...
+rm -rf ../sources/ld-tigcc/*
+cp -prf $TIGCCCVSDIR/ld-tigcc/* ../sources/ld-tigcc
+rm -rf ../sources/ld-tigcc/CVS ../sources/ld-tigcc/ar/CVS ../sources/ld-tigcc/ar/export/CVS \
+       ../sources/ld-tigcc/ar/import/CVS ../sources/ld-tigcc/bincode/CVS ../sources/ld-tigcc/export/CVS \
+       ../sources/ld-tigcc/formats/CVS ../sources/ld-tigcc/import/CVS ../sources/ld-tigcc/insert/CVS \
+       ../sources/ld-tigcc/insert/model/CVS
+
+echo Updating tprbuilder...
+rm -rf ../sources/tprbuilder/*
+cp -prf $TIGCCCVSDIR/tprbuilder/* ../sources/tprbuilder
+rm -rf ../sources/tprbuilder/CVS ../sources/tprbuilder/src/CVS
+
+
+# Other components in CVS
+echo Updating readme...
+rm -f ../README
+cp -pf $TIGCCCVSDIR/readme/Readme.txt ../README
+
+
+# Components out of CVS
+echo Updating lib...
+rm -rf ../tigcclib/lib/*
+cp -pf $TIGCCLIBDIR/tigcc.a $TIGCCLIBDIR/pstarter.o ../tigcclib/lib
+
+echo Updating a68k...
+rm -rf ../sources/a68k/*
+cp -prf $A68KSRCDIR/* ../sources/a68k
+
+echo Updating pstarter...
+rm -rf ../tigcclib/pstarter/*
+cp -prf $PSTARTERSRCDIR/LGPL.txt $PSTARTERSRCDIR/pstarter.s $PSTARTERSRCDIR/pstarter.tpr $PSTARTERSRCDIR/pstarter.txt $PSTARTERSRCDIR/pst-ttup.h $PSTARTERSRCDIR/ttunpack ../tigcclib/pstarter
+
+
+# Components in Linux/*nix CVS
+echo Updating envreg...
+rm -rf ../sources/envreg/*
+cp -prf $TIGCCLINUXCVSDIR/sources/envreg/* ../sources/envreg
+rm -rf ../sources/envreg/CVS ../sources/envreg/src/CVS
+
+echo Updating patcher...
+rm -rf ../sources/patcher/*
+cp -prf $TIGCCLINUXCVSDIR/sources/patcher/* ../sources/patcher
+rm -rf ../sources/patcher/CVS ../sources/patcher/src/CVS
+
+echo Updating tigcc...
+rm -rf ../sources/tigcc/*
+cp -prf $TIGCCLINUXCVSDIR/sources/tigcc/* ../sources/tigcc
+rm -rf ../sources/tigcc/CVS ../sources/tigcc/src/CVS
+
+echo Updating source directory list...
+cp -prf $TIGCCLINUXCVSDIR/sources/DIRECTORIES ../sources/
+
+echo Updating text documentation...
+cp -prf $TIGCCLINUXCVSDIR/AUTHORS ../
+cp -prf $TIGCCLINUXCVSDIR/BUGS ../
+cp -prf $TIGCCLINUXCVSDIR/CHANGELOG ../
+cp -prf $TIGCCLINUXCVSDIR/COPYING ../
+cp -prf $TIGCCLINUXCVSDIR/DIRECTORIES ../
+cp -prf $TIGCCLINUXCVSDIR/HOWTO ../
+cp -prf $TIGCCLINUXCVSDIR/INSTALL ../
+cp -prf $TIGCCLINUXCVSDIR/README.linux ../
+cp -prf $TIGCCLINUXCVSDIR/README.osX ../
+
+echo Updating installation wizard...
+cp -prf $TIGCCLINUXCVSDIR/Install.sh ../
+chmod +x ../Install.sh
+
+echo Updating scripts...
+rm -rf ./*
+cp -prf $TIGCCLINUXCVSDIR/scripts/* .
+rm -rf CVS
+chmod +x [^S]*
+
+echo Done.

+ 12 - 0
tigcc-linux/sources/DIRECTORIES

@@ -0,0 +1,12 @@
+Directory list:
+
+a68k  envreg  gcc  ld-tigcc  patcher  tigcc  tprbuilder
+
+- a68k: the assembler provided with Fargo (II)
+- envreg: a tool to register the current value of $TIGCC and the corresponding
+          $PATH entry into /etc/bashrc (when run as root) or ~/.bashrc (else)
+- gcc: TIGCC patches for binutils, binutils-geekgadgets and gcc
+- ld-tigcc: the TIGCC linker
+- patcher: a program for applying patches on .s files
+- tigcc: the Linux equivalent of tigcc.exe
+- tprbuilder: a program for building .tpr files (Tigcc PRoject).

+ 1 - 0
tigcc-linux/sources/envreg/AUTHORS

@@ -0,0 +1 @@
+Kevin Kofler <Kevin@tigcc.ticalc.org>

+ 340 - 0
tigcc-linux/sources/envreg/COPYING

@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

+ 8 - 0
tigcc-linux/sources/envreg/ChangeLog

@@ -0,0 +1,8 @@
+2004-03-14  v1.01  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * Fixed copy&pasto in realloc success check.
+
+2004-01-24  v1.00  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * Initial version.
+

+ 29 - 0
tigcc-linux/sources/envreg/README

@@ -0,0 +1,29 @@
+        envreg - Register TIGCC environment variables into bashrc
+
+  Copyright (C) 2004 Kevin Kofler
+
+  tigcc_patch is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+This tool is meant mainly for internal use during installation.
+It takes the current value of $TIGCC, and puts code into /etc/bashrc (when run
+as root) or ~/.bashrc (otherwise) to set $TIGCC to the current value, and to
+append it to $PATH. If it finds an existing export for $TIGCC, it replaces it
+with its current value. It it finds the existing $TIGCC/bin directory in $PATH,
+it removes it.
+
+Usage: envreg
+
+        - Kevin Kofler <Kevin@tigcc.ticalc.org>

+ 16 - 0
tigcc-linux/sources/envreg/src/Makefile

@@ -0,0 +1,16 @@
+#Envreg makefile
+#Copyright (C) 2004, Kevin Kofler
+
+all: envreg
+
+CC = gcc
+CFLAGS = -Os -s
+WARN_CFLAGS = -Wall -W -Wwrite-strings
+
+envreg: envreg.c
+	$(CC) $(CFLAGS) $(WARN_CFLAGS) envreg.c -o envreg
+
+.PHONY: clean
+
+clean:
+	rm -f envreg

+ 200 - 0
tigcc-linux/sources/envreg/src/envreg.c

@@ -0,0 +1,200 @@
+/*
+   envreg - Register TIGCC environment variables into bashrc
+
+   Copyright (C) 2004 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int main(void) {
+  char *bashrc;
+  char *tigcc;
+  char *oldtigcc=NULL;
+  FILE *f=NULL;
+  char **lines=NULL;
+  int numlines=0;
+  int i;
+  char *p;
+
+  // Find out what bashrc file to use
+  if (geteuid()) {
+    const char *homedir;
+    puts("envreg: Running as normal user");
+    homedir=getenv("HOME");
+    if (!homedir) {
+      puts("envreg: error: $HOME not set");
+      return 1;
+    }
+    bashrc=malloc(strlen(homedir)+9);
+    if (!bashrc) goto outofmem;
+    strcpy(bashrc,homedir);
+    if (bashrc[strlen(bashrc)-1]!='/') strcat(bashrc,"/");
+    strcat(bashrc,".bashrc");
+  } else {
+    puts("envreg: Running as root");
+    bashrc=malloc(12);
+    if (!bashrc) goto outofmem;
+    strcpy(bashrc,"/etc/bashrc");
+  }
+  printf("envreg: Using bashrc file: `%s'\n",bashrc);
+
+  // Read the current file contents
+  f=fopen(bashrc,"rb");
+  // If we can't open the file, assume it doesn't exist and treat it as empty
+  if (f) {
+    // Get the file size
+    fseek(f,0,SEEK_END);
+    i=ftell(f);
+    fseek(f,0,SEEK_SET);
+
+    // Allocate a buffer for the entire file and read it into memory
+    lines=malloc(sizeof(unsigned char *));
+    if (!lines) goto outofmem;
+    *lines=malloc(i+1);
+    if (!*lines) goto outofmem;
+    fread(*lines,1,i,f);
+    (*lines)[i]=0;
+
+    // Close the file
+    fclose(f);
+    f=NULL;
+
+    // Now split the file into lines
+    while((p=strchr(lines[numlines],'\n'))) {
+      lines=realloc(lines,((++numlines)+1)*sizeof(unsigned char *));
+      if (!lines) goto outofmem;
+      lines[numlines]=malloc(strlen(p+1)+1);
+      if (!lines[numlines]) goto outofmem;
+      strcpy(lines[numlines],p+1);
+      *p=0;
+      if (p[-1]=='\r') p[-1]=0;
+      lines[numlines-1]=realloc(lines[numlines-1],strlen(lines[numlines-1])+1);
+      if (!lines[numlines-1]) goto outofmem; // Some stupid systems copy even when cutting.
+    }
+    // If the last line is empty, drop it, else count it
+    if (*(lines[numlines])) numlines++; else {
+      free(lines[numlines]);
+      lines=realloc(lines,numlines*sizeof(unsigned char *));
+      if (!lines) goto outofmem; // Some stupid systems copy even when cutting.
+    }
+  } else {
+    printf("envreg: `%s' doesn't exist, creating a new one\n",bashrc);
+  }
+
+  // Look for existing $TIGCC setting
+  for (i=0;i<numlines;i++) {
+    if (!strncmp(lines[i],"export TIGCC=",13)) {
+      // Get old $TIGCC setting
+      oldtigcc=malloc(strlen(lines[i])-12);
+      strcpy(oldtigcc,lines[i]+13+(lines[i][13]=='\"'));
+      if (oldtigcc[strlen(oldtigcc)-1]=='\"') oldtigcc[strlen(oldtigcc)-1]=0;
+      printf("envreg: $TIGCC previously set to `%s'\n",oldtigcc);
+      break;
+    }
+  }
+
+  if (i==numlines) {
+    // Add new $TIGCC setting
+    i=numlines;
+    lines=realloc(lines,++numlines*sizeof(unsigned char *));
+    if (!lines) goto outofmem;
+    lines[i]=NULL;
+  }
+
+  // Add the setting
+  tigcc=getenv("TIGCC");
+  if (!tigcc) {
+    puts("envreg: error: $TIGCC not set");
+    return 1;
+  }
+  printf("envreg: setting $TIGCC to `%s'\n",tigcc);
+  lines[i]=realloc(lines[i],strlen(tigcc)+16);
+  if (!lines[i]) goto outofmem;
+  strcpy(lines[i],"export TIGCC=\"");
+  strcat(lines[i],tigcc);
+  strcat(lines[i],"\"");
+
+  if (oldtigcc) {
+    // Append "/bin" to oldtigcc
+    oldtigcc=realloc(oldtigcc,strlen(oldtigcc)+5);
+    if (!oldtigcc) goto outofmem;
+    if (oldtigcc[strlen(oldtigcc)-1]!='/') strcat(oldtigcc,"/");
+    strcat(oldtigcc,"bin");
+  }
+
+  // Look for existing $PATH settings
+  for (i=0;i<numlines;i++) {
+    if (!strncmp(lines[i],"export PATH=",12)) {
+      // Check if it contains literal $TIGCC/bin
+      if (strstr(lines[i],"$TIGCC/bin")) {
+        puts("envreg: $PATH already contains $TIGCC/bin");
+        goto writeout;
+      }
+      // Check if it contains old $TIGCC/bin
+      while (oldtigcc && (p=strstr(lines[i],oldtigcc))
+             && (p[-1]=='='||(p[-1]=='\"'&&p[-2]=='=')||p[-1]==':')) {
+        int l;
+        printf("envreg: $PATH contains `%s', removing\n",oldtigcc);
+        l=strlen(oldtigcc);
+        while (p[l] && p[l]!='\"' && p[l]!=':') l++; // look for end
+        if ((!p[l]||(p[l]=='\"'&&!p[l+1]))
+            && (p[-1]=='='||(p[-1]=='\"'&&p[-2]=='=')))
+          *(lines[i])=0; // single entry, so zap entire line
+        if ((!p[l]||(p[l]=='\"'&&!p[l+1]))) p--; // last entry, must zap : in
+                                               // in front, not afterwards
+        l++; // zap :
+        memmove(p,p+l,strlen(p+l)+1);
+      }
+    }
+  }
+
+  // Add new $PATH setting
+  puts("envreg: appending $TIGCC/bin to $PATH");
+  i=numlines;
+  lines=realloc(lines,++numlines*sizeof(unsigned char *));
+  if (!lines) goto outofmem;
+  lines[i]=malloc(31);
+  strcpy(lines[i],"export PATH=\"$PATH:$TIGCC/bin\"");
+
+writeout:
+  // Write out the new file
+  f=fopen(bashrc,"wt");
+  // If we can't open the file, now, we have a permissions problem
+  if (!f) {
+    printf("envreg: error: can't write to `%s'\n",bashrc);
+    return 1;
+  }
+
+  // Write out each line
+  for (i=0;i<numlines;i++) {
+    fprintf(f,"%s\n",lines[i]);
+  }
+
+  // Close the file
+  fclose(f);
+  f=NULL;
+
+  return 0;
+
+outofmem:
+  if (f) fclose(f);
+  puts("envreg: error: Out of memory");
+  return -1;
+}

+ 2 - 0
tigcc-linux/sources/patcher/AUTHORS

@@ -0,0 +1,2 @@
+Romain Liévin <roms@lpg.ticalc.org>
+Kevin Kofler <Kevin@tigcc.ticalc.org>

+ 340 - 0
tigcc-linux/sources/patcher/COPYING

@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

+ 68 - 0
tigcc-linux/sources/patcher/ChangeLog

@@ -0,0 +1,68 @@
+2005-04-05  v1.11  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * don't apply patches on .ascii or .asciz lines
+
+2004-09-23  v1.10  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * handling multiple patches on the same line correctly
+
+2004-09-06  v1.09  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * relocated ROM_CALLs now work with -mpcrel
+
+2004-06-11  v1.08  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * OPTIMIZE_CALC_CONSTS now works with -mpcrel
+
+2004-03-14  v1.07  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * -freg-relative-detection now looks for
+          .set __relation,__ld_entry_point_plus_0x8000
+
+2003-10-19  v1.06  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * fixed handling of _ROM_CALL_nnn+x
+        * -freg-relative-detection now looks for .xdef __ref_all___reg_relative
+
+2003-09-28  v1.05  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * removed handling of tipatch.lib and tipatchmain.lib, they are no
+          longer needed with the new linker
+        * removed unused NLS macros
+        * now including standard C headers and unistd.h instead of system.h junk
+        * using standard C argument parsing instead of getopt
+        * removed unused xmalloc.c source file
+        * removed autoconf and automake junk, added custom makefile
+        * some warning fixes
+        * now includes change_extension directly instead of misc.c
+        * removed optimization of jumps/branches to the next line (not needed
+          anymore with the new linker)
+        * detecting -freg-relative as in the Win32 version
+        * always use absolute jumps for ROM_CALLs and RAM_CALLs
+        * added optimization of __ld_calc_const_
+        * always use absolute references for ROM_CALLs
+
+2003-02-17  v1.04  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * fixed handling of 4-digit error codes
+
+2002-09-17  v1.03  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * updated -freg-relative handling to match TIGCC 0.94 beta 19 behavior
+
+2002-07-21  v1.02  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * fixed false-positives due to imprecise substring matching
+        * removed useless defines in patcher.h
+        * removed useless dependency on glib
+        * xmalloc.c no longer uses the non-portable error.h header.
+
+2002-07-14  v1.01  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * first working version
+        * most of the code was rewritten or newly written
+
+2002-02-20  v1.00  Romain Liévin  <roms@lpg.ticalc.org>
+
+        * tigcc_patch: initial version.
+

+ 29 - 0
tigcc-linux/sources/patcher/README

@@ -0,0 +1,29 @@
+        tigcc_patch - Parse assembly file and apply TIGCC patches
+
+  Copyright (C) 2002 Romain Liévin
+  Copyright (C) 2002-2005 Kevin Kofler
+
+  tigcc_patch is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+This tool is meant mainly for internal usage.
+  
+Usage: patcher [OPTION]... [FILE]...
+Options:
+  -h, --help                 display this help and exit
+  -V, --version              output version information and exit
+  -o output_file             select output file (default: same as input)
+
+        - Kevin Kofler <Kevin@tigcc.ticalc.org>

+ 16 - 0
tigcc-linux/sources/patcher/src/Makefile

@@ -0,0 +1,16 @@
+#Patcher makefile
+#Copyright (C) 2003, Kevin Kofler
+
+all: patcher
+
+CC = gcc
+CFLAGS = -Os -s
+WARN_CFLAGS = -Wall -W -Wwrite-strings
+
+patcher: patcher.c patcher.h
+	$(CC) $(CFLAGS) $(WARN_CFLAGS) patcher.c -o patcher
+
+.PHONY: clean
+
+clean:
+	rm -f patcher

+ 264 - 0
tigcc-linux/sources/patcher/src/patcher.c

@@ -0,0 +1,264 @@
+/*
+   patcher - Parse assembly file and apply patches.
+
+   Copyright (C) 2002 Romain Liévin
+   Copyright (C) 2002-2005 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <dirent.h>
+
+#include "patcher.h"
+
+#define EXIT_FAILURE 1
+
+
+char *output_file = NULL;
+
+int
+main (int argc, char **argv)
+{
+  int i, fline_ROM_CALLs=0, reg_relative=0;
+  FILE *infile, *outfile;
+  char *temp_file;
+  unsigned char buffer[32772]; // 4 extra bytes for the patches
+
+  /* GNU stuff */
+  program_name = argv[0];
+  i = decode_switches (argc, argv);
+
+  if ((i>=argc) || strcmp(file_extension(argv[i]),".s")) usage(EXIT_FAILURE);
+  if (!output_file) output_file=argv[i];
+
+  temp_file = malloc(strlen(argv[i])+3);
+  if (!temp_file) {fprintf(stderr, "Fatal error: malloc failed\n");exit(EXIT_FAILURE);}
+  strcpy(temp_file,argv[i]);change_extension(temp_file,".tmp");
+
+  unlink(temp_file);
+  outfile = fopen(temp_file, "wt");
+  if (!outfile)
+    {
+      fprintf(stderr, "Unable to open the temporary file <%s>\n", argv[i]);
+      exit(-1);
+    }
+  infile = fopen(argv[i], "rt");
+  if (!infile)
+    {
+      fclose(outfile);
+      unlink(temp_file);
+      fprintf(stderr, "Unable to open the file <%s>\n", argv[i]);
+      exit(-1);
+    }
+
+  // Copy infile line by line, applying patches if needed:
+  while(1) {
+    fgets(buffer, 32768, infile);
+
+    if (feof(infile)) break;
+
+    if (buffer[strlen(buffer)-1]=='\n') buffer[strlen(buffer)-1]=0;
+    output_line(buffer, outfile, &fline_ROM_CALLs, &reg_relative);
+  }
+  
+  fclose(outfile);
+  fclose(infile);
+
+  if (!strcmp(output_file,argv[i])) unlink(output_file);
+  rename(temp_file,output_file);
+
+  free(temp_file);
+
+  exit (0);
+}
+
+/* Set all the option flags according to the switches specified.
+   Return the index of the first non-option argument.  */
+
+static int
+decode_switches (int argc, char **argv)
+{
+  int c;
+
+  for (c=1;c<argc;c++) {
+    if (!strcmp(argv[c],"-V")||!strcmp(argv[c],"--version")) {
+       printf ("patcher 1.11\n");
+       exit(0);
+    } else if (!strcmp(argv[c],"-h")||!strcmp(argv[c],"--help")) {
+       usage(0);
+    } else if (!strcmp(argv[c],"-o")) {
+       if (c+1<argc) output_file=argv[c+1]; else usage(EXIT_FAILURE);
+    } else break;
+  }
+
+  if (c>=argc) usage(EXIT_FAILURE);
+  
+  return c;
+}
+
+
+static void
+usage (int status)
+{
+  printf ("%s - parse assembly files and apply TIGCC patches\n",
+          program_name);
+  printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
+  printf ("\
+Options:\n\
+  -h, --help                 display this help and exit\n\
+  -V, --version              output version information and exit\n\
+  -o output_file             select output file (default: same as input)\n\
+");
+  exit (status);
+}
+
+
+/* Return the filename extension or NULL */
+static const char *file_extension(const char *filename)
+{
+  int i;
+  const char *p;
+
+  for(i=strlen(filename); i > 0; i--)
+    {
+      if(filename[i] == '.') break;
+    }
+  p=filename+i;
+
+  return p;
+}
+
+static void output_line(unsigned char *buffer, FILE *outfile, int *pfline_ROM_CALLs, int *preg_relative)
+{
+// This is a straight C translation of Sebastian's ParseSFile Delphi source code.
+#define fline_ROM_CALLs (*pfline_ROM_CALLs)
+#define reg_relative (*preg_relative)
+  if (*buffer) {
+    char *p1,*p2;
+
+    // detect -f-reg-relative
+    if (!strcmp(buffer,"\t.set __relation,__ld_entry_point_plus_0x8000"))
+      reg_relative=1;
+
+    // detect F-LINE ROM_CALLs
+    if (strstr(buffer,"_F_LINE"))
+      fline_ROM_CALLs=1;
+
+    // don't patch .ascii or .asciz commands
+    if (strncmp(buffer,"\t.ascii",7) && strncmp(buffer,"\t.asciz",7))
+    {
+      // handle -f-reg-relative
+      if (reg_relative && (p1=strstr(buffer,"-__relation"))) {
+        char *p4=buffer;
+        while (p1) {
+          if ((p2=strstr(p4,"_CALL_")) && (p2<p1) && (p1-p2<10)) {
+            char *p3=strchr(p1+12,')');
+            if (p3) memmove(p1,p3+1,strlen(p3)); // zap "-__relation(%an)"
+            p4=p1;
+          } else if ((p2=strstr(p4,"_ER_CODE_")) && (p2<p1) && (p1-p2<14)) {
+            char *p3=strchr(p1+12,')');
+            if (p3) memmove(p1,p3+1,strlen(p3)); // zap "-__relation(%an)"
+            p4=p1;
+          }
+          p1=strstr(p1+1,"-__relation");
+        }
+      }
+
+      // handle A-LINE ER_THROW
+      if (!strncmp(buffer,"\tjra _ER_CODE_",14) || !strncmp(buffer,"\tjmp _ER_CODE_",14)) {
+        memmove(buffer+2,buffer+1,strlen(buffer)); // replace "jxx _ER_CODE_" with
+        strncpy(buffer+1,".word _A_LINE+",14);     // ".word _A_LINE+"
+      } else {
+        // handle ROM_CALLs and RAM_CALLs (always use jsr so -l works)
+        if (!strncmp(buffer,"\tjbsr",5)&&strstr(buffer,"_CALL_"))
+          memmove(buffer+2,buffer+3,strlen(buffer)-1); // zap the 'b'
+        else if (!strncmp(buffer,"\tjra",4)&&strstr(buffer,"_CALL_")) {
+          buffer[2]='m'; // jra -> jmp
+          buffer[3]='p';
+        }
+        // handle __ld_calc_const
+        else if (!strncmp(buffer,"\tmove.l #__ld_calc_const_",25)) {
+          buffer[6]='w'; // move.l -> move.w
+        }
+
+        // handle F-LINE ROM_CALLs
+        if (fline_ROM_CALLs && !strncmp(buffer,"\tjsr _ROM_CALL_",15) && strlen(buffer)<=18) {
+          memmove(buffer+3,buffer+1,strlen(buffer)); // replace "jsr _ROM_CALL_"
+          strncpy(buffer+1,".word _F_LINE+0x",16);     // with ".word _F_LINE+0x"
+        } else {
+          // add :l to ROM_CALLs
+          char *p4=strstr(buffer,"_ROM_CALL_");
+          while (p4) {
+            char *p5=p4;
+            p4+=10;
+            while (isalnum(*p4)||*p4=='_'||*p4=='+'||*p4=='-'||*p4=='*'||*p4=='/') p4++;
+            while (*p4==':'||isalpha(*p4)) memmove(p4,p4+1,strlen(p4)); // zap :w if it's there
+            if (strlen(buffer)>32769) break; // avoid buffer overflow
+            memmove(p4+2,p4,strlen(p4)+1);
+            *(p4++)=':'; // add ":l"
+            *(p4++)='l';
+            if (!strncmp(p4,"(%pc)",5)||!strncmp(p4,"(%Pc)",5)||!strncmp(p4,"(%pC)",5)||!strncmp(p4,"(%PC)",5)) {
+              memmove(p4,p4+5,strlen(p4+5)+1);
+            } else if ((!strncmp(p4,",%pc)",5)||!strncmp(p4,",%Pc)",5)||!strncmp(p4,",%pC)",5)
+                        ||!strncmp(p4,",%PC)",5))
+                       &&(p5>buffer)&&(p5[-1]=='(')) {
+              memmove(p4,p4+5,strlen(p4+5)+1);
+              memmove(p5-1,p5,strlen(p5)+1);
+            }
+            p4=strstr(p4,"_ROM_CALL_");
+          }
+          p4=strstr(buffer,"__ld_calc_const_");
+          while (p4) {
+            char *p5=p4;
+            p4+=16;
+            while ((*p4>='0'&&*p4<='9')||(*p4>='a'&&*p4<='z')||(*p4>='A'&&*p4<='Z')||(*p4=='_')||(*p4==':')) p4++;
+            if (!strncmp(p4,"(%pc)",5)||!strncmp(p4,"(%Pc)",5)||!strncmp(p4,"(%pC)",5)||!strncmp(p4,"(%PC)",5)) {
+              memmove(p4,p4+5,strlen(p4+5)+1);
+            } else if ((!strncmp(p4,",%pc)",5)||!strncmp(p4,",%Pc)",5)||!strncmp(p4,",%pC)",5)
+                        ||!strncmp(p4,",%PC)",5))
+                       &&(p5>buffer)&&(p5[-1]=='(')) {
+              memmove(p4,p4+5,strlen(p4+5)+1);
+              memmove(p5-1,p5,strlen(p5)+1);
+            }
+            p4=strstr(p4,"__ld_calc_const_");
+          }
+        }
+      }
+    }
+
+    fputs(buffer, outfile);
+    fputc('\n',outfile);
+  }
+#undef fline_ROM_CALLs
+#undef reg_relative
+}
+
+static char *change_extension(char *file, const char *newext)
+{
+  char *start = (char *)strrchr(file, '.');
+  if(start == NULL) {
+    start = file; //return file;
+  } else {
+    sprintf(start, "%s", newext);
+  }
+
+  return file;
+}

+ 35 - 0
tigcc-linux/sources/patcher/src/patcher.h

@@ -0,0 +1,35 @@
+/*
+   tigcc_patch - Parse assembly file and apply patches.
+
+   Copyright (C) 2002 Romain Liévin
+   Copyright (C) 2002-2003 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef PATCHER_H
+#define PATCHER_H
+
+/* internal functions */
+static void usage (int status);
+static int decode_switches (int argc, char **argv);
+static const char *file_extension (const char *filename);
+static void output_line(unsigned char *buffer, FILE *outfile, int *pfline_ROM_CALLs, int *preg_relative);
+static char *change_extension(char *file, const char *newext);
+
+/* The name the program was run with, stripped of any leading path. */
+char *program_name;
+
+#endif

+ 7 - 0
tigcc-linux/sources/tigcc/AUTHORS

@@ -0,0 +1,7 @@
+tigcc fronted developed and packaged for Linux
+by Romain Lievin <roms@lpg.ticalc.org>
+
+http://lpg.ticalc.org/prj_tigcc
+
+
+Modified by Kevin Kofler

+ 340 - 0
tigcc-linux/sources/tigcc/COPYING

@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

+ 162 - 0
tigcc-linux/sources/tigcc/ChangeLog

@@ -0,0 +1,162 @@
+Changelog for TIGCC-FrontEnd For Linux
+
+- 2005-10-02, version 1.3.1 (Kevin Kofler)
+        * Now handling -isystem correctly.
+
+- 2005-04-30, version 1.3.0 (Kevin Kofler)
+        * -g now generates debugging information in DWARF 2 format instead of
+          assembly files patched by parser.
+        * Fixed the default output name (first source file, not the last one).
+
+- 2004-11-13, version 1.2.9 (Kevin Kofler)
+        * Now works properly again if no -Wa and/or -WA switch is used (no more
+          strlen(NULL) segfault).
+
+- 2004-10-31, version 1.2.8 (Kevin Kofler)
+        * -v is now passed to GCC and ttpack.
+        * Added -v0 switch which does the same as the old -v did.
+        * -q no longer eats error messages.
+        * -Wa/-WA switches are now properly passed to each invocation of the
+          respective assembler, not just the first.
+
+- 2004-09-23, version 1.2.7 (Kevin Kofler)
+        * Added TIGCC/*nix package version to --version output.
+          NOTE: This will get updated without further entries in this changelog.
+                Please refer to the main changelog for updates to TIGCC_VERSION.
+        * Zapping leftover Titanium launchers when relinking.
+
+- 2004-09-06, version 1.2.6 (Kevin Kofler)
+        * Disabled support for separate Titanium launchers.
+
+- 2004-08-06, version 1.2.5 (Kevin Kofler)
+        * Added support for constant merging (pass --merge-constants to linker).
+
+- 2004-06-22, version 1.2.4 (Kevin Kofler)
+        * Fixed handling of output files.
+
+- 2004-06-11, version 1.2.3 (Kevin Kofler)
+        * Added support for section reordering.
+
+- 2004-04-15, version 1.2.2 (Kevin Kofler)
+        * Added support for Flash OS upgrades: --flash-os switch, flashos.a.
+        * Fixed all-reloc mode enabling. (It didn't do anything.)
+        * Adding --keep-locals/-d switch when return optimization is enabled or
+          a static library is being created.
+        * Now defining -DFARGO for --fargo and -DFLASH_OS for --flash-os.
+
+- 2004-03-14, version 1.2.1 (Kevin Kofler)
+        * Fixed -pack switch (was broken by the new linker).
+        * Added support for Titanium ExePack.
+
+- 2003-12-24, version 1.2.0 (Kevin Kofler)
+        * Adapt to new debugging information parser.
+
+- 2003-10-19, version 1.1.10 (Kevin Kofler)
+        * Only guess outfile from first arg if do_link is true.
+
+- 2003-09-27, version 1.1.9 (Kevin Kofler)
+        * Removed autoconf and automake junk. Added custom makefile.
+        * Warning fixes (added parentheses around assignments used as a truth
+          value, changed integers in parse_pstarter to unsigned).
+        * Removed no longer used BIN_BASE.
+        * Added error message on execv failure.
+        * Removed now unneeded A68k object file conversion (amigaos-objcopy).
+        * Merged convert() into ld().
+        * ar() now uses ar-tigcc instead of ar.
+        * -S -o and -c -o now work (patch by Nils Gesbert).
+        * Using tigcc to link object files only (tigcc file1.o file2.o) now
+          works (patch by Nils Gesbert).
+        * Removed -Wl switch.
+        * ld() now uses ld-tigcc instead of ld and obj2ti.
+        * Handling ld-tigcc arguments like gcc arguments (allows to pass
+          arguments down to the linker).
+        * Handle --param GCC flag like -include and -x.
+        * Now running parser on the pre-linking .o files.
+        * Fixed buffer overflow bug for tigcc.a filename.
+        * Added support for Fargo, All-Relocs and external data variables.
+        * Removed _nostub DLL kludge, because the new linker fully handled them.
+        * Added --output as a synonym for -o.
+        * Fixed -g flag: now passing -mcoff-abslines to GCC as intended.
+        * Fixed handling of default output file (moved to parse_args).
+        * pack() now uses ld-tigcc instead of obj2ti.
+        * Fixed passing of -B to GCC.
+        * Fixed copy&paste typo in cleanup phase (src instead of asm/a68k).
+        * Now escaping argument during -v output.
+
+- 2003-09-18, version 1.1.8 (Kevin Kofler)
+        * Patches by Nils Gesbert:
+          - completely removed -8 and -9 flags.
+          - fixed various buffer overflow and shell metacharacter bugs.
+        * Removed obsolete handling of -bsr flag. (It already had no effect.)
+        * Added deprecation warning for use of -Wl, a linker switch is imminent.
+        * Now passing -B to GCC as suggested by Sebastian Reichelt.
+
+- 2002-11-30, version 1.1.7 (Kevin Kofler)
+        * Removed documentation of -8 and -9 flags, because they only apply when
+          the linker supports them, which is not the case with obj2ti.
+        * tigcc -E now works as documented.
+        * tigcc -g now deletes tempfile.o (unless -keep is specified as well).
+
+- 2002-11-16, version 1.1.6 (Kevin Kofler)
+        * Fixed bug which caused "tigcc -pack testppg testprog.c" to generate
+          files with a .c.??z double-extension.
+        * Added support for a $TIGCC/include/s GNU assembly include directory.
+        * Now escaping arguments passed to GCC in order to allow -D switches
+          with definitions containing spaces or other shell metacharacters.
+
+- 2002-09-17, version 1.1.5 (Kevin Kofler)
+        * Allowing --standalone and --outputbin as synonyms for -standalone and
+          -outputbin.
+        * Implemented correct passing of -include and -x to GCC.
+        * Implemented correct passing of -8 and -9 to Obj2Ti.
+        * Implemented -keep, --keep, -save-temps and --save-temps switches.
+        * Now deleting object files by default (to match the behavior of the
+          Windows version). Use -keep if you want to keep them.
+
+- 2002-07-07, version 1.1.4 (Kevin Kofler):
+        Added support for _nostub DLLs.
+        Added support for Zeljko Juric's Quill Adventure Writer.
+
+- 2002-06-28, version 1.1.3 (Kevin Kofler):
+        Added -ar option.
+
+- 2002-03-25, version 1.1.2 (Romain Liévin):
+        Add-on in change_extension: packing works fine now.
+
+- 2002-03-21, version 1.1.1 (Romain Liévin):
+        Bug fix with obj2ti and long filenames.
+
+- 2002-02-22, version 1.1.0 (Romain Liévin):
+        New TIGCC switches:
+        -Wa, --> passage de parametres a GNU as
+        -Wl, --> passage de parametres a GNU ld
+        -WA, --> passage de parametres a A68k
+        A68k support finished and little bug fixes.
+        Minor improvements: support long filenames with spaces.
+        Parsing of pstarter file added
+        Added patching and -g (COFF & .s parsing) support.
+
+- 2001-12-23, version 1.0.0 (Romain Liévin):
+        John David Ratlif has written a better tigcc front-end so I kept it.
+        Version numbering restart from 1.0.
+
+-----
+
+- 2001-08-30, version 1.1.1 (Romain Liévin):
+        Use JM's linker instead of Vassor's one for converting pstarter.o
+        (EXEpacking).
+
+- 2001-08-24, version 1.1.0 (Romain Liévin):
+        Code is stable.
+
+- 2001-08-23, version 1.0.2 (Romain Liévin):
+        A bug with realloc (segfault) has been fixed.
+
+- 2001-08-22, version 1.0.1 (Romain Liévin):
+        tigcc front-end finished.
+        Added links so that anyone can read manpages.
+
+- 2001-08-21, version 1.0.0 (Romain Liévin):
+        I have written a TIGCC front-end for Linux.
+        Should be equivalent to the tigcc.exe of Windows which has been
+        written in Delphi by Sebastian Reichelt.

+ 81 - 0
tigcc-linux/sources/tigcc/README

@@ -0,0 +1,81 @@
+			+--------------------------+
+			| TIGCC-FRONTEND FOR LINUX |
+			+--------------------------+
+
+
+
+
+Foreword from the packager
+--------------------------
+
+	This program is a port of tigcc.exe, a Win32 program written in Delphi
+	by Sebastian Reichelt. It has been written from scratch in C language.
+
+	It should have the same behavior as the original.
+
+
+License
+-------
+
+	 TIGCC frontend For Linux
+	 Copyright (C) 2001 John David Ratliff
+	 Copyright (C) 2001-2002 Romain Liévin
+	 Copyright (C) 2002-2005 Kevin Kofler
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Usage
+-----
+
+	This program is a front end for TIGCC: it will automatically call the
+	necessary programs to compile everything you pass to it in the command
+	line.
+
+	John and Romain have written this program so that Windows users have a
+	similar environment under Linux, but also for easily recompiling source
+	code which has been developed under Windows.
+
+	You should use ONLY this frontend or tprbuilder to compile TIGCC
+	projects. Makefile hacks to directly use TIGCC components like gcc, as,
+	patcher, ... are NOT supported and will probably NOT work.
+
+Examples
+--------
+
+	You will find some examples in the tt and extgraph directories.
+	You will find also a lot of examples in the different source packages
+	available on Internet (more particularly www.ticalc.org).
+
+	Simple file:
+		tigcc -O2 -Wall HelloW.c (default: HelloW.89z)
+	or	tigcc -O2 -Wall HelloW.c -o foo (change to foo.89z)
+
+	Multiple files:
+		tigcc -O2 -Wall defs.c func-ti.c rpscript.c stdio-f.c sys.c
+		str.c  patches.c rpshash.c submalloc.c tiscript.c -o myvar
+
+	Simple file against an archive:
+		tigcc -O3 -Wall -W -fomit-frame-pointer demo1.c extgraph.a
+
+	Simple file but compressed:
+		tigcc -O2 ebook.c -pack ebookppg
+
+
+Thanks (by Romain Liévin)
+-------------------------
+
+	Sebastian Reichelt: he has written tigcc.exe and ide.exe. Thanks
+		for having replied to my questions.

+ 16 - 0
tigcc-linux/sources/tigcc/src/Makefile

@@ -0,0 +1,16 @@
+#TIGCC frontend makefile
+#Copyright (C) 2003, Kevin Kofler
+
+all: tigcc
+
+CC = gcc
+CFLAGS = -Os -s
+WARN_CFLAGS = -Wall -W
+
+tigcc: tigcc.c tigcc.h
+	$(CC) $(CFLAGS) $(WARN_CFLAGS) tigcc.c -o tigcc
+
+.PHONY: clean
+
+clean:
+	rm -f tigcc

+ 1088 - 0
tigcc-linux/sources/tigcc/src/tigcc.c

@@ -0,0 +1,1088 @@
+/*  TIGCC - A front-end for the compiler, assembler, linker and some other
+ *  stuffs.
+ *  Copyright (C) 2001 John David Ratliff
+ *  Copyright (C) 2001-2002  Romain Liévin
+ *  Copyright (C) 2002-2005 Kevin Kofler
+ *  Modified by Nils Gesbert, 2003
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "tigcc.h"
+
+/* The name the program was run with, stripped of any leading path. */
+char *program_name;
+
+void print_version(void)
+{
+  fprintf(stderr, "tigcc version %s built for TIGCC/*nix version %s\n", VERSION, TIGCC_VERSION);
+  exit(0);
+}
+
+/* Display helping informations */
+static void
+usage (int status)
+{
+  printf ("%s - front-end for TIGCC\n", program_name);
+  printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
+  printf ("Options:\n"
+          "  -h, --help            display this help and exit\n"
+          "  -V, --version         output version information and exit\n"
+          "  -v, --verbose         set verbosity on: show what the program is doing\n"
+          "  -q, --quiet           display nothing\n"
+          "  -E,                   pre-process but don't compile or assemble\n"
+          "  -S,                   compile but don't assemble or link\n"
+          "  -c,                   compile/assemble, but don't link\n"
+          "  -g, --debug           turns on debugging information (DWARF 2 format)\n"
+          "  -bsr                  ignored for backwards compatibility\n"
+          "  -o [outfile]          output to file outfile\n"
+          "  -pack [varname]       compress the program using ExePack technology\n"
+          "  -outputbin            produce a pure binary file (as with ttstrip)\n"
+          "  -standalone           does not link against the tigcc.a archive\n"
+          "  -r, --redirect        redirect stdout to the tigcc.log file\n"
+          "  -Wa/WA,options        pass options to as/a68k\n"
+          "  -ar                   create static library (function archive)\n"
+          "  -keep                 keep object files\n"
+          "  --all-relocs          assemble files in all-relocs mode (for range cutting)\n"
+          "Linker options are automatically passed on to ld-tigcc. See ld-tigcc --help for\n"
+          "details.\n"
+          "\n");
+  exit (status);
+}
+
+#define print_help() usage(0)
+
+/* Process cmdline args */
+short int process_arg(short int arg, char *argv[], int argc)
+{
+  char *cur_arg = argv[arg];
+
+  if (!strcmp("-h", cur_arg) || !strcmp("--help", cur_arg)) {
+    print_help();
+  } else if (!strcmp("-V", cur_arg) || !strcmp("--version", cur_arg)) {
+    print_version();
+  } else if (!strcmp("-v", cur_arg) || !strcmp("--verbose", cur_arg)) {
+    ld_argv[ld_argc++] = cur_arg;
+    gcc_argv[gcc_argc++] = cur_arg;
+    verbose = TRUE;
+    printcommands = TRUE;
+    quiet = FALSE;
+  } else if (!strcmp("-v0", cur_arg)) {
+    printcommands = TRUE;
+  } else if (!strcmp("-q", cur_arg) || !strcmp("--quiet", cur_arg)) {
+    quiet = TRUE;
+    verbose = FALSE;
+  } else if(!strcmp("-E", cur_arg)) {
+    delete = FALSE;
+    patch = FALSE;
+    do_compile = FALSE;
+    do_link = FALSE;
+    do_assemble = FALSE;
+  } else if (!strcmp("-S", cur_arg)) {
+    delete = FALSE;
+    do_link = FALSE;
+    do_assemble = FALSE;
+  } else if (!strcmp("-c", cur_arg)) {
+    do_link = FALSE;
+  } else if (!strcmp("-g", cur_arg)) {
+    debug = TRUE;
+  } else if (!strcmp("--debug", cur_arg)) {
+    debug = TRUE;
+  } else if (!strcmp("-pack", cur_arg)) {
+    char *next_arg;
+    if(arg >= argc-1) {
+      fprintf(stderr, "Error: you didn't specify a pack file\n");
+      exit(-1);
+    } else {
+      next_arg = argv[++arg];
+      if(next_arg[0] == '-') {
+        fprintf(stderr, "Error: invalid pack filename\n");
+        exit(-1);
+      }
+      packfile[0] = 0;
+      strncpy(packfile, next_arg, 8);
+      do_pack = TRUE;
+    }
+  } else if(!strcmp("-bsr", cur_arg)) {
+/* Empty. Ignored for backwards compatibility. */
+  } else if (!strcmp("-outputbin", cur_arg) || !strcmp("--outputbin", cur_arg)) {
+    outputbin = TRUE;
+  } else if (!strcmp("-standalone", cur_arg) || !strcmp("--standalone", cur_arg)) {
+    nostdlib = TRUE;
+  } else if (!strcmp("-ar", cur_arg)) {
+    staticlib = TRUE;
+    nostdlib = TRUE;
+    allrelocs = TRUE;
+    optreturns = TRUE;
+  } else if (!strcmp("-quill", cur_arg)) {
+    char *quill_drv = malloc (strlen(tigcc_base) + 25);
+    if (!quill_drv) {
+      fprintf(stderr, "Fatal error: not enough free memory\n");
+      exit(-1);
+    }
+    sprintf(quill_drv, "%s/bin/quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/bin/Quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/include/c/quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/include/c/Quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/include/quill/quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/include/quill/Quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/include/Quill/quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/include/Quill/Quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/lib/quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+    sprintf(quill_drv, "%s/lib/Quill.drv", tigcc_base);
+    if(access(quill_drv, F_OK) != -1) goto quill_drv_found;
+
+    fprintf(stderr, "Quill installation problem: quill.drv file is missing.\n");
+    exit(-1);
+
+  quill_drv_found:
+    gcc_argv[gcc_argc++] = "-include";
+    gcc_argv[gcc_argc++] = quill_drv;
+    gcc_argv[gcc_argc++] = "-x";
+    gcc_argv[gcc_argc++] = "c";
+  } else if (!strcmp("-o", cur_arg) || !strcmp("--output", cur_arg)) {
+    if (++arg > argc) {
+      fprintf(stderr, "Error: you didn't specify an output file\n");
+    } else {
+      outfile = argv[arg];
+    }
+  } else if (!strcmp("-r", cur_arg) || !strcmp("--redirect", cur_arg)) {
+    freopen (REDIRECT, "wt", stdout);
+    dup2 (STDOUT_FILENO, STDERR_FILENO);
+  } else if (!strncmp("-Wa,", cur_arg, 4)) {
+    as_args = strdup (cur_arg);
+    if (!as_args) {
+      fputs ("Fatal error: not enough free memory\n", stderr);
+      exit (-1);
+    }
+  } else if (!strncmp("-WA,", cur_arg, 4)) {
+    a68k_args = strdup (cur_arg);
+    if (!a68k_args) {
+      fputs ("Fatal error: not enough free memory\n", stderr);
+      exit (-1);
+    }
+  } else if (!strcmp("-np", cur_arg)) {
+    printf("Developer option: no patching enabled !\n");
+    patch = FALSE;
+  } else if (!strcmp("-keep", cur_arg) || !strcmp("--keep", cur_arg)) {
+    keepobj = TRUE;
+  } else if (!strcmp("-save-temps", cur_arg) || !strcmp("--save-temps", cur_arg)) {
+    savetemps = keepobj = TRUE; delete = FALSE;
+    gcc_argv[gcc_argc++] = cur_arg;
+  } else if (!strcmp("--fargo", cur_arg)) {
+    fargo = TRUE;
+    ld_argv[ld_argc++] = cur_arg;
+  } else if (!strcmp("--flash-os", cur_arg)) {
+    flashos = TRUE;
+    ld_argv[ld_argc++] = cur_arg;
+  } else if (!strcmp("--cut-ranges", cur_arg)) {
+    allrelocs = TRUE;
+    ld_argv[ld_argc++] = cur_arg;
+  } else if (!strcmp("--all-relocs", cur_arg)) {
+    allrelocs = TRUE;
+  } else if (!strcmp("--optimize-code", cur_arg) || !strcmp("--optimize-returns", cur_arg)) {
+    optreturns = TRUE;
+    ld_argv[ld_argc++] = cur_arg;
+  } else if (!strcmp("--native", cur_arg) || !strcmp("--remove-unused", cur_arg)
+             || !strcmp("--optimize-relocs", cur_arg) || !strcmp("--optimize-nops", cur_arg)
+             || !strcmp("--optimize-branches", cur_arg) || !strcmp("--optimize-moves", cur_arg)
+             || !strcmp("--optimize-tests", cur_arg) || !strcmp("--optimize-calcs", cur_arg)
+             || !strcmp("--reorder-sections", cur_arg) || !strcmp("--merge-constants", cur_arg)
+             || !strcmp("--omit-bss-init", cur_arg) || !strcmp("--data-var-copy=never", cur_arg)
+             || !strcmp("--data-var-copy=always", cur_arg)
+             || !strcmp("--data-var-copy=archived", cur_arg) || !strcmp("--dump", cur_arg)
+             || !strcmp("--dump0", cur_arg) || !strcmp("--dump1", cur_arg) || !strcmp("--dump2", cur_arg)
+             || !strcmp("--dump3", cur_arg) || !strcmp("--dump4", cur_arg) || !strcmp("--dump5", cur_arg)
+             || !strcmp("--dump6", cur_arg) || !strcmp("--dump7", cur_arg) || !strcmp("--dump8", cur_arg)
+             || !strcmp("--dump9", cur_arg)) {
+    ld_argv[ld_argc++] = cur_arg;
+  } else if (!strcmp("-n", cur_arg) || !strcmp("--varname", cur_arg)) {
+    if (++arg > argc) {
+      fprintf(stderr, "Error: you didn't specify a variable name\n");
+    } else {
+      ld_argv[ld_argc++] = cur_arg;
+      ld_argv[ld_argc++] = argv[arg];
+    }
+  } else if (!strcmp("-d", cur_arg) || !strcmp("--data-var", cur_arg)) {
+    if (++arg > argc) {
+      fprintf(stderr, "Error: you didn't specify a data variable name\n");
+    } else {
+      ld_argv[ld_argc++] = cur_arg;
+      ld_argv[ld_argc++] = argv[arg];
+      nomergesections = TRUE;
+    }
+  }
+
+  return arg;
+}
+
+short int is_tigcc_arg(char *arg)
+{
+  short int loop;
+
+  for (loop = 0; tigcc_args[loop] != NULL; loop++) {
+    if (strncmp(arg, tigcc_args[loop], 4) == 0) {
+      return TRUE;
+    }
+  }
+
+  return FALSE;
+}
+
+/* Return file type */
+short int is_source_file(char *file)
+{
+  char *ext = strrchr(file, '.');
+  short int filetype = BADFILE;
+
+  if (ext == NULL) {
+    return filetype;
+  }
+    
+  if (strcasecmp(ext, ".c") == 0) {
+    filetype = CFILE;
+  } else if (strcasecmp(ext, ".asm") == 0) {
+    filetype = ASMFILE;
+  } else if (strcasecmp(ext, ".s") == 0) {
+    filetype = SFILE;
+  } else if (strcasecmp(ext, ".o") == 0) {
+    filetype = OFILE;
+  } else if (strcasecmp(ext, ".a") == 0) {
+    filetype = AFILE;
+  } else if (strcasecmp(ext, ".qll") == 0) {
+    filetype = QLLFILE;
+  }
+
+  return filetype;
+}
+
+#define add_to_file_array(file,array) do {array->files[array->count++] = file;} while (0)
+
+void free_file_array(array_of_files *array) 
+{
+
+  /* (NG) Well, it doesn't work even if *all* the strings in the array are malloc-ated.
+     I don't understand why... :(
+     Anyway, it won't work if a68k() is called as it is now (see there). */
+
+#if 0
+  short int loop;
+    
+  for (loop = 0; loop < array->count; loop++) {
+    free(array->files[loop]);
+  }
+#endif
+    
+  free(array);
+}
+
+/* Change filename extension and keep long filenames */
+char *change_extension(char *file, char *newext)
+{
+  char *start = (char *)strrchr(file, '.');
+  if(start == NULL) {
+    start = file + strlen(file);
+  }
+
+  sprintf(start, "%s", newext);
+
+  /* (NG) So to be safe file must be strlen(file) + strlen (newext) + 1 long... */
+
+  return file;
+}
+
+void parse_args(int *argc, char *argv[])
+{
+  static int firstsourcefile = 0;
+  short int loop, filetype;
+  array_of_files *array = NULL;
+
+  for (loop = 1; loop < (*argc); loop++) {
+
+    if ((!strcmp(argv[loop],"-include")||!strcmp(argv[loop],"-x")||!strcmp(argv[loop],"--param")||!strcmp(argv[loop],"-isystem")) && loop+1<*argc) {
+      gcc_argv[gcc_argc++] = argv[loop++];
+      gcc_argv[gcc_argc++] = argv[loop];
+    } else if (is_tigcc_arg(argv[loop])) {
+      loop = process_arg(loop, argv, *argc);
+    } else if (argv[loop][0] == '-') {
+      // if it's not one of our args, pass it to gcc
+      gcc_argv[gcc_argc++] = argv[loop];
+    } else {
+      filetype = is_source_file(argv[loop]);
+
+      switch (filetype) {
+      case CFILE:
+        array = src_files;
+      handle_outfile:
+        if (!firstsourcefile) firstsourcefile = loop;
+        break;
+      case ASMFILE:
+        array = a68k_files;
+        goto handle_outfile;
+      case SFILE:
+        array = asm_files;
+        goto handle_outfile;
+      case OFILE:
+        array = obj_files;
+        goto handle_outfile;
+      case AFILE:
+        array = ar_files;
+        break;
+      case QLLFILE: /* Quill files are just C files which need a special
+                       -include switch to include the quill.drv header */
+        array = src_files;
+        goto handle_outfile;
+      default: fprintf(stderr, "Invalid option %s\n", argv[loop]); break;
+      }
+
+      if (array != NULL) {
+#if 0 /* Necessary if we want free_file_array not to crash, but it's a waste of memory... */
+        char *s = strdup(argv[loop]);
+        if (!s) {
+          fputs ("Fatal error: not enough free memory.\n", stderr);
+          exit (1);
+        }
+        add_to_file_array(s, array);
+#else
+        add_to_file_array(argv[loop], array);
+#endif
+      }
+    }
+  }
+
+  // If no output filename, first arg used as default name.
+  // However, don't do this with -S or -c. Instead, let compile() or
+  // assemble() guess an appropriate file name for each individual file.
+  if (firstsourcefile && do_link && !outfile) {
+    outfile = malloc(strlen(argv[firstsourcefile])+3);
+    strcpy(outfile,argv[firstsourcefile]);
+    change_extension(outfile,".o");
+  }
+}
+
+static inline void escape_arg(char *escaped_arg, const char *unescaped_arg)
+{
+  char *p;
+  strcpy(escaped_arg,unescaped_arg);
+  for (p=escaped_arg; *p; p++) {
+    switch(*p) {
+     /* The following characters are shell characters and need to be escaped! */
+      case ' ':
+      case '\\':
+      case '\"':
+      case '\'':
+      case '$':
+      case '!':
+      case '^':
+      case '&':
+      case '*':
+      case '(':
+      case ')':
+      case '~':
+      case '[':
+      case ']':
+      case '|':
+      case '{':
+      case '}':
+      case ';':
+      case '<':
+      case '>':
+      case '?':
+        memmove(p+1,p,strlen(p)+1);
+        *(p++)='\\';
+      default:
+        break;
+    }
+  }
+}
+
+/* Execute a program */
+void execute(const char *program, char **argv)
+{
+  pid_t pid;
+  int status;
+
+  if (printcommands) {
+    char **ptr;
+    fprintf(stderr, "tigcc: %s", program);
+    for (ptr = argv + 1; *ptr; ptr++)
+    {
+      char escapedarg[((strlen(*ptr))<<1)+1];
+      escape_arg(escapedarg,*ptr);
+      fprintf (stderr, " %s", escapedarg);
+    }
+    putc ('\n', stderr);
+  }
+
+  fflush (stdout);
+  pid = fork();
+  if (pid == 0) {
+    execv (program, argv);
+    // execv only returns in case of an error
+    fprintf (stderr, "Error executing %s\n", program);
+    exit (1);
+  }
+  else if (pid < 0 || (waitpid (pid, &status, 0) != pid) || !WIFEXITED(status)) {
+    fprintf (stderr, "Error executing %s\n", program);
+    exit (1);
+  }
+  /* Fail silently if another program already showed an error message. */
+  if (WEXITSTATUS(status)) exit(1);
+}
+
+/* Execute GNU cc */
+void compile(char *file) 
+{
+  unsigned short local_argc = gcc_argc;
+  char gcc_name[9 + strlen (tigcc_base)];
+  char bindir[6 + strlen (tigcc_base)];
+  char includedir[13 + strlen (tigcc_base)];
+
+  sprintf (gcc_name, "%s/bin/gcc", tigcc_base);
+  sprintf (bindir, "-B%s/bin/", tigcc_base);
+  sprintf (includedir, "-I%s/include/c", tigcc_base);
+  gcc_argv[0] = gcc_name;
+  gcc_argv[local_argc++] = bindir;
+  gcc_argv[local_argc++] = includedir;
+  gcc_argv[local_argc++] = file;
+
+  if (!do_compile) { // preprocess only
+    gcc_argv[local_argc++] = "-E";
+    if (outfile) {
+      gcc_argv[local_argc++] = "-o";
+      gcc_argv[local_argc++] = outfile;
+    }
+
+    gcc_argv[local_argc] = NULL;
+    execute(gcc_name, gcc_argv);
+  }
+  else {
+    char *tmpfile;
+    if (!do_assemble && outfile) tmpfile = outfile;
+    else {
+      tmpfile = malloc (strlen (file) + 3);
+
+      if (!tmpfile) {
+        fprintf(stderr, "Fatal error: not enough free memory\n");
+        exit(-1);
+      }
+
+      strcpy(tmpfile, file);
+      change_extension(tmpfile, ".s");
+    }
+
+    if (debug) {
+      gcc_argv[local_argc++] = "-gdwarf-2";
+      gcc_argv[local_argc++] = "-g3";
+      gcc_argv[local_argc++] = "-fasynchronous-unwind-tables";
+    }
+    if (nomergesections) {
+      gcc_argv[local_argc++] = "-mno-merge-sections";
+    }
+    gcc_argv[local_argc++] = "-S";
+    if (fargo) gcc_argv[local_argc++] = "-DFARGO";
+    if (flashos) gcc_argv[local_argc++] = "-DFLASH_OS";
+    gcc_argv[local_argc++] = "-o";
+    gcc_argv[local_argc++] = tmpfile;
+
+    add_to_file_array(tmpfile, asm_files);
+
+    gcc_argv[local_argc] = NULL;
+    execute(gcc_name, gcc_argv);
+
+    // patch assembly file
+    if(patch) {
+      char patcher_name[strlen(tigcc_base) + 13];
+      char *argv[] = {patcher_name, tmpfile, "-o", tmpfile, NULL};
+      sprintf (patcher_name, "%s/bin/patcher", tigcc_base);
+
+      execute (patcher_name, argv);
+    }
+  }
+}
+
+/* Execute GNU as */
+void assemble(char *file)
+{
+  char as_name[strlen(tigcc_base) + 8];
+  char includedir[strlen(tigcc_base) + 13];
+  char *tmpfile;
+  char *argv[7 + (as_args ? strlen (as_args) / 2 : 0) + allrelocs + optreturns + debug];
+  char asargtokens[as_args?(strlen(as_args)+1):0];
+  int i = 6;
+  argv[0] = as_name;
+  argv[1] = "-mc68000";
+  argv[2] = includedir;
+  argv[3] = file;
+  argv[4] = "-o";
+
+  if (!do_link && outfile) tmpfile = outfile;
+  else {
+    tmpfile = malloc (strlen (file) + 3);
+    if (!tmpfile) {
+      fprintf(stderr, "Fatal error: not enough free memory\n");
+      exit(-1);
+    }
+    strcpy(tmpfile, file);
+    change_extension(tmpfile, ".o");
+  }
+
+  argv[5] = tmpfile;
+  sprintf (as_name, "%s/bin/as", tigcc_base);
+  sprintf (includedir, "-I%s/include/s", tigcc_base);
+
+  // add the file to the list
+  add_to_file_array(tmpfile, obj_files);
+
+  if (allrelocs) argv[i++] = "--all-relocs";
+  if (optreturns) argv[i++] = "--keep-locals";
+  if (debug) argv[i++] = "--gdwarf2";
+  if (as_args) {
+    strcpy (asargtokens, as_args);
+    strtok (asargtokens, ",");
+    while ((argv[i++] = strtok (NULL, ",")));
+  }
+  else argv[i] = NULL;
+
+  execute(as_name, argv);
+}
+
+/* Execute ld-tigcc */
+void ld(void)
+{
+  short int loop;
+
+  unsigned short local_argc = ld_argc;
+  char ld_name[strlen(tigcc_base) + 14];
+
+  char tmpfile[strlen(outfile) + 1];
+
+  sprintf (ld_name, "%s/bin/ld-tigcc", tigcc_base);
+  ld_argv[0] = ld_name;
+
+  for (loop = 0; loop < obj_files->count; loop++)
+    ld_argv[local_argc++] = obj_files->files[loop];
+
+  for (loop = 0; loop < ar_files->count; loop++)
+    ld_argv[local_argc++] = ar_files->files[loop];
+
+  ld_argv[local_argc++] = "-o";
+  ld_argv[local_argc++] = tmpfile;
+
+  strcpy(tmpfile, outfile);
+  change_extension(tmpfile, "");
+
+  if(outputbin || do_pack)
+    ld_argv[local_argc++] = "--outputbin";
+
+  ld_argv[local_argc] = NULL;
+
+  execute(ld_name, ld_argv);
+}
+
+/* Execute A68K */
+void a68k(char *file)
+{
+  char *tmpfile;
+  if (!do_link && outfile) {
+    tmpfile = malloc (strlen (outfile) + 3);
+    if (!tmpfile) {
+      fprintf(stderr, "Fatal error: not enough free memory\n");
+      exit(-1);
+    }
+    sprintf(tmpfile, "-o%s", outfile);
+  }
+  else {
+    tmpfile = malloc (strlen (file) + 5);
+    if (!tmpfile) {
+      fprintf(stderr, "Fatal error: not enough free memory\n");
+      exit(-1);
+    }
+    sprintf(tmpfile, "-o%s", file);
+    change_extension(tmpfile, ".o");
+  }
+  tmpfile += 2; /* Warning: this prevents free_file_array from working */
+
+  /* First, assemble file with A68k which produces AmigaOS files */
+
+  {
+    char a68k_name[strlen(tigcc_base) + 10];
+    char includedir[strlen(tigcc_base) + 16];
+    char *argv[7 + (a68k_args ? strlen (a68k_args) / 2 : 0) + allrelocs + optreturns + quiet];
+    char a68kargtokens[a68k_args?(strlen(a68k_args)+1):0];
+    int i = 6;
+    argv[0] = a68k_name;
+    argv[1] = includedir;
+    argv[2] = "-g";
+    argv[3] = "-t";
+    argv[4] = file;
+    argv[5] = tmpfile;
+    
+    sprintf (a68k_name, "%s/bin/a68k", tigcc_base);
+    sprintf (includedir, "-i%s/include/asm/", tigcc_base);
+
+    // add the file to the list
+    add_to_file_array(tmpfile, obj_files);
+
+    if (allrelocs) argv[i++] = "-a";
+    if (optreturns) argv[i++] = "-d";
+    if (quiet) argv[i++] = "-q";
+    if (a68k_args) {
+      strcpy (a68kargtokens, a68k_args);
+      strtok (a68kargtokens, ",");
+      while ((argv[i++] = strtok (NULL, ",")));
+    }
+    else argv[i] = NULL;
+
+    execute(a68k_name, argv);
+  }
+}
+
+/* Parse pstarter file and change internal varname */
+static short int parse_pstarter(const char *input, const char *output,
+                                const char *packvar)
+{
+  FILE *f;
+  char array[65536];
+  char *token = "tempprog";
+  unsigned int i, n;
+  unsigned int j, k;
+
+  // open file in reading
+  f = fopen(input, "rb");
+  if(f == NULL) {
+    fprintf(stderr, "Unable to open pstarter.o\n");
+    exit(-1);
+  }
+
+  n = fread(array, sizeof(char), 65536*sizeof(char), f);
+  fclose(f);
+
+  // change varname
+  for(i=0; i<n-strlen(token); i++) {
+    for(j=0, k=0; j<strlen(token); j++) {
+      if(array[i+j] == token[j]) {
+        k++;
+      }
+    }
+    if(k==strlen(token)) {
+      //printf("offset = %i = 0x%04x\n", i, i);
+      break;
+    }
+  }
+  sprintf(array+i, "%s", packvar);
+
+  // open file in writing
+  f = fopen(output, "wb");
+  if(f == NULL) {
+    fprintf(stderr, "Unable to open pstarter.o\n");
+    exit(-1);
+  }
+
+  fwrite(array, sizeof(char), n*sizeof(char), f);
+  fclose(f);
+
+  return 0;
+}
+
+/* Execute ar-tigcc */
+void ar(void)
+{
+  int i, loop;
+  char buffer[strlen(outfile) + 3];
+  char ar_name[14 + strlen(tigcc_base)];
+  char *argv[4 + obj_files->count + ar_files->count];
+  argv[0] = ar_name;
+  argv[1] = "-o";
+  argv[2] = buffer;
+
+  strcpy(buffer, outfile);
+  change_extension(buffer, ".a");
+
+  unlink (buffer);
+
+  sprintf(ar_name, "%s/bin/ar-tigcc", tigcc_base);
+
+  i = 3;
+
+  for (loop = 0; loop < obj_files->count; loop++)
+    argv[i++] = obj_files->files[loop];
+
+  for (loop = 0; loop < ar_files->count; loop++)
+    argv[i++] = ar_files->files[loop];
+
+  argv[i] = NULL;
+
+  execute(ar_name, argv);
+}
+
+/* Compress TI executable */
+void pack(void)
+{
+  char pstarter_file[25 + strlen(tigcc_base)];
+  char tmpfile[strlen(outfile) + 14];
+  int ti89_targeted=0;
+
+  // check for decompressor program
+  sprintf(pstarter_file, "%s/lib/pstarter.o", tigcc_base);
+  if(access(pstarter_file, F_OK) == -1) {
+    fprintf(stderr, "TIGCC installation problem: pstarter.o file is missing.\n");
+    return;
+  }
+
+  strcpy(tmpfile, outfile);
+  change_extension(tmpfile, ".z89");
+
+  if(access(tmpfile, F_OK) != -1) {
+    ti89_targeted=1;
+    // compress on calc variable
+    {
+      char ttpack_name[strlen (tigcc_base) + 12];
+      char *argv[5];
+      int i=1;
+      *argv = ttpack_name;
+      if (verbose)
+        argv[i++] = "-v";
+      else if (quiet)
+        argv[i++] = "-quiet";
+      argv[i++] = tmpfile;
+      argv[i++] = TMP_PCK;
+      argv[i] = NULL;
+
+      sprintf (ttpack_name, "%s/bin/ttpack", tigcc_base);
+      execute(ttpack_name, argv);
+    }
+    // encapsulate in var (.89y)
+    {
+      char ttbin2oth_name[strlen(tigcc_base) + 15];
+      char *argv[7];
+      int i=1;
+      *argv = ttbin2oth_name;
+      if (quiet)
+        argv[i++] = "-quiet";
+      argv[i++] = "-89";
+      argv[i++] = "ppg";
+      argv[i++] = TMP_PCK;
+      argv[i++] = packfile;
+      argv[i] = NULL;
+
+      sprintf(ttbin2oth_name, "%s/bin/ttbin2oth", tigcc_base);
+      execute(ttbin2oth_name, argv);
+    }
+
+    unlink(tmpfile);
+    unlink(TMP_PCK);
+  }
+
+  change_extension(tmpfile, ".zv2");
+
+  if(access(tmpfile, F_OK) != -1) {
+    // compress on calc variable
+    {
+      char ttpack_name[strlen (tigcc_base) + 12];
+      char *argv[5];
+      int i=1;
+      *argv = ttpack_name;
+      if (verbose)
+        argv[i++] = "-v";
+      else if (quiet)
+        argv[i++] = "-quiet";
+      argv[i++] = tmpfile;
+      argv[i++] = TMP_PCK;
+      argv[i] = NULL;
+
+      sprintf (ttpack_name, "%s/bin/ttpack", tigcc_base);
+      execute(ttpack_name, argv);
+    }
+    // encapsulate in var (.v2y)
+    {
+      char ttbin2oth_name[strlen(tigcc_base) + 15];
+      char filename9x[strlen(packfile)+5];
+      char filenamev2[strlen(packfile)+5];
+      char *argv[7];
+      int i=1;
+      *argv = ttbin2oth_name;
+      if (quiet)
+        argv[i++] = "-quiet";
+      argv[i++] = "-92";
+      argv[i++] = "ppg";
+      argv[i++] = TMP_PCK;
+      argv[i++] = packfile;
+      argv[i] = NULL;
+
+      sprintf(ttbin2oth_name, "%s/bin/ttbin2oth", tigcc_base);
+      execute(ttbin2oth_name, argv);
+      strcpy(filename9x,packfile);
+      strcat(filename9x,".9xy");
+      strcpy(filenamev2,packfile);
+      strcat(filenamev2,".v2y");
+      rename(filename9x,filenamev2);
+    }
+
+    unlink(tmpfile);
+    unlink(TMP_PCK);
+  }
+
+  change_extension(tmpfile, ".z9x");
+
+  if(access(tmpfile, F_OK) != -1) {
+    // compress on calc variable
+    {
+      char ttpack_name[strlen (tigcc_base) + 12];
+      char *argv[5];
+      int i=1;
+      *argv = ttpack_name;
+      if (verbose)
+        argv[i++] = "-v";
+      else if (quiet)
+        argv[i++] = "-quiet";
+      argv[i++] = tmpfile;
+      argv[i++] = TMP_PCK;
+      argv[i] = NULL;
+
+      sprintf (ttpack_name, "%s/bin/ttpack", tigcc_base);
+      execute(ttpack_name, argv);
+    }
+    // encapsulate in var (.9xy)
+    {
+      char ttbin2oth_name[strlen(tigcc_base) + 15];
+      char *argv[7];
+      int i=1;
+      *argv = ttbin2oth_name;
+      if (quiet)
+        argv[i++] = "-quiet";
+      argv[i++] = "-92";
+      argv[i++] = "ppg";
+      argv[i++] = TMP_PCK;
+      argv[i++] = packfile;
+      argv[i] = NULL;
+
+      sprintf(ttbin2oth_name, "%s/bin/ttbin2oth", tigcc_base);
+      execute(ttbin2oth_name, argv);
+    }
+
+    unlink(tmpfile);
+    unlink(TMP_PCK);
+  }
+
+  // parse pstarter.o and change varname
+  parse_pstarter(pstarter_file, "pstarter.o", packfile);
+
+  // create decompressor (.??z)
+  {
+    char ld_tigcc_name[strlen(tigcc_base) + 14];
+    char *argv[] = {ld_tigcc_name, "pstarter.o", "-o", tmpfile, NULL};
+
+    sprintf (ld_tigcc_name, "%s/bin/ld-tigcc", tigcc_base);
+    change_extension(tmpfile, "");
+    execute(ld_tigcc_name, argv);
+  }
+  unlink("pstarter.o");
+
+  if (!ti89_targeted) return; // no TI-89 -> no Titanium
+
+#if 1
+  // zap any leftover Titanium launchers
+  strcat(tmpfile, "-titanium.89z");
+  unlink(tmpfile);
+  strcpy(tmpfile, outfile);
+  strcat(tmpfile, "-Titanium.89z");
+  unlink(tmpfile);
+#else
+  // check for Titanium decompressor program
+  sprintf(pstarter_file, "%s/lib/pstarter-titanium.o", tigcc_base);
+  if(access(pstarter_file, F_OK) == -1) {
+    fprintf(stderr, "TIGCC installation problem: pstarter-titanium.o file is missing.\n");
+    return;
+  }
+
+  // parse pstarter.o and change varname
+  parse_pstarter(pstarter_file, "pstarter.o", packfile);
+
+  // create decompressor (*-titanium.89z)
+  {
+    char ld_tigcc_name[strlen(tigcc_base) + 14];
+    char *argv[] = {ld_tigcc_name, "pstarter.o", "-o", tmpfile, NULL};
+
+    sprintf (ld_tigcc_name, "%s/bin/ld-tigcc", tigcc_base);
+    strcat(tmpfile, "-titanium");
+    execute(ld_tigcc_name, argv);
+    // zap non-TI-89 Titanium launchers
+    change_extension(tmpfile, ".9xz");
+    unlink(tmpfile);
+    change_extension(tmpfile, ".v2z");
+    unlink(tmpfile);
+  }
+  unlink("pstarter.o");
+#endif
+}
+
+/* Destroy allocated resources */
+void safe_exit(void)
+{
+  free(gcc_argv);
+  free(ld_argv);
+  free_file_array(src_files);
+  free_file_array(obj_files);
+  free_file_array(asm_files);
+  free_file_array(a68k_files);
+  free_file_array(ar_files);
+
+  free(as_args); free(a68k_args);
+}
+
+int main(int argc, char *argv[]) 
+{
+  short int loop;
+
+  program_name = argv[0];
+    
+  if (argc < 2) {
+    fprintf(stderr, "tigcc: no input files\n");
+    exit(0);
+  }
+  
+  if ((tigcc_base = getenv("TIGCC")) == NULL) {
+    fprintf(stderr, "Fatal error: TIGCC is not defined in the environment. TIGCC must be defined before tigcc can run.\nFor (ba)sh, try: export TIGCC=/path/to/tigcc\nFor (t)csh, try: setenv TIGCC /path/to/tigcc\n");
+    exit(-1);
+  }
+
+  if (atexit(safe_exit) != 0) {
+    fprintf(stderr, "Fatal error: unable to register safe exit callback\n");
+    exit(-1);
+  }
+
+  /* worst case (every arg is a gcc arg): argc + -Bprefix/bin/ + -Idir + -gdwarf-2 + -g3 +
+                                          + -fasynchronous-unwind-tables + -mno-merge-sections + -S
+                                          + -DFARGO/-DFLASH_OS + -include + quill.drv + -x + c + -o + filename */
+  gcc_argv = malloc((argc + 15) * sizeof (char*));
+
+  /* worst case: each arg is either a file to link or a linker switch; add
+                 tigcc.a/fargo.a/flashos.a, -o outfile, --outputbin, NULL */
+  ld_argv = malloc((argc + 5) * sizeof (char*));
+
+  src_files = malloc(sizeof (array_of_files) + MAX_ARRAY_FILES * sizeof (char*));
+  obj_files = malloc(sizeof (array_of_files) + MAX_ARRAY_FILES * sizeof (char*));
+  asm_files = malloc(sizeof (array_of_files) + MAX_ARRAY_FILES * sizeof (char*));
+  a68k_files = malloc(sizeof (array_of_files) + MAX_ARRAY_FILES * sizeof (char*));
+  ar_files = malloc(sizeof (array_of_files) + MAX_ARRAY_FILES * sizeof (char*));
+
+  if ((gcc_argv == NULL) || (ld_argv == NULL) || (src_files == NULL) || (obj_files == NULL) ||
+      (asm_files == NULL) || (a68k_files == NULL) || (ar_files == NULL)) {
+    fprintf(stderr, "Fatal error: not enough free memory\n");
+    exit(-1);
+  }
+
+  src_files -> count = 0;
+  obj_files -> count = 0;
+  asm_files -> count = 0;
+  a68k_files -> count = 0;
+  ar_files -> count = 0;
+
+  // parse the arguments
+  parse_args(&argc, argv);
+
+  // check there is at least one file to process
+  if(!src_files->count && !asm_files->count && !a68k_files->count && !obj_files->count)
+    {
+      fprintf(stderr, "tigcc: no input files\n");
+      exit(0);
+    }
+
+  // set the archive file
+  if(!nostdlib) {
+    char *buffer = malloc(strlen(tigcc_base)+13);
+    sprintf(buffer, flashos?"%s/lib/flashos.a":(fargo?"%s/lib/fargo.a":"%s/lib/tigcc.a"), tigcc_base);
+    add_to_file_array(buffer, ar_files);
+  }
+
+  if(1) {
+    for (loop = 0; loop < src_files->count; loop++) {
+      compile(src_files->files[loop]);
+    }
+  }
+
+  if (do_assemble) {
+    for (loop = 0; loop < asm_files->count; loop++) {
+      assemble(asm_files->files[loop]);
+    }
+
+    for (loop = 0; loop < a68k_files->count; loop++) {
+      a68k(a68k_files->files[loop]);
+    }
+  }
+
+  if (staticlib) ar(); else {
+
+    if (do_link && obj_files->count > 0) {
+      ld();
+    }
+
+  }
+
+  if(delete) {
+    for (loop = 0; loop < src_files->count; loop++) {
+      char tmpfile[strlen(src_files->files[loop]) + 3];
+      strcpy(tmpfile, src_files->files[loop]);
+      change_extension(tmpfile, ".s");
+      unlink(tmpfile);
+    }
+  }
+
+  if(do_link && !keepobj) {
+    for (loop = 0; loop < src_files->count; loop++) {
+      char tmpfile[strlen(src_files->files[loop]) + 3];
+      strcpy(tmpfile, src_files->files[loop]);
+      change_extension(tmpfile, ".o");
+      unlink(tmpfile);
+    }
+    for (loop = 0; loop < asm_files->count; loop++) {
+      char tmpfile[strlen(asm_files->files[loop]) + 3];
+      strcpy(tmpfile, asm_files->files[loop]);
+      change_extension(tmpfile, ".o");
+      unlink(tmpfile);
+    }
+    for (loop = 0; loop < a68k_files->count; loop++) {
+      char tmpfile[strlen(a68k_files->files[loop]) + 3];
+      strcpy(tmpfile, a68k_files->files[loop]);
+      change_extension(tmpfile, ".o");
+      unlink(tmpfile);
+    }
+  }
+
+  if (!staticlib && do_pack && do_link) {
+    pack();
+  }
+  return 0;
+}

+ 98 - 0
tigcc-linux/sources/tigcc/src/tigcc.h

@@ -0,0 +1,98 @@
+/*  TIGCC - A front-end for the compiler, assembler, linker and some other
+ *  stuffs.
+ *  Copyright (C) 2001 John David Ratliff
+ *  Copyright (C) 2001-2002  Romain Liévin
+ *  Copyright (C) 2002-2004 Kevin Kofler
+ *  Modified by Nils Gesbert, 2003
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _TIGCC_H
+#define _TIGCC_H
+
+#define VERSION "1.3.1"
+#define TIGCC_VERSION "0.96 Beta 6 r1"
+
+/* global enumerations */
+enum Boolean 	{FALSE,TRUE};
+enum FileTypes	{BADFILE,CFILE,ASMFILE,SFILE,OFILE,AFILE,QLLFILE};
+
+/* global definitions */
+#define REDIRECT		"tigcc.log"
+#define DEVNULL                 "/dev/null"
+
+#define TMP_PCK                 "tempprog.pck"
+
+/* constants */
+// #define MAX_ARRAY_FILES	128
+/* (NG) Should be OK : */
+#define MAX_ARRAY_FILES argc
+
+/* global arrays */
+char **gcc_argv = NULL;
+char **ld_argv  = NULL;
+
+typedef struct {
+  unsigned short count;
+  char *files[0];
+} array_of_files;
+
+array_of_files *src_files    = NULL;
+array_of_files *obj_files    = NULL;
+array_of_files *asm_files    = NULL;
+array_of_files *a68k_files   = NULL;
+array_of_files *ar_files     = NULL;
+
+const char *tigcc_args[] =
+{
+  "--version", "-V", "-h", "--help", "-q", "--quiet", "-v", "--verbose", "-v0",
+  "-E", "-S", "-c", "-pack", "-bsr", "-outputbin", "--outputbin", "-standalone",
+  "--standalone", "-o", "--output", "-r", "--redirect", "-g", "--debug", "-Wa,",
+  "-WA,", "-np", "-ar", "-quill", "-keep", "--keep", "-save-temps",
+  "--save-temps", "--native", "--fargo", "--flash-os", "--remove-unused",
+  "--optimize-relocs", "--optimize-code", "--optimize-nops",
+  "--optimize-returns", "--optimize-branches", "--optimize-moves",
+  "--optimize-tests", "--optimize-calcs", "--cut-ranges", "--reorder-sections",
+  "--merge-constants", "--all-relocs", "--omit-bss-init", "-n", "--varname",
+  "-d", "--data-var", "--data-var-copy=never", "--data-var-copy=always",
+  "--data-var-copy=archived", "--dump", "--dump0", "--dump1", "--dump2",
+  "--dump3", "--dump4", "--dump5", "--dump6", "--dump7", "--dump8", "--dump9",
+  NULL
+};
+
+/* global vars */
+char *outfile = NULL;
+char packfile[9];
+char *tigcc_base = NULL;
+
+char *as_args   = NULL;
+char *a68k_args = NULL;
+
+/* global control variables */
+short int verbose = FALSE, quiet = FALSE, redirect = FALSE, delete = TRUE;
+short int debug = FALSE, nostdlib = FALSE, outputbin = FALSE, do_pack = FALSE;
+short int do_compile = TRUE, do_assemble = TRUE, do_link = TRUE, staticlib = FALSE;
+short int keepobj = FALSE, savetemps = FALSE, fargo = FALSE, flashos = FALSE;
+short int allrelocs = FALSE, nomergesections = FALSE, optreturns = FALSE;
+short int printcommands = FALSE;
+
+short int gcc_argc = 1;
+short int ld_argc = 1;
+
+/* internal/developer use only */
+short int patch = TRUE;
+
+#endif

Some files were not shown because too many files changed in this diff