version 1.2
by Dmitry A. Kazakov


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Download GPS Library Installer Platform:   64- 32bit
Fedora packages   precompiled and packaged using RPM     [Download page] [Download page]
Debian packages   precompiled and packaged for dpkg   [Download page] [Download page]
Source distribution (any platform)   gps_installer_1_2.tgz (tar + gzip, Windows users may use WinZip)   [Download]

The gps_installer is a GTK+ application used to integrate custom Ada library projects into the Gnat Programming Studio (GPS). The installer is designed to be as simple as possible. It takes the directory where the source files are located and the list of files to install. The installer tries to figure out where to move the files and how to process them. No specific actions need to be specified.


The installer is portable and deploys neither make nor configure nor other tools beyond the GNAT compiler toolset. The aim of this design is to ease integration of custom libraries into GPS without typical issues regarding makefiles under MinGW or Cygwin.


1. Use

The installer is started in a directory that contains sources or with the directory name as the argument. The user must have administrative rights to access installation directories, usually it is the root user.

The installer shows its window. In the text box "GNAT root" it shows the root directory of the GNAT compiler installation, which the installer was able to detect first. The operator can change this root directory of the compiler by typing it into the edit box or else by browsing the file systems.

Once the compiler is confirmed by pressing the button "continue", the installer searches the directory for *.lst files. Each *.lst file corresponds to a library project to install. It contains the list of sources to install.

For each found list the installer shows a library project row with the check boxes "install new" and "remove old". The check box "remove old" when active instructs to remove the existing installation of the library project. The directory to search can be browsed for using the button "Source"

Once the installation process is configured by the user, he presses the button "continue", and so starts the process. The column "Status" indicates installation progress. The text field at the window bottom shows actions undertaken, compiler output and error messages.

The combo box GPRBuild verbosity specifies the verbosity level used when building projects using gprbuild. The combo box Ada 2005/95 controls Legacy external variable passed to gprbuild. It can be used for building projects for either Ada 2005 or Ada 95.

Successfully installed libraries do not require modification of system variables such as ADA_PROJECT_PATH in order to be used.

Note. The GPS library installer requires an installation of GTK+ to work.

Windows notes. Under Windows in effect, it is only the dynamic-link libraries (DLLs) and the additional executable program called gspawn-win32-helper.exe, which are required. Note that though the distributions of GtkAda and GNAT GPS both contain the GTK+ DLLs, they do not the helper. The distributions of GTK+ and GIMP provide both the DLLs and gspawn-win32-helper.exe. Basically you should have a copy of gspawn-win32-helper.exe in the same directory where the GTK+ DLLs are situated. If you do not want to copy gspawn-win32-helper.exe, make sure that the path to the binaries of GTK+ (or GIMP) precede in the system search path (PATH variable), the paths the binaries of GtkAda and GNAT GPS.


2. Operating

The installer program works in way that should allow installation and archiving performed directly from working directories. Typically you create Ada files (*.adb, *.ads), project files (*.gpr) and documentation files in a working directory. Test and examples are placed into subdirectories named so that they would contain "test" or "example". When the project reaches a release stage, the directory tree is written into an *.lst file located in the same directory. This can be done using UNIX find utility for example. The same tree can be used for archiving the project using tar.

You can keep on developing your project using GPS while installing it from the same directory tree. The installer does not require your files to be copied into a separate tree.

The installer needs the *.lst file and the files it refers in order to install the project. The file names in the *.lst file should be relative to the directory where the source files are located. This directory may contain several projects and so several *.lst files.

A typical GNAT installation has the following structure:

GNAT root directory
include         lib                         share    
        gnat   project               doc examples  gps
                                    project  project   plug-ins
relocatable-Release            static-Release     install             
    relocatable-Debug     static-Debug            
    obj     obj     obj     obj                

The installer searches for the first version of GNAT available and offers its root directory for installation.

The name of the *.lst file is used for as the project name, shown as project above. The files are installed into the directories:

