INSTALL: some notes about the source installation of the SCRC
--------

Requirements:

- a Unix-like operating system (Solaris 5.5 (default), SunOS 4.1, NetBSD 1.3.x,
  Linux 2.2 are verified to work)
- the GNU C++ compiler g++ (version 2.95.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-1.1.tar.gz
  => cd scrc-1.1
  (for systems without symbolic links, e.g. GNUWIN32, please use the
  archive scrc-1.1-3.tar.gz which contains copies of files
  instead of symbolic links)
- * 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
- compile the SpecC system
  => 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 system
  => make install
  or, if you also want to create an archive of the binary distribution,
  do this instead
  => make bindist
  finally, if you want to install the header and library files for the
  development of SpecC tools, do afterwards
  => make install-devel
- test the system
  => 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 system 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 70000 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, August 6, 2001.


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

(c) an empty source file (or a source file with only comments in it)
    is not accepted by the GCC 2.96 on RedHat 7.1, but according to
    ANSI C/C++, this is a legal input file; this discrepancy makes
    the self-test ('make test') of SCRC fail

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

1. To work around problem (a), add a definition of `__builtin_va_list`
   to each GCC call. For this, enable the special definition of SCPP
   in Makefile.macros, line 107:

SCPP	= $(CPP) -x c -U__GNUC__ -D__attribute__\(x\)=	\
		"-D__builtin_va_list=void*"		# REDHAT7.1

   Also, add this definition to the C-compiler driver settings
   in src/CcDriver/CcDriver.h, line 117:

#define CCD_OS_DEFINES " -D__attribute__\\(x\\)= \"-D__builtin_va_list=void*\""

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. To work around problem (c), delete the test case "Empty.sc"
   in src/Parser/Makefile, line 74:

		Adder.sc Device.sc Timing.sc Kanji.sc Pipeline.sc \

   Also, remove "Empty.sc" from the compiler test cases
   in src/Compiler/Makefile, line 37:

		Timing.sc Kanji.sc Conv.sc \

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

Rainer Doemer, 08/06/01.
