comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: GNAT, shared libraries, building in different directories...madness!
Date: Sun, 01 Oct 2006 18:28:18 +0200
Date: 2006-10-01T18:28:18+02:00	[thread overview]
Message-ID: <87sli880gt.fsf@ludovic-brenta.org> (raw)
In-Reply-To: m2sli8nive.fsf@grendel.local

Simon Wright writes:
> "sphinxmoro" writes:
>
>> Hello,
>> 1) I am not quite sure of what you mean whth the flag
>> "-gntafno"
>> Can you explain the meaning of the flag (or is this a typo?)
>
> That must be -gnatfno (gnatmake -v will tell you the meanings, though
> I expect you knew that).

Actually I meant -gnatafno (a=assertions enabled, f=full errors,
n=inlining across units, o=full range checks).  Sorry for the typo.
You can, of course, adjust compiler options to taste.

>> 2) When I have to use a library, ACT suggest to add a path like:
>>
>>    package Linker is
>>       for Default_Switches ("ada") use ("-g", "--largs",
>> "-Ld:/dev/ada/utils/lib", "-lmyutils");
>>    end Linker;
>>
>> This is working, and in your example you don't specify such a path.
>> What do you think?

I don't like adding "-L" in project files, because that would make
them inflexible.  Also, remember that the plan is to install the
project file in /usr/share/ada/adainclude as part of the library's
development package (presumably, libmyutils-dev), and the library in
/usr/lib, as part of the run-time library package (presumably,
libmyutils0).  If the library is in /usr/lib, there is no need for
"-L" in the first place.  If you build a program that depends on the
library before the library has been installed in /usr/lib, the best is
to pass "-L" directly to gnatmake, like so:

gnatmake -Pfoo -largs -Lbuild

where "build" is a directory relative to the Makefile.

Maybe I should have explained that better in my first reply.

Now, since you seem to be running on an operating system that has no
policy as regards library placement, maybe it is necessary to specify
a library path at some point.  But the OP did mention Linux, and to me
this implies the GNU linker and toolchain, and some sort of
conformance to the Filesystem Hierarchy Standard.

Come to think of it, it is really better not to write the linker path
in the project file, because the linker path tends to be
system-depedent, whereas the project file is platform-neutal.  I
prefer to provide the necessary "glue" in the Makefile.

-- 
Ludovic Brenta.



  reply	other threads:[~2006-10-01 16:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28 18:54 GNAT, shared libraries, building in different directories...madness! Lucretia
2006-09-30  6:30 ` vgodunko
2006-09-30 18:07 ` Ludovic Brenta
2006-10-01 14:44   ` sphinxmoro
2006-10-01 15:41     ` Simon Wright
2006-10-01 16:28       ` Ludovic Brenta [this message]
2006-10-05 12:22   ` Philippe Bertin
2006-10-05 12:33     ` Ludovic Brenta
2006-10-05 15:28       ` Philippe Bertin
2006-10-05 16:06         ` Alex R. Mosteo
2006-10-05 20:22         ` Ludovic Brenta
2006-10-07  8:21           ` Simon Wright
2006-10-14 19:13   ` Lucretia
2006-10-15 11:00     ` Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2006-09-28 19:11 Lucretia
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox