comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: static GtkAda
Date: Wed, 25 Aug 2004 19:55:36 +0200
Date: 2004-08-25T19:56:39+02:00	[thread overview]
Message-ID: <87isb7nluv.fsf@insalien.org> (raw)
In-Reply-To: slrncipimf.8uj.adi@ppc201.mipool.uni-jena.de

Adrian Knoth writes:
> Hi,
>
> is it possible to make a static binary of a GtkAda-application
> under Debian unstable?
>
> It's just a "I never needed that but now there's a bad hurry"-
> question. I tried largs, cargs, bargs with -static, gtkada-config
> with -static-flag, but the result isn't a static binary. Linking
> fails.

Of course.  I always recommend GNAT project files.  You can do
something like this:

with "/usr/share/ada/adainclude/gtkada2.gpr";
project My_Static_Project is
   ...
   package Linker is
      for Default_Options ("Ada") use
         ("/usr/lib/libgtkada2.a",
          "/usr/lib/libgnomeada2.a",  -- if required
          Other_Libs);
   end Linker;
end My_Static_Project;

The trick is the Other_Libs.  If you link GtkAda statically, you need
to specify excplicitly all the other libraries that GtkAda requires.
You can choose static or dynamic linking for these other libraries.
On my system, ldd /usr/lib/libgtkada2.so yields an impressive list of
libraries that libgtkada2 depends on, directly or indirectly:

libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x402ab000)
libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x4057e000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x405f0000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x4060b000)
libm.so.6 => /lib/libm.so.6 (0x40620000)
libpangoxft-1.0.so.0 => /usr/lib/libpangoxft-1.0.so.0 (0x40642000)
libpangox-1.0.so.0 => /usr/lib/libpangox-1.0.so.0 (0x40647000)
libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x40653000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x40689000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x406c3000)
libdl.so.2 => /lib/libdl.so.2 (0x406c7000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x406ca000)
libgnat-3.15p.so.1 => /usr/lib/libgnat-3.15p.so.1 (0x40749000)
libc.so.6 => /lib/libc.so.6 (0x408de000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40a12000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x40ad9000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40add000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40ae5000)
libXft.so.2 => /usr/lib/libXft.so.2 (0x40af3000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40b05000)
libz.so.1 => /usr/lib/libz.so.1 (0x40b73000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x40b84000)
libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x40bab000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0x40bb4000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x40bbc000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x40be2000)

If you link dynamically against, say, libgtk-x11-2.0.so, you will
automatically get some of these for free.

PS. The -static argument to the binder just says to link libgnat and
libgnarl statically; it does not affect the other libraries.

PPS. Note that the GtkAda static library contains debugging symbols
and is almost 15 megabytes in size.  Your executable will be very big,
so you'll probably want to strip it.

-- 
Ludovic Brenta.



  reply	other threads:[~2004-08-25 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-25 17:22 static GtkAda Adrian Knoth
2004-08-25 17:55 ` Ludovic Brenta [this message]
2004-08-25 18:55   ` Georg Bauhaus
2004-08-25 19:08     ` Ludovic Brenta
2004-08-26 11:15       ` Georg Bauhaus
2004-08-26 17:57         ` Ludovic Brenta
2004-08-25 20:10   ` Adrian Knoth
2004-08-25 20:19     ` Florian Weimer
2004-08-25 20:35       ` Adrian Knoth
2004-08-25 20:43         ` Florian Weimer
replies disabled

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