China dissident Chen Guangcheng arrives in the US, 陈光诚到美

今日看到消息,陈光诚已经安全到达美国。
BBC News
New Yok Times News

他们一家人能获得自由和安全,本应该高兴才是,可是心里还是高兴不起来。这么大一个国家,居然不能给他们一家一个安全的居身之所?号称960万平方公里的国土,最安全的地方居然是美领馆?! 难道要全部受到不公正待遇的人都跑美领馆?

这是一个为国家感到悲哀的日子。

Get_Line problem

This is old story, but I am still referring to it sometimes as I am still new to Ada programming.

Links at: comp.lang.ada

So the best pratice to read a line is like the code from wikibook Ada Programming:

 declare
     The_Line: String(1..100);
     Last: Natural;
  begin
     loop
        Text_IO.Get_Line(The_Line, Last);
        --  do something with The_Line ...
     end loop;
  exception
     when Text_IO.End_Error =>
        null;
  end;

Building an Ada development environment using FSF GCC for Slackware

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
/usr/lib<64>/gnat/package-name.gpr

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 and source 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 normal 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.