comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: gnat executables
Date: Wed, 22 Feb 2012 21:21:38 +0100
Date: 2012-02-22T21:21:38+01:00	[thread overview]
Message-ID: <qgcucdi2xnvo.18zbqxljktrbk.dlg@40tude.net> (raw)
In-Reply-To: ji3fnl$thg$1@dont-email.me

On Wed, 22 Feb 2012 19:29:57 +0000 (UTC), Jan Andres wrote:

> On 2012-02-22, tonyg <tonythegair@gmail.com> wrote:
>> On Feb 22, 4:01�pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
>> wrote:
>>> On Wed, 22 Feb 2012 07:31:29 -0800 (PST), tonyg wrote:
>>> > Whenever I compile some code for a different PC , it asks me for the
>>> > runtime libraries for gtk and some others. Is there a way I can link
>>> > my executable so the functions used in these libraries are included in
>>> > my executable ?
>>>
>>> You have to link to the static (object) libraries. Whether this would work
>>> depends on whether the provider of the library allows static linkage or
>>> not. The answer would depend on the target platform and the licensing
>>> policy.
>>>
>>> --
>>> Regards,
>>> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de
>>
>> The librarys are all debian based, things like libgnadecommon and
>> libgtk,
>> I was really looking for the command to give to gnatmake, I know -
>> static option links
>> in the gnat runtime etc
> 
> If I understand you correctly you have two options:
> 
> 1. Instead of -lfoo specify /full/path/to/libfoo.a
> 
> 2. Something like: -largs -Wl,-Bstatic -lfoo -lbar -Wl,-Bdynamic
> 
> The latter will switch the linker to static mode, link in the libraries
> you specify and then switch it back to dynamic linking for the rest of
> the command line (i.e. the part that gets added automatically for the
> GNAT runtime etc).
> 
> Note also that the latter will probably only work on systems that have
> the GNU linker and you may have to replace -Bstatic and -Bdynamic by
> something else on other (i.e. non-Linux) OSes.

additionally, specifically regarding gtkada, there should be gtkada-config
script installed, which spits switches for the linker and compiler. To be
used like:

$ gnatmake ... -largs `gtkada-config --libs --static` ...

See gtkada-config --help

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-02-22 20:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 15:31 gnat executables tonyg
2012-02-22 16:01 ` Dmitry A. Kazakov
2012-02-22 16:14   ` tonyg
2012-02-22 19:29     ` Jan Andres
2012-02-22 20:21       ` Dmitry A. Kazakov [this message]
2012-02-23  3:38         ` John B. Matthews
2012-02-23  8:37           ` Simon Wright
2012-02-24 19:31 ` gnat executables for Gtk Ada Francois54
2012-03-20 12:47 ` gnat executables tonyg
replies disabled

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