This is the port of gcc 2.8.1 for DJGPP. It comes as usual in
different zip-archives for the sources and the binaries.

The source archive gcc281s.zip contains all the sources to build
the C, C++ and OBJC compiler. GNU FORTRAN compiler source archive is in
archive g770523s.zip and should be unzipped AFTER gcc281s.zip as
it contains replacements from some files in gcc281s
But the binary archives are split
into four parts:

  gcc281b.zip  : The gcc.exe driver program and the C compiler.
                 It contains also the documentation.
  gpp281b.zip  : The C++ compiler and libstdcxx.a (2.8.1.1) together 
                 with needed header files 
  objc281b.zip : The OBJC compiler and libobjc.a and the needed
                 header files.
  g770523b.zip : GNU Fortran compiler (version 0.5.23) and libg2c.a
                 and g2f.h. Contains also replacement of gcc.exe but
	         this file only provides compilation of Fortran sources
                 by gcc.exe but is NOT needed for g77.exe (this is 
                 different from previous versions of g77) 

The archive gcc281b.zip is required also by gpp281b.zip, objc281b.zip
and g770523b.zip

Please also consider that g77 is still in beta stage and I'm not going
to maintain it.

Before you install gcc 2.8.1
============================

The DJGPP distribution of gcc 2.8.1 is now different from the one used
by gcc 2.7.x. Now the directory structure is more similar to the
unix systems and also all the DJGPP standard directories are hardcoded
already.

To get no trouble, should remove at least you old gcc installation
completely, especially the compilers (cc1.exe, cc1plus.exe ...) and
libgcc.a, because they will not overwritten by the new distribution.

If you don't remove them, and you don't modify your djgpp.env file,
gcc from gcc281b.zip will still uses these old binaries or the libgcc.a
because they are in directories, which are searched before the hardcoded
ones.

I also recommend remove files 'specs' and 'djgpp.djl' from %DJDIR/lib.
Archive gcc281b.zip contains replacement for these files which will
go to a different directory %DJDIR/lib/gcc-lib/djgpp/2.81.
If You have changed any of these 2 files You can consider to transfer
these changes to new files. It is possible to avoid removing these files
but don't do this unless You know what You are doing.

Additionally you can safely remove the [gcc] and [cpp] section from your
djgpp.env file, since the path-settings there are not longer needed, because
gcc (and cpp) is configured already in a way to search these directories
by default. If you have modified already these sections for instance to
have some of your own directories searched by default, you should leave
only those directories there and remove the standard DJGPP directories.

Modifying the djgpp.env is not really neccessary, but recommended by me.

I'm including an example of modified DJGPP.ENV in directory gnu/gcc-2.81
I have tested it with gcc-2.8.1


NOTE for users of RHIDE-1.4
============================

The name of C++ library is now libstdcxx.a instead of libstdcx.a as it was
for port of gcc-2.7.2.1. RHIDE-1.4 uses latest name by default. I included
fix (section [rhide]) in example of DJGPP.ENV file mentioned above.
An alternate way is to add line (create new file if needed) 

RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx

to file %DJDIR/share/rhide/rhide.env


How to install the binary archives?
===================================

Install them like any other DJGPP binary archive:

- change to your DJGPP base directory (normally c:/djgpp) and unzip
  there the archive

  unzip gcc281b.zip

  (if you are using PKUNZIP, remember to use the -d switch!!)

and that's all.

Installing under Windows 95
===========================

If you want to install and use gcc under Windows 95 you should remember
that this OS can handle long and case sensetive filenames. Here ar three
cases:

1. Only long filenames
----------------------

Unzip the binaries with an unzip program, which can restore the long filenames
stored in the zip archive.

2. Only short filenames
-----------------------

Unzip the binaries with an unzip program, which doesn't know about long
filenames, or if your unzipper knows about them, please follow at first
the steps descripbed in the DJGPP FAQ 2.01 in section 
about setting the NameNumericTail to 0 __BEFORE__!!! unzipping the archives.

3. Long and short filenames at the same time
--------------------------------------------

Use an unzip program which can restore the long filenames and do the
same like under 2. when the unzipper knows about long filenames.


DJGPP specific hints for C++
============================

Since there are still some long filename problems, which could not be solved
in an easy way, there are some tricks to get all the functionallity in C++.
Especially some headers are renamed to get no confilcts with either each other
or with existing heeader files from libc.

I list here all the relevant header files and how they are named for DJGPP

Complex.h   -> _Complex.h
String.h    -> _String.h
Regex.h     -> _Regex.h
iostreamP.h -> _iostreamP.h

So there are now two ways to include these headers. Either use the DJGPP
specific name or use a new feature of the preprocessor cpp. It accepts now
a new commandline switch "-remap" which tells cpp to look in a directory
for a file named "header.gcc" and the it takes that file as a translation
table if a requested file was not found in the directory.

The DJGPP distribution of g++ and libg++ come already with these translation
files, but they are currently not used. To use them, you have to modify your
specs file to add the "-remap" switch to the call for cpp, since this switch
cannot passed to cpp from the gcc comanndline. Here is now a possible line
from the spec file in your lib/ directory:

*cpp:
-remap %{posix:-D_POSIX_SOURCE}

Exception support under DJGPP
=============================

