GNU Ada Compiler
available in Norloff



Do you like Ada language? GNU Ada Compiler for EMX+GCC (GNAT v3.10p for OS/2) is available in Pete Norloff's BBS (http://www.os2bbs.com) and you can download it getting this files:

GNAT310D.ZIP 1409K
GNAT310C.ZIP 1410K
GNAT310B.ZIP 1410K
GNAT310A.ZIP 1410K
GNAT310.EXE 795K


GNU Ada Compiler starts Install in @Macarlo's Warp 4.0


GNAT v3.10p for OS/2 - Installation
-
GNAT for OS/2 is an industrial-quality Ada 95 compiler, integrated into the GCC retargetable compiler system. GNAT is not public domain software. GNAT, like GCC, is covered by the GPL (GNU Public License). For more information see the documentation in gnatinfo.txt.

GNAT was originally developed by the GNAT team at New York University. It is now maintained by Ada Core Technologies Inc (http://www.gnat.com).
If you intend to evaluate GNAT for industrial or commercial use please get
in touch with `support@gnat.com'.


Before You Install GNAT

Software Requirements

The following software should be installed in order to use GNAT:
* OS/2* v3.0 or later, including these components
- Presentation Manager*
Versions of OS/2 before v3.0 might also work but have not been tested. Version v4.0 of OS/2 has been tested with GNAT.

The following files should be copied to the installation
directory before installation:
gnat310a.zip - GNAT v3.10 binary distribution
gnat310b.zip
gnat310c.zip
gnat310d.zip
emxgnat1.zip - EMX v0.9c archives for GNAT v3.10
emxgnat2.zip
emxgnat3.zip
gnat310.exe - Self-extracting archive containing installation program

The emxgnat[1-3].zip archives contain the original EMX v0.9c
distribution listed below:
emxrt.zip - EMX v0.9c Runtime
emxfix02.zip - EMX v0.9c Fix Package 2
emxfix03.zip - EMX v0.9c Fix Package 2
emxdev1.zip - EMX v0.9c Development Utils (part 1)
emxdev2.zip - EMX v0.9c Development Utils (part 2)
gnudev1.zip - EMX v0.9c GNU Dev. Utils (part 1)
gnudev2.zip - EMX v0.9c GNU Dev. Utils (part 2)

The GNAT distribution is available at:
ftp://cs.nyu.edu/pub/gnat
The original EMX v0.9c release is available at:
ftp://ftp.leo.org/pub/comp/os/os2/devtools/emx+gcc

Please make sure you have the correct versions of the ZIP-files before trying to install. You should *not* unpack the archives.
Spaces or special characters in directory names are not supported.

When you are already using EMX, make sure no programs using one of the EMX executables or DLLs are running.

Hardware Requirements

The free diskspace requirements for each component are listed below.

Component Size
* EMX 0.9c - 10.0 MB
* GNAT v3.10 - 8.9 MB (also requires EMX 0.9c)

A complete installation requires 20 MB free diskspace.
You will need several MB extra during install.

Depending on usage you will also need 10 to 20 MB extra virtual memory for compiling Ada programs. Make sure the partition containing the OS/2 swap file (SWAPPER.DAT) has enough free space. Although there is no clear minimum, 32 MB or more physical memory is recommended for using GNAT.


Installing GNAT

When you have checked the Software requirements including the presence of all needed archives (see above), you can extract the installation program by invoking:
gnat310.exe
Then run the installation program by typing:
.\install.exe
Follow the instructions given by the installation program. Note that after installation the extracted installation program files (install.exe, install.in_ and GNAT.*) are
not automatically deleted.

If you have installed a previous version of GNAT using the install program and you choose to update your current configuration, do not select "Save a backup version of the installed product". This feature is not implemented yet.

When the installation did not work correctly please report the problem. (See "Defect reporting" above.) You can work around most installation problems by deleting any traces of previous installations of EMX and GNAT and reinstall.

Late-Breaking News

It is now possible to install GNAT without downloading and re-installing the EMX component. If you have installed the original EMX v0.9c (fixlevel 3) archives listed above, you do not need to download the emxgnat*.zip files.

It is recommended that you still choose installation of the EMX component in this case. This will cause the installation program to verify correct installation of EMX and to complain if files are missing or out of date.

When upgrading from GNAT v3.09 please choose the option 'delete and re-install' instead of 'update'. Update is slightly faster, but only installs files when existing files are older, which is fine in most situations, but may cause problems in non-standard situations. Changed files and user files will never be deleted by the installation program.

Compilation

The GNAT model of compilation is close to the C and C++ models. You can think of Ada specs as corresponding to header files in C. As in C, you don't need to compile specs; they
are compiled when they are used. The Ada with is similar in effect to the #include of a
C header.

One notable difference is that, in Ada, you may compile specs separately to check them for semantic and syntactic accuracy. This is not always possible with C headers because they are fragments of programs that have no specific syntactic or semantic rules.

The other major difference is the requirement for running the binder, which performs two
important functions. First, it checks for consistency. In C or C++, the only defense against
putting together inconsistent programs is outside the compiler, in a make file, for example.
The binder satisfies the Ada requirement that it be impossible to construct an inconsistent
program when the compiler is used in normal mode.

The other important function of the binder is to deal with elaboration issues. There are also
elaboration issues in C++ that are handled automatically. This automatic handling has the
advantage of being simpler to use, but the C++ programmer has no control over elalaboration.
Where gnatbind might complain there was no valid order of elaboration, a C++ compiler
would simply construct a program that malfunctioned at run time.

Running a simple ADA programm


Any editor may be used to prepare an Ada program. If emacs is used, the optional Ada
mode may be helpful in laying out the program. The program text is a normal text file. We
will suppose in our initial example that you have used your editor to prepare the following
standard format text file:

with Text_IO; use Text_IO;
procedure Hello is
begin
Put_Line ("Hello WORLD!");
end Hello;

This file should be named `hello.adb'. Using the normal default file naming conventions,
GNAT requires that each file contain a single unit whose file name corresponds to the unit
name with periods replaced by hyphens and whose extension is `.ads' for a spec and
`.adb' for a body. You can compile the program using the following command:

$ gcc -c hello.adb

gcc is the command used to access the compiler. This compiler is capable of compiling
programs in several languages including Ada 95 and C. It determines you have given it an
Ada program by the extension (`.ads' or `.adb'), and will call the GNAT compiler to
compile the specified file.

The -c switch is required. It tells gcc to do a compilation. (For C programs, gcc can
also do linking, but this capability is not used directly for Ada programs, so the -c switch
must always be present.)

This compile command generates a file `hello.o' which is the object file corresponding
to your Ada program. It also generates a file `hello.ali' which contains additional
information used to check that an Ada program is consistent. To get an executable file, we
then use gnatbind to bind the program and gnatlink to link the program.

$ gnatbind hello.ali
$ gnatlink hello.ali

A simpler method of carrying out these steps is to use gnatmake, which is a master
program which invokes all of the required compilation, binding and linking tools in the
correct order. In particular, it automatically recompiles any modified sources, or sources
that depend on modified sources, so that a consistent compilation is ensured.

$ gnatmake hello

The result is an executable program called `hello', which can be run using:

./hello

and, if all has gone well, you will see

Hello WORLD!

appear in response to this command.



@Macarlo, Inc.
@Macarlo's Shareware & Web
OS/2
Java Lobby Member
Java Site Accredited

[TOP] [HOME] [INDEX]