Value Description
GNAT root directory Like /usr/gnat unider Linux, C:\GNAT under Windows
  project The root directory of the project sources, *.ads, *.adb
      subprojects Copies of Ada-files and GPS project files located in the subdirectories of the source directory, which names do not contain "test" or "example", *.ads, *.adb, *.gpr
  gnat Copies of GPS project files located in the source directory, *.gpr
project The root directory of the project object and library files
  install *.gpr files used to build the library. These files are generated from same source that library *.gpr files (to use the library), but differ in Enternally_Built set false. These projects can be used in order to rebuild the corresponding libraries manually.
{relocatable|static}-{Debug|Release} Built versions of the library. The library is built in four variants, debug or release, static or relocatable. *.a, *.ali, *.so, *.dll
  obj Object files, *.ali, *.o
  project The directory of the project documentation, *.doc, *.html, *.htm, *.pdf, *.jpg, *.gif, *.png
  project The root directory of the project examples and tests
    test_subproject Subdirectories of tests and examples. Any subdirectory of the source directory which contains the word "test" or "example" in its name is copied here, *.ads, *.adb, *.gpr
  plug-ins The GPS extension generated for the project. The extension adds documentation files and example projects to the help menu of GP,

Upon copying *.gpr files are processed to remain consistent. This includes:

  1. Names of projects in with-clause are fixed to correspond their new locations. For example, when a test gpr file in a test subdirectory refers to the gpr file in the root directory using relative path:

    with "../<library>.gpr";
    ... is ...

    then the installed version of the file will contain:

    with "<library>.gpr";
    ... is ...

    The path is here relative to the directory where <GNAT Root>/lib/gnat, where *.gpr files are installed.

  2. The installer scans the directory trees rooted in <GNAT Root>/lib/gnat and <GNAT Root>/include for *.gpr files. When name of such project appears as the base name of a file path in with-clause, the path is replaced with the relative path of the project.
  3. The gpr files of the projects that do not contain words test or example in their names, receive definition of the external variables <library>_Kind that controls static vs. dynamic way of linking:

    type <library>_Kind_Type is ("static", "relocatable");
    <library>_Kind : <library>_Kind_Type := external ("LIBRARY_TYPE", "static");

    and Development that controls choice of a debug and release versions:

    type Development_Type is ("Debug", "Release");
    Development : Development_Type := external ("Development", "Debug");

    The original definitions of Development_Type and Delevelopment are removed.

  4. In the gpr files of the projects that do not contain words test or example in their names definitions of Object_For are replaced by:

    for Object_Dir use "../../../lib/<library>" & "/" & <library>_Kind & "-" & Development & "/obj";

  5. The gpr files of the library projects receive attribute specifications like

    for Library_Kind use <library>_Kind;
    for Library_Name use "<library>.<major>.<minor>";
    for Library_Dir use "../<library>.gpr" & "/" & <library>_Kind & "-" & Development;
    for Externally_Built use "true";

    The original attribute specifications are removed if any. The version number major ad minor are taken from the name of the *.lst. When the file name ends with .<major>[.<minor>].lst or else with _<major>[_<minor>].lst, major and minor numbers are taken for the name of the dynamic library. The minor number can be omitted and then is defaulted to 0. The original attribute Library_Name specification is removed if any.

All *.gpr files are compiled after being installed. The installer selects an installation order according to the dependencies introduced by with-clauses:

The installer applies the following scenario variables when building the projects:

-XDevelopment=Release and for the library projects -XDevelopment=Debug as well
-XLegacy=Ada95 (when the combo box choice Ad95 is selected)

The variables Development and Legacy can be used in the project file to control compilation switches. Further the library projects are compiled in two variants:



3. Building from sources

The GPS installer uses Simple Components for Ada, GtkAda contributions which are distributed with it. In order to compile it, GtkAda must be installed first. Then with GNAT compiler it can be build using the following command:

>gprbuild -XDevelopment=Release -p -P gps_installer.gpr

issued in the directory containing the sources. You can also use the gps_installer.gpr project with GPS.


4. Changes log

Changes to the version 1.1:

Changes to the version 1.0:

Version 1.0 released.


5. Table of Contents

1. Use
2. Operating
3. Building from sources
4. Changes log
5. Table of Contents