INSTALL: some notes about the source installation of the SCRC

Requirements:

- a Unix-like operating system (Solaris 5.5 (default), current
  RedHat Linux distributions (7.3, 9, Enterprise), and CygWin
  are verified to work)
- the GNU C++ compiler g++ (version 3.2.2 is verified to work)
- the scanner generator flex (version 2.5.2 or newer)
- the parser generator bison (version 1.24 or newer)
- a gmake compatible make (BSD style make is fine)


Installation:

- unpack the distribution archive
  => gtar xvzf scrc-2.0.tar.gz
  => cd scrc-2.0
  (for systems without symbolic links, e.g. GNUWIN32, please use the
  archive scrc-2.0-3.tar.gz which contains copies of files
  instead of symbolic links and other Windows-specific modifications)
- * FOR REDHAT LINUX 7.1, SEE SPECIAL INSTRUCTIONS BELOW! *
- modify the file Makefile.macros to reflect your local compiler
  environment (adjust the SPECC path and the target architecture
  macros; 5 architectures are already prepared, so you probably just
  need to activate the right one)
  => vi Makefile.macros
- check further requirements of external packages (please see the
  README in directory pkg)

- one step compilation and installation:
  => make ALL
  if anything goes wrong, then follow the step by step procedure listed
  below; if everything goes fine then congratulations, your SCRC
  is now installed and ready to run; please jump to the last bullet
  in this section

- detailed compilation and installation steps:
- compile the SpecC base package
  => make all
  if anything goes wrong, correct your settings in Makefile.macros
  and try again; in order to recompile everything, use
  => make clean all
- install the base package
  => make install
  or, if you also want to create an archive of the binary distribution,
  do this instead
  => make bindist
- test the package
  => make test
  this should result in a (quite long) test session with the following
  message at the end: "All tests successfully completed.";
  if the tests do not run successfully, go back to your settings
  in Makefile.macros;
  if you have it, you might also want to use purify for the test
  => make puretest
- Congratulations, your SCRC is now installed and ready to run!
  You might want to copy the examples to your work directory
  and try them, e.g.:
  => mkdir work
  => cd work
  => cp $SPECC/examples/simple/* .
  => source $SPECC/bin/setup.csh
  => make
  => ...


Bug reports:

- the SpecC reference compiler currently consists of
  more than 115000 lines of code
- the SpecC compiler contains bugs (see BUGS for known bugs)
- if you encounter a problem which you think is a bug, don't hesitate
  to contact us; you can find contact information in the COPYRIGHT file;
  however, please be aware that we cannot fix everything at once, but
  we will try to fix as much as possible as soon as possible


Enjoy!

Rainer Doemer, June 24, 2004.


SPECIAL INSTRUCTIONS FOR INSTALLATION ON REDHAT LINUX 7.1:
----------------------------------------------------------

RedHat Linux 7.1 comes with a non-standard C/C++ compiler environment.
The following issues are known to cause trouble with the SCRC:

(a) the pseudo keyword `__builtin_va_list` is a special built-in type
    for the GCC 2.96 on RedHat 7.1; this is obviously not ANSI-C and
    therefore does not work with the SCRC; this "keyword" is used in
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h, line 43

(b) there is an invalid initialization of a union-type in header file
    /usr/include/bits/huge_val.h, in line 39; the SCRC will not
    accept this invalid declaration

The following modifications are necessary to circumvent the above
problems and to compile and install SCRC 1.2 on RedHat 7.1:

1. To work around problem (a), add a definition of `__builtin_va_list`
   to each GCC call. This is already prepared in Makefile.macros,
   just enable the following line:

GCC296  = "-D__builtin_va_list=void*"

   Also, this definition must be added to the C-compiler driver settings
   in src/CcDriver/CcDriver.h. This file is already prepared to
   detect GCC 2.96 and later in order to apply this patch.

2. To work around problem (b), disable the invalid initialization
   in /usr/include/bits/huge_val.h, line 39:

static __huge_val_t __huge_val; // DISABLED!! = { __HUGE_VAL_bytes };

   Note that you will need superuser permissions for this ('su root').

3. That's it! Now follow the standard instructions given above and
   the SCRC should successfully build on RedHat Linux 7.1.

