comp.lang.ada
 help / color / mirror / Atom feed
From: Adrian Knoth <adi@thur.de>
Subject: Re: static GtkAda
Date: 25 Aug 2004 20:10:41 GMT
Date: 2004-08-25T20:10:41+00:00	[thread overview]
Message-ID: <slrncipsi1.902.adi@ppc201.mipool.uni-jena.de> (raw)
In-Reply-To: 87isb7nluv.fsf@insalien.org

Ludovic Brenta <ludovic.brenta@insalien.org> wrote:

>    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

It took me some time to figure out that "Other_Libs" is not a predefined
variable. But grepping through the gcc-CVS showed it ;)

And the line is "Default_Switches", not Default_Options. I managed
to build the application with the following settings:

   package Linker is
      for Default_Switches ("Ada") use
         ("--static",
          "/usr/lib/libgtkada2.a",
          "/usr/lib/libgtk-x11-2.0.a",
          "/usr/lib/libgdk-x11-2.0.a",
          "/usr/lib/libatk-1.0.a",
          "/usr/lib/libgdk_pixbuf-2.0.a",
          "/usr/lib/libm.a",

          "/usr/lib/libpangoxft-1.0.a",
          "/usr/lib/libpangox-1.0.a",
          "/usr/lib/libpango-1.0.a",
          "/usr/lib/libpangoft2-1.0.a",

          "/usr/lib/libgobject-2.0.a",
          "/usr/lib/libgmodule-2.0.a",
          "/usr/lib/libglib-2.0.a",
          "/usr/lib/libdl.a",
          "/usr/X11R6/lib/libXrandr.a",
          "/usr/X11R6/lib/libXi.a",
          "/usr/X11R6/lib/libXext.a",
          "/usr/lib/libXft.a",
          "/usr/lib/libfontconfig.a",
          "/usr/lib/libpthread.a",
          "/usr/lib/libc.a",
          "/usr/lib/libjpeg.a",
          "/usr/lib/libtiff.a",
          "/usr/lib/libpng.a",
          "/usr/lib/libz.a",
          "/usr/lib/libfreetype.a",
          "/usr/lib/libXcursor.a",
          "/usr/lib/libXrender.a",
          "/usr/X11R6/lib/libXinerama.a",
          "/usr/X11R6/lib/libX11.a",
          "/usr/lib/libexpat.a");

   end Linker;

And there are other things I didn't know: it's not sufficient to
include all the static libraries it's also important in which *order*
you mention them. This order above works, if you move some of
the libs below (let's say libz) to the beginning of the list the
linking process fails. Until now I don't know why. Someone else?

> libraries that libgtkada2 depends on, directly or indirectly:

Unfortunately it also requires libs which are neither directly
nor indirectly mentioned in the .so-versions. Ok, I might have
missed some libs but ldd to the so-libs never gave me libtiff
or libpng.

> 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.

My executable is <9MB, that's ok (the machine has 1GB RAM). ;)


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Win95 ist wirklich intelligent. Es macht immer das, was du nicht willst.



  parent reply	other threads:[~2004-08-25 20:10 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
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 [this message]
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