Go to the first, previous, next, last section, table of contents.


4. Installing the COBOL Compiler

  1. NB - you must use a particular GCC CVS weekly snapshot from gcc.gnu.org - older versions of GCC will not build. This is because we are currently tracking the GCC development builds, probably until GCC3.0. The 2.95.2 release found on Red Hat GNU/Linux CDs for example is too old and will not build. Have a look in the cobol or exa or toy Changelog file or in exa/exa.c or toy/toy.c or cobol/cobcc1.c for info on the currently supported GCC snapshot.
  2. Ensure you have the prerequisite software installed. The GNU/Linux kernel source, gcc development packages, dejagnu, autogen (try the gcc.cygnus.com site if you can't find things anywhere else).
  3. Download the GCC source and unpack per the instructions. Create the build directory. I recommend building somewhere other than in the source directory.
  4. Add the COBOL and sample languages to the source tree via use of the tar command (from the directory below the gcc directory "tar -xzvf bucob.tgz" where "bucob.tgz" is the file you downloaded.
  5. Follow the normal GCC build procedures, ie
    1. Configure:
      configure --enable-languages=c,COBOL,toy,exa --disable-cpplib --prefix=xxx 
      
      where xxx is the directory you want to install into (*not* the same directory as the standard gcc! and not the same directory as the build directory)) This takes a couple of minutes.
    2. Bootstrap build for c only.
      make bootstrap LANGUAGES=c
      
  6. Build COBOL toy and exa
    make LANGUAGES="COBOL c exa toy"
    
  7. Install everything
    mkdir xxx 
    (where xxx=the install directory as above)
    
    make install LANGUAGES="COBOL c exa toy"
    
  8. Set up the path to include the install directory
    export path=yyyyyyyyyy or whatever
    
  9. Run the tests (from the build directory subdirectory gcc):
    make check-toy RUNTESTFLAGS="-a -v -v "
    make check-exa RUNTESTFLAGS="-a -v -v "
    make check-COBOL RUNTESTFLAGS="-a -v -v "
    
    The runtestflags (for verbosity) is optional. The tests require DejaGnu (runtest) which is available at the usual places.


Go to the first, previous, next, last section, table of contents.