Z's space


Building an Ada development environment using FSF GCC for Slackware

Filed under: Ada programming,Programming — by zhuqy @ 12:04
Tags: , , , , , , ,

Ada support in Slackware is minimum, there is nothing else to help the Ada programer except the stock gnat compiler.   My goal is to make GPL version of GNAT GPS released from AdaCore to work with FSF released GCC.

Debian has excellent gnat/Ada program maintainers and they had done a great job.  But then I always like the Slackware way of doing things not the Debian way.   My work are based on their hard work.

At first,  I tried to make the package to follow the Debian policy for Ada, but then I need to change quite intrusively to the original package.  And somehow I don’t like the way it place the library and include files.  Since this is Slackware, in the spirit of it, I tend not to change the original package too much unless it is really necessary.  The directory structure come out roughly  like the following:

/usr/include/package-name/  -- for include .adb and .ads files
/usr/lib<64>/package-name/ -- for .ali files

Now start building packages.  The gcc compiler in Slackware 13.37 is a little bit old for Ada language support, and it happened that build script for  gcc4.7.0 just shown up in the slackware-current tree.   I downloaded the whole source tree for gcc-4.7.0 from slackware-current and start to modified it.  I tried to mimic what Ludovic Brenta has done on Debian and build two libraries (libgnatprj/libgnatvsn) from the compiler source directly,  so that they could be reused latter for asis and gps.  His patched are quite intrusive and does not apply well as it is mean for 4.6.  I examined the patch and extracted what I needed and form two Makefiles for building libgnatprj and libgnatvsn without modified the gcc source tree itself.  It built fine first, but has linking error when try to build other packages.  It took me more than 10 builds of the compiler to make it working fine.  I haven’t took the time to compile a sjlj run time, as I don’t have a need for it yet.

Then I compiled XmlAda using the xmlada-for-gps-5.0.1-gpl-src.tgz source.  This required not much an effort.   I use the svn checkout of the GtkAda and it fixed some path problem I reported, so no patch is needed (actually, it does have a small patch to relax the path configuration).  The gprbuild program gave some challenge, as it compiled OK but failed to build Ada program.  It turns out to be a configuration xml problem, it has hard coded some lib path into it and does not acknowledge the path given during configure.

GPS is also from svn checkout.  Compiling GPS took a few round, patches are mostly for path correction and some from the Debian team.  It was compiling GPS that exposed the linking error about unresolved symbol for libgnatprj, it took me quite a few recompile of the library and compiler to get it working.

The rest are relatively easy for florist, aunit, gnatcoll, asis,etc.

The build scripts, source and pre-build binary packages for Slackware64 could be found here: goo.gl/osOED.

The build scripts could also be found at gitHub ada-4-slackware.

ps. I only tested on Slackware64 13.37, it supposed to work fine with 32-bit Slackware, but I did not test it.

pps. The svn checkout of GtkAda and GPS are using git svn clone, so it has the git version in the build tag and source file in stead of svn build number.

pps. I felt obligated to match Thomas’ kind words on Ada On Slackware64, the above link at goo.gl/osOED now really contain pre-build binaries for Slackware64. It fixed some problems with the build tar balls, some of them does not contain source tar ball. Note that it contains binutils build from slackware64-current source in order to compile gnatmem, it also contains the oprofile due to new binutils.


  1. http://ada-dk.org/2012/04/ada-on-slackware64/



    Have you considered submitting your work to slackbuilds.org?

    Comment by Thomas Løcke (@ThomasLoecke) — 2012-04-19 @ 23:57 |Reply

  2. Thanks for your kind word. Not yet to slackbuilds.org, as it replaces the default compiler of Slackware 13.37, not sure it will be accepted. I try to follow the guideline of SlackBuild for submission so it is on my plan. I will open a git repository as you suggested. Will post on c.l.a once done.

    Comment by zhuqy — 2012-04-20 @ 10:28 |Reply

  3. Your slackbuild scripts are great. I’m trying to build your gcc against the latest Slack64-current’s 4.7.1 gcc. So far, it’s building. Thanks!

    Comment by Eduardo — 2012-11-03 @ 13:47 |Reply

  4. […] Z’s space (the blog of Zhu Qun-Ying) you can find a post about building an Ada environment on Slackware64. It comes complete with a bunch of slackbuild scripts and some precompiled Slackware packages. […]

    Pingback by Ada on Slackware64 — 2015-02-10 @ 07:44 |Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: