OCamlPro / gnucobol

A clone of the sourceforge GnuCOBOL compiler from COBOL to C.
https://get-superbol.com
GNU Lesser General Public License v3.0
22 stars 24 forks source link
cobol

GnuCOBOL is a free COBOL compiler licensed under the GNU Public License (GPL).
It implements a substantial part of the COBOL 85, COBOL 2002 and COBOL 2014 standards, as well as many extensions included in other COBOL compilers.

GnuCOBOL translates COBOL into C and compiles the translated code using the native C compiler on various platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.

This package contains the following subdirectories:

All programs except those in lib and libcob are distributed under the GNU General Public License. See COPYING for details.

Programs in lib and libcob are distributed under the GNU Lesser General Public License. See COPYING.LESSER for details.

Requirements

GnuCOBOL uses other software packages, some of these are necessary, some optional. See DEPENDENCIES.md for a complete list.

If building GnuCOBOL from source, you can choose which optional functionality to include via the configure script. When using pre-built binaries -- for example, via your OS package manager -- the packager will have made those choices for you.

Building from source

GnuCOBOL is built and installed using the configure script generated by GNU autotools. If you're unfamiliar with configure, see the INSTALL file for detailed information about it. Special requirements and further installation notes are listed below.

We recommend creating a build directory; these instructions assume your build directory is build, a sub-directory of the source tree root, and that that is your current working directory. These instructions redirect the configuration and compilation messages to a file, partly to avoid a slew of messages scrolling off the screen, and to make any errors more prominent.

To see the list of configuration options, use ../configure --help.

By default, the configured PREFIX is /usr/local. That means the binaries will be installed to /usr/local/bin, libraries to /usr/local/lib, and so on. The PREFIX may be changed by specifying --prefix=<dir> configure option. Other options control other install directories.

Once you've decided on your options, generate the build tree with

and build the compiler and run-time library with

Tests

To verify GnuCOBOL works before installing it, run the internal testsuite. Simply do

This MUST succeed. Please report any failures.

Also included are COBOL85 standard tests provided by the NIST.
They are run with

If the the COBOL85 testsuite is not already in the build- or source-tree, make test will download it. For details see tests/cobol85/README.

NOTE The language interpreter perl is required to run COBOL85 tests.

If you want to run both testsuites you can run

NOTE The semi-manual tests need either xterm, GNU screen or tmux installed and will run within a detached cmd.exe on MSYS based systems otherwise. For running with screen or tmux execute the following from a separate terminal, directly after running the testsuite: tests/run_prog_manual.sh attach ... and leave that using exit at the end of the tests

Installation

To install GnuCOBOL, including the compiler, run-time library, and documentation,

Unless you have taken steps to ensure you can create files in the PREFIX directory, you'll probably need super-user privileges for this step.

Un-installation

You can get back to a clean installation status by running

ISAM Support

The following is only interesting for advanced use.

The COBOL language supports the use of ISAM files. Unlike mainframe operating systems, those that GnuCOBOL runs on do not include any record-oriented system services. GnuCOBOL can either be built without ISAM support, or with it, in which case the support may by provided by one of several libraries. The choice is expressed as a configure option.

To exclude ISAM support, use

By default, ISAM support is provide by Berkeley DB. You can say so explicitly with --with-db. Or you can select from one of the following options,

Development

If you wish to hack the GnuCOBOL source or build from version control, see HACKING.

Further information about the project, including the source code repository, history, and frequently asked questions, may be found at