[Emacs-ada-mode] Emacs ada-mode gpr management
David Sauvage
sauvage.david at gmail.com
Sun May 10 07:47:21 PDT 2009
Hi,
Stephen Leake wrote:
> David Sauvage <sauvage.david at gmail.com> writes:
>
>
>> I found some old discussions [2] about using a gnatgpr tool for the
>> emacs ada-mode.
>>
>
> Right, and I had one (gnatpath) on my website for a while (actually,
> it's still there, but it will disappear soon; I really need to update
> that website!).
>
> I've stopped supporting gnatpath for two reasons:
>
> 1) It is not noticeably faster than 'gnat ls', at least on the
> machines I use, and for the large projects I have (it is faster
> for small projects).
>
> 2) It's painful to support for multiple compiler versions, since
> AdaCore changes the interfaces of the GPR packages.
>
> On the other hand, I find "gnat list" (and "gnatpath") noticeably
> slow, so if gnatgpr is significantly faster, I'd be happy to support
> it.
>
>
Well, for now i never work on making sur gnatgpr faster.
>> I've created gnatgpr for another project [3], and i then discover it
>> could really satisfy the emacs ada-mode needs .
>>
>
> Almost. Emacs Ada mode needs the list of source directories and object
> directories.
Well, at first i though Emacs Ada mode would like to know about (for
example)
Excluded_Source_Files, Source_Files, Source_File_Dirs, but ok.
> 'gnatgpr -o' gives the latter; we need the equivalent for
> sources (just the directories, not all the files).
>
Ok, so i could an -sd option in gnatgpr to list source dirrectories ...
>
>> I'm looking for someone who would be interested on integrating gnatgpr
>> [1] in emacs ada-mode, while
>> i would add the necessarry services in gnatgpr to satisfy the ada-mode
>> needs ...
>>
>
> Do you have any data on the above points?
>
> Ah; I see in your README that you do support GPL 2007 and Pro 6.1.2. I
> suggest you put that on the web page; it's critical information.
>
In the main web page, see section "GNATGPR Available compilers & platforms".
> Hmm. It seems you have captured a copy of the AdaCore code that parses
> GPR files, rather than trying to use the current compiler source
> directly. That makes sense; it insulates you from compiler version
> changes, until there is a gpr source language/feature/semantics
> change.
>
Yes, well it's rather simple to add new attribute (without processing them)
> What compiler version did you copy this from (I'm guessing GPL 2008)?
>
>
gnatgpr-0.22 and above is based on a modified GNAT GPL 2008 Ada front-end
gnatgpr-0.21 and under is based on a modified GNAT GPL 2007 Ada front-end
> There are _two_ compiler versions critical for gnatgpr; the one the
> source came from (since it defines the gpr language), and the one used
> to compile the source. The latter should be a set containing at least
> the current GPL and Pro releases; the former is a single value.
>
> This is essentially a divergence from AdaCore; if they do make
> significant changes (like add a new keyword), gnatgpr may just stop
> working. But it should not be hard to fix gnatgpr to at least ignore
> the new stuff.
yes, see above.
> Or we could grab a new copy of the compiler source and
> "do it right" :).
>
>
yes ;-)
> Why do you say gnatgpr is "GNAT dependent"? Just "with GNAT.OS_Lib",
> or more than that?
I only say it because i think it would not compile with another Ada
compiler.
with GNAT.Case_Util
with GNAT.Directory_Operations
with GNAT.Dynamic_HTables
with GNAT.Dynamic_Tables
with GNAT.HTable
with GNAT.OS_Lib
with GNAT.Spelling_Checker
with GNAT.Strings
with GNAT.String_Split
> In general, non-gnat systems might benefit from gpr
> files.
>
Sure, by using gnatgpr we already use gpr project files for non-gnat systems
> I've compiled gnatgpr (on Debian with GPL 2008); it works, and seems
> quite fast on my large project. I'll do some more testing.
i use it on really large projects ;-),
By the way, there are Debian packages available ...
See the main web page, section '"GNATGPR Debian & Ubuntu packages
repository"
> (It's
> always nice when the Makefile "just works" :) (but it probably won't on
> Windows :( ).
>
ok, thanks ;-)
i know some guys how have built and use it on windows platform with
sucess ...
> Since I'm no longer supporting gnatpath, I wouldn't mind changing the
> Emacs side of this interface; it wasn't well-designed in the first
> place.
>
> I'll hack up something that lets Emacs Ada mode work with gnatgpr, if
> you can show me how to modify gnatgpr to get the source directory
> listing.
>
Well, my proposition is to help you on the gnatgpr integration, by
working on the gnatgpr side.
What i then propose you is :
gnatgpr -[n]sd <project file>
Display all included source directories.
Non-transitive analysis if n option is given.
--
David
More information about the Emacs-ada-mode
mailing list