Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.ada

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-22-2012, 02:31 PM
tonyg
Guest
 
Posts: n/a
Default gnat executables

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 ?
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 02-22-2012, 03:01 PM
Dmitry A. Kazakov
Guest
 
Posts: n/a
Default Re: gnat executables

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. Kazakov
http://www.dmitry-kazakov.de
Reply With Quote
  #3 (permalink)  
Old 02-22-2012, 03:14 PM
tonyg
Guest
 
Posts: n/a
Default Re: gnat executables

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
Reply With Quote
  #4 (permalink)  
Old 02-22-2012, 06:29 PM
Jan Andres
Guest
 
Posts: n/a
Default Re: gnat executables

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.
Reply With Quote
  #5 (permalink)  
Old 02-22-2012, 07:21 PM
Dmitry A. Kazakov
Guest
 
Posts: n/a
Default Re: gnat executables

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 With Quote
  #6 (permalink)  
Old 02-23-2012, 02:38 AM
John B. Matthews
Guest
 
Posts: n/a
Default Re: gnat executables

In article <qgcucdi2xnvo.18zbqxljktrbk.dlg@40tude.net>,
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote:

> 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


There's an example Makefile here:

<http://home.roadrunner.com/~jbmatthews/gtk/lady.html>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Reply With Quote
  #7 (permalink)  
Old 02-23-2012, 07:37 AM
Simon Wright
Guest
 
Posts: n/a
Default Re: gnat executables

"John B. Matthews" <nospam@nospam.invalid> writes:

> In article <qgcucdi2xnvo.18zbqxljktrbk.dlg@40tude.net>,
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote:
>
>> 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

>
> There's an example Makefile here:
>
> <http://home.roadrunner.com/~jbmatthews/gtk/lady.html>


I don't think AdaCore are 100% consistent on this, but they have used
an environment variable LIBRARY_TYPE to control GPRs: for example, (one
of mine),

project BC is

type Library_T is ("static", "relocatable");
Library_Type : Library_T := external ("LIBRARY_TYPE", "static");

for Library_Name use "bc";
for Library_Kind use Library_Type;
for Library_Dir use "../../lib/bc/lib-" & Library_Type;
for Externally_Built use "true";
for Source_Dirs use ("../../include/bc/");

end BC;
Reply With Quote
  #8 (permalink)  
Old 02-24-2012, 06:31 PM
Francois54
Guest
 
Posts: n/a
Default Re: gnat executables for Gtk Ada

Le 22/02/2012 16:31, tonyg a écrit :
> 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 ?


I assume you are using GtkAda on Windows.
GTKAda requires several DLL for the C libraries GLib, Pango, Cairo, ATK,
etc .. found in directory GTKADA\bin
( libgtk-win32-2.0-0.dll, libgdk-win32-2.0-0.dll ..)

You have to ship these DLLs with the application (about 10 Mega)
The switch in scenario (static, relocatable) applies only to the Ada
part i.e. the Gnat Run-Time and GTKAda.
these DLLs are libgtkada-2.18.dll and libgnat-2011.dll

If you build with static you have the Ada run-time and GTKADa
in the executable (which explains the size of at least 1 Mo)
With relocatable you must ship also the corresponding DLLs for Ada.





Reply With Quote
  #9 (permalink)  
Old 03-20-2012, 11:47 AM
tonyg
Guest
 
Posts: n/a
Default Re: gnat executables

On Wednesday, February 22, 2012 3:31:29 PM UTC, 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 ?


Thanks for the help from you all here.
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 04:55 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.