Vadim Godunko <[email protected]> writes:

> On 06/25/2010 12:46 PM, Stephen Leake wrote:
>> Vadim Godunko <[email protected]> writes:
>> 
>>> On 06/25/2010 04:31 AM, Roger Mc Murtrie wrote:
>>>> Any idea of what might cause the moc files not to be regenerated?
>>> Regeneration of moc files is a bug in the gprbuild. 
>> 
>> Can you elaborate on this? I'm maintaining gprbuild for Debian, and I
>> now use it at work in a way similar to your use in qtada. Specifically,
>> it runs auto_text_io to generate some packages, then gcc to compile
>> them and others. 
>> 
>> This works with GNAT Pro 6.3, with one minor problem; gprbuild doesn't
>> understand the ordering requirement between auto_text_io and gcc,
>> so it generates some files after they are needed. This requires two
>> passes of gprbuild, but the top level project file is the same.
>> 
>> To get a clean build from scratch, it is convenient to run gprbuild with
>> the auto_text_io top level project file first, then again with the main
>> top level project file. But that's not strictly necessary.
>> 
> Probably, you have slightly another approach, could you please share it
> with us?
>
>>> This bug was fixed 
>> 
>> Can you say what changed?
>> 
> I mean gprbuild from <= GNAT GPL 2009 allows to have two project files
> line this (I typed from memory, sorry for possible error):
>
> --- p_moc.gpr ---
>
> project P_Moc is
>    for Languages use ("Amoc");
>    for Source_Files use ("p.ads");
> end P_Moc;
>
> --- p.gpr ---
>
> with "p_moc";
>
> project P is
>    for Main use ("driver.adb");
> end P;
>
> p.ads file is presented in both projects but associated with different
> languages. This trick doesn't work longer, because each file can belongs
> to only one project.

Ah, right. I encountered that bug in GNAT 6.3, and reported it to
AdaCore; it's now fixed in the development sources. So my statement
above "works with GNAT 6.3" is wrong. In addition, gprbuild is released
separately from GNAT, so the correct version info is:

works with gprbuild 1.3
broken with gprbuild 1.4
works with gprbuild 1.5w (and with 1.5, when that is released)

I'll make a note not to upgrade the Debian gprbuild package to 1.4, but
just wait for 1.5.

Or I could try to back-port the fix, but it's not likely to be simple.

Other than that, I use this same project file style with auto_text_io.

The remaining small problem is that gprbuild might try to run 'gcc
driver.adb' before running 'amoc p.ads', because it does not know about
the ordering between Amoc and Ada. That causes a compile error on the
first run, since driver.adb depends on p.ads. But a second run of
gprbuild gets no error, since the first run does run 'amoc p.ads'.

To build cleanly from scratch, run:

gprbuild -P P_Moc
gprbuild -P P

-- 
-- Stephe

_______________________________________________
qtada-users mailing list
[email protected]
http://box347.bluehost.com/mailman/listinfo/qtada-users_lists.qtada.com

Reply via email to