Skip to main content

How to compile the newest gps

The following description shows how to compile your very own GPS environment. It makes the following assumptions:

  1. You use a GNU/Linux environment with the following packages:
    • A gcc 3.4.1 with an Ada compiler included.
    • A current Gtk development package.
  2. You do your compilations in /work.
  3. You do your installations in /opt
  4. You do have a working Internet connection.

If you want it any other way you need, use your brain to change the commands appropriately.

-%3c Important: Neither GPS nor GtkAda has been developed by me. For all questions but typing mistakes on my side you should join the appropriate mailing list and ask your questions there (monitor gps-devel):

http://lists.act-europe.fr/mailman/listinfo/gtkada

http://lists.act-europe.fr/mailman/listinfo/gps-devel

Please note that it took me more than half a dozen tries and just as many mails on the gps-devel mailing list.

‘‘‘Only try it if you are an experienced developer! If you are not: just download the pre-compiled old version!

The Compiler #

For GPS you need the sources of the gcc 3.5 – not 3.4.2. But it is enough to download it, you don’t need to compile and install a stable development version.

Get the Compiler #

First you need the get the compiler.

 CVS_RSH=ssh
 CVSROOT=:ext:%3cA HREF="mailto:anoncvs@savannah.gnu.org">anoncvs@savannah.gnu.org%3c/A>:/cvsroot/gcc 
 mkdir --parents /work/gnu_3.5 
 cd /work/gnu_3.5 
 cvs -qz4 checkout -P gcc/gcc/ada  

Now you have the newest sources in “/work/gnu_3.5/gcc”. You may cut your Internet connection now.

GtkAda #

GPS is based on GtkAda – so you need this last one first:

Get GtkAda #

Get the newest version from the AdaCore’s Libre site. (http://libre.adacore.com )

 CVS_RSH=ssh
 CVSROOT=:pserver:anoncvs@libre.adacore.fr:/anoncvs 
 mkdir --parents /work/act 
 cd /work/act 
 cvs -qz4 checkout -P -r gps-2_0_1 GtkAda

Configure #

There is no fancy “§c§configure§§” needed here:

 cd /work/act/GtkAda
 configure –prefix=/opt/ada  

The configure script might tell you about a version mismatch with your Gtk+ version. Well it worked for me to just remove the check, but it’s also a good option to try to get a correct version.

How to remove the GTK+ Version check #

Open configure with a text editor, at about line 2833 starts a C program. Look for the “§k§return§§ 1” command and replace it with “§k§return 0§§”. Call §c§configure§§ again.

Compile%3c/H3> #

Like with most AdaCore Libraries you need to reset the include paths. Apart from that quite easy:

 declare -x ADA_OBJECTS_PATH=
 declare -x ADA_INCLUDE_PATH= 
 make

Install #

Just as easy. Don’t forget to set your include paths again.

 make install
 ADA_INCLUDE_PATH=${ADA_INCLUDE_PATH}:/opt/ada/include/gtkada  

GPS #

Now we are ready to compile the GNAT Programming System.

Get GPS #

Again, get the newest version from the Libre site.

 CVS_RSH=ssh
 CVSROOT=:pserver:anoncvs@libre.act-europe.fr:/anoncvs 
 cd /work/act 
 cvs -qz4 checkout -P -r gps-2_0_1 gps  

Configure #

Again nothing fancy here:

 cd /work/act/gps
 configure –prefix=/opt/ada  

Compile #

GPS grasps some of the original GNAT sources to implement the project manager support for which a symbolic is needed. Also, for gcc 3.4.1 you need a special patch. If you have wget installed the following commands will do:

 cd /work/act/gps
 ln -s ../../gnu_3.4/gcc/gcc/ada gnat_src 
 wget --output-file=common/src/stubs.c http://ada.krischik.com/stubs.c 
 declare -x ADA_OBJECTS_PATH= 
 declare -x ADA_INCLUDE_PATH= 
 make 

Install #

If you are lucky, and it did compile, then install is easy again.

 make install