OpenToken Developer tools

Running the OpenToken tests requires AUnit. Compiling with the '-gnatyO' switch requires patching the compiler run-time sources.

AUnit

The version of AUnit in Debian 5.0 is 1.03. The version distributed by AdaCore with GNAT 6.2.1 and GNAT GPL-2009 is 3.1.1. They have different user interfaces; the later version is compatible with the Ravenscar profile.

The tests in OpenToken use AUnit 1.03. So on Debian, just install the AUnit package, and everything works.

On Windows, it's a little more complicated, because the Makefile in AUnit 1.03 doesn't install the library. So we have to do that part by hand.

  1. Download aunit-1.03-src.zip, either from here, or from the GNAT Libre website; it's grouped under GPL-2005.
  2. Assuming your GNAT compiler is installed in c:/GNAT, unzip the source to c:/GNAT/aunit-1.03-src
  3. Copy c:/GNAT/aunit-1.03-src/aunit.gpr to c:/GNAT/lib/gnat
  4. Edit c:/GNAT/lib/gnat/aunit.gpr; change the Source_Dirs line to:
       for Source_Dirs use
         ("../../aunit-1.03-src/aunit/framework/",
          "../../aunit-1.03-src/aunit/text_reporter/");
    
  5. In directory c:/GNAT/lib/gnat, execute gnatmake -p -Paunit

GNAT Compiler patches

GNAT 6.2.1, GPL-2008, and GPL-2009 support the "-gnatyO" style option, which enforces the use of the "overriding" keyword. This keyword protects against an overriding function silently becoming non-overriding when the parent spec is changed.

However, a few of the Ada standard files and supporting GNAT run-time files are missing required "overriding" keywords, so they must be patched.

If you are uncomfortable patching compiler files, you can delete the "-gnatOy" option from the GNAT project file.

Assume the GNAT compiler to be patched is installed at $ROOT. That means that the executables are in $ROOT/bin. Then the files to be patched for GNAT 6.2.1 on Windows are:

$ROOT/lib/gcc/i686-pc-mingw32/4.3.3/adainclude/s-poosiz.ads
Add "overriding" to Storage_Size, Allocate, Deallocate, Initialize.
$ROOT/lib/gcc/i686-pc-mingw32/4.3.3/adainclude/s-pooglo.ads
Add "overriding" to Storage_Size, Allocate, Deallocate.
$GNAT/lib/gcc/i686-pc-mingw32/4.3.3/adainclude/a-strbou.ads
Add "overriding" to function "=" (Left : Bounded_String; Right : Bounded_String)
Then recompile these files. In a bash shell:
cd $ROOT/lib/gcc/i686-pc-mingw32/4.3.3/adalib
rm -f s-poosiz.ali s-poosiz.o
rm -f s-pooglo.ali s-pooglo.o
rm -f g-socket.ali g-socket.o
rm -f a-strbou.ali a-strbou.o
make -f Makefile.adalib ROOT=/Gnu/GNAT-6.2.1 s-poosiz.o
make -f Makefile.adalib ROOT=/Gnu/GNAT-6.2.1 s-pooglo.o
make -f Makefile.adalib ROOT=/Gnu/GNAT-6.2.1 a-strbou.o
make -f Makefile.adalib ROOT=/Gnu/GNAT-6.2.1 g-socket.o
chmod -w *.ali

For GNAT GPL-2009, the paths are slightly different; lib/gcc/i686-pc-mingw32/4.3.3 changes to lib/gcc/i686-pc-mingw32/4.3.4


my home page Author : Stephen Leake Valid HTML 4.01! Created with Emacs powered by Ada Last modified: Tue Jun 1 19:16:08 EDT 2010