To use the new exception handling with DJGPP there are needed some
modifications to the specs file to include an additional startup file
and to the linker script. The binary archive gcc281b.zip comes with
these two files and installs them in

$DJDIR/lib/gcc-lib/djgpp/2.81/

Unfortunatelly if both following conditions 
  - gcc library search path contains $DJDIR/lib
  - $DJDIR/lib contains old versions of djgpp.djl and(or) specs from
    djdev201.zip
are true, then old files will be used errorously. If You have editted
DJGPP.ENV as recommended above (or used version supplied with archive
gcc281b.zip) correct version will be used. Anyway I recommend to 
remove old versions of these files from $DJDIR/lib.

Possible problems with exceptions handling under gcc-2.81
   Q) I'm getting SIGABRT instead of correct reaction to throw?
   A) This is most likely caused by reading old specs file. Best is
      to get rid of it.

   Q) I'm getting message about unresolved symbol from crtf.o
          c:\djgpp\lib\gcc-lib\djgpp\2.81\crtf.o(.text+0x9):crtfgo32.c: undefined 
          reference to `__EH_FRAME_BEGIN__'
   A) You are using old linker script (djgpp.djl) from $DJDIR/lib. Read this
      file completely for more info. Best is to get rid of it. Check also 
      whether You are using correct specs file (hint: use command line 
      option -v to gcc)

Rebuilding gcc from the sources
===============================

Requirememts
------------

To build gcc you need many GNU utilities installed. This includes at very
first bash and a symlink sh to it.

********
To get it, change to the DJGPP bin directory and type there

ln -s bash.exe sh.exe
********

Because it is really not possible for me to check for any needed program
I include here only a list of packages which you will need at least:

- fil316b.zip
- find41b.zip
- grep20b.zip
- mak3761b.zip
- sed118b.zip
- shl112b.zip
- txt119b.zip
- txi390b.zip

And you need about 40 MB free disk space as minimum, when you build without
debugging information (with debug info I would guess about 50 MB)

Extracting the sources
----------------------

If you are running Windows 95 I strongly recommend to enable the use of
long filenames for DJGPP. I havent tested compiling gcc-2.8.1 without
support of LFN. 'sh djmake.sh all' may work without LFN but also
may not work. I'm almost sure './djmake.sh install' will not work
without LFN.

At first you should unzip the archive gcc281s.zip. The sources are _NOT_
the complete sources like the original gcc 2.8.1 distribution. I have
removed many files to save disk space which are not needed for the DJGPP
port. I removed also many of the older Changelog-files.

The sources are already configured, but if you want to reconfigure them,
please use _ONLY_ the script file 'djconfig.sh' (written by Robert 
Hoehne) instead of running the configure script, since it does some 
tricks before running configure. (read the comments inside this file!!). 
To run it you must have bash installed and a symlink sh.exe to bash.exe.

I configured sources to be compiled in directory build.djg. 

Then to run the djconfig.sh script type there

sh djconfig.sh [any-additional-paramter]


Robert Hoehne wrote also another script 'djmake.sh' to be used instead 
of simply make. Like above: Please use _ONLY_ this script instead of 
running a simply make (except of course you know what you do).

Now you run make by typing

sh djmake.sh [any-additional-paramter]

as replacement for

make [any-additional-parameter]

I did only small changes to these scripts.


Compiling in an other directory
-------------------------------

I configured gcc to be compiled in directory build.djg. To change this
directory You should move it contents to desired location and modify
both scripts (djconfig.sh and djmake.sh) to set exact path to sources.
After that You can use these scripts as described above.


Installing the newly built binaries
===================================

To install the built binaries use the following command

sh djmake.sh prefix=$DJDIR install

This is needed, because by default the Makefile has a prefix which
will not allow to install the files correct because Robert Hoehne made 
there a trick when configuring gcc to have the $DJGPP variable hardcoded in
the binaries instead of the expanded value of this variable.

Reporting bugs
==============

If you found a bug in gcc, please report it to the gcc bug adresses and _NOT_
(or at least not only) in the DJGPP news group. But if you think you found
a bug in the DJGPP related things, the please report in comp.os.msdos.djgpp
(the news group) or mail it to djgpp@delorie.com, which is the gateway to
the news group.

Please email me directly only in rare cases, if you think it is only of
interest for me, since I see the reports in comp.os.msdos.djgpp also.


Credits
=======

Thanks to Robert H”hne <robert.hoehne@gmx.net> for his DJGPP port of 
gcc-2.8.0 which was used as a base of this port and his help (including
exception support)


  Have fun with gcc, 

Andris Pavenis <pavenis@lanet.lv>

----------------------------------------------------------------------
patch to autoheader. Neaded ONLY if you need to run autoheader under 
Windows 95. Normally NOT NEEDED to build gcc unless You modify Configure.in
-----------------  patch to autoheader  ------------------------
*** autoheader~	Wed May 14 17:33:34 1997
--- autoheader	Tue Mar 24 15:03:18 1998
***************
*** 261,266 ****
--- 261,267 ----
  fi
  
  if test $# -eq 0; then
+   exec > con 
    if test $status -eq 0; then
      if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
        rm -f $tmpout # File didn't change, so don't update its mod time.
----------------------------------------------------------------
