Installation:

Install bison-1.22 and gas-2.3 first.  These must be available in the
command search path as "bison" and "as", respectively.
The "patch" command was in /usr/new at SR10.3.5 and earlier.

Unpack GNU C in the directory above this one.  This gives directories
gcc-2.6.0 and apolgcc-2.6.0 at the same level.
Apply the patches with the following UNIX shell commands:
(Applied from directory containing gcc-2.6.0)

/usr/new/patch -p0 < apolgcc-2.6.0/DIFFS

Some files must now be moved and renamed as follows:

cd gcc-2.6.0
cp ../apolgcc-2.6.0/apollo-pic.c .
mv cp/parse.y cp/parse.in

     If GCC will be used mostly on 68040-based Apollo systems, you may
want to change TARGET_DEFAULT in config/m68k/apollo68.h from
7 to 0407.

     GCC may now be configured and built.  The Makefile will need to be
changed after the first build using Apollo C since GCC uses the "-A" option
differently from Apollo C.  The "--prefix" and "--local-prefix" options to
configure may be used if GCC is to be installed in a directory other than
/usr/local.  Commands for a full bootstrap:

configure
make LANGUAGES=c
make stage1

     Edit the Makefile as described at the end of this document.
Use the following commands to build the rest of the languages.
The stage 2 build is not useful since "make compare" will always fail due
to temporary assembler file names being stored inside the .o files.  The
"-save-temps" option could be used to work around this.  Building without
debugging would also work.

make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"
make objc-runtime CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"

     To install  (if all languages built)

make install CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"
make install-libobjc CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"

     Some Apollo header files may need "fixincludes" type changes.
In the SR10.3.x ANSI header set, /usr/include/sys/ttychars.h
appears to need fixing, but everything else seems usable as is.
The CTRL macro in ttychars.h uses non-ANSI quoting.  This problem might
affect Apollo CC in strict ANSI mode.

     To safely see what "fixincludes" changes, make an empty directory D
somewhere, then do

fixincludes D

     The changed files will turn up in D, where they may be examined
and moved as needed.

Makefile changes:

After the first build, find the lines in Makefile where x-apollo68 gets
included.  Searching for "Xlinker" should work.  Comment out the first
LDFLAGS line and uncomment the second one as noted in the comments near
them.  The same changes could be applied to config/x-apollo68 to do all
future builds with GCC.  The section to change looks like this:

# For the initial build using Apollo CC, use this.
LDFLAGS = -A stacksize,100000
# For the bootstrap and subsequent builds using GCC, use this.
# LDFLAGS = -Xlinker -A -Xlinker stacksize,100000

There are some comments below that section on how to make a "stripped"
build with no debugging symbols.

If GCC will be used mostly on 68040-based Apollo systems or an older
version of CC is used, it might be necessary to change the "mathchip"
option of CCLIBFLAGS.

Those attempting to use shared libraries may need to build a shared
libgcc.a by adding -fPIC to CFLAGS and -W0,-pic to CCLIBFLAGS.
The __main.o member can not be shared, it must be included in each
client.  Sharing libgcc.a has not been tested.  The "collectshare"
script may be useful to those attempting shared C++ libraries.
