* gnat executables @ 2012-02-22 15:31 tonyg 2012-02-22 16:01 ` Dmitry A. Kazakov ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: tonyg @ 2012-02-22 15:31 UTC (permalink / raw) 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 ? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-22 15:31 gnat executables tonyg @ 2012-02-22 16:01 ` Dmitry A. Kazakov 2012-02-22 16:14 ` tonyg 2012-02-24 19:31 ` gnat executables for Gtk Ada Francois54 2012-03-20 12:47 ` gnat executables tonyg 2 siblings, 1 reply; 9+ messages in thread From: Dmitry A. Kazakov @ 2012-02-22 16:01 UTC (permalink / raw) 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-22 16:01 ` Dmitry A. Kazakov @ 2012-02-22 16:14 ` tonyg 2012-02-22 19:29 ` Jan Andres 0 siblings, 1 reply; 9+ messages in thread From: tonyg @ 2012-02-22 16:14 UTC (permalink / raw) 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-22 16:14 ` tonyg @ 2012-02-22 19:29 ` Jan Andres 2012-02-22 20:21 ` Dmitry A. Kazakov 0 siblings, 1 reply; 9+ messages in thread From: Jan Andres @ 2012-02-22 19:29 UTC (permalink / raw) 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. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-22 19:29 ` Jan Andres @ 2012-02-22 20:21 ` Dmitry A. Kazakov 2012-02-23 3:38 ` John B. Matthews 0 siblings, 1 reply; 9+ messages in thread From: Dmitry A. Kazakov @ 2012-02-22 20:21 UTC (permalink / raw) 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-22 20:21 ` Dmitry A. Kazakov @ 2012-02-23 3:38 ` John B. Matthews 2012-02-23 8:37 ` Simon Wright 0 siblings, 1 reply; 9+ messages in thread From: John B. Matthews @ 2012-02-23 3:38 UTC (permalink / raw) 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> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-23 3:38 ` John B. Matthews @ 2012-02-23 8:37 ` Simon Wright 0 siblings, 0 replies; 9+ messages in thread From: Simon Wright @ 2012-02-23 8:37 UTC (permalink / raw) "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; ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables for Gtk Ada 2012-02-22 15:31 gnat executables tonyg 2012-02-22 16:01 ` Dmitry A. Kazakov @ 2012-02-24 19:31 ` Francois54 2012-03-20 12:47 ` gnat executables tonyg 2 siblings, 0 replies; 9+ messages in thread From: Francois54 @ 2012-02-24 19:31 UTC (permalink / raw) 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. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: gnat executables 2012-02-22 15:31 gnat executables tonyg 2012-02-22 16:01 ` Dmitry A. Kazakov 2012-02-24 19:31 ` gnat executables for Gtk Ada Francois54 @ 2012-03-20 12:47 ` tonyg 2 siblings, 0 replies; 9+ messages in thread From: tonyg @ 2012-03-20 12:47 UTC (permalink / raw) 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. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-03-20 12:48 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox