From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,82019ed25537e72d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news.uni-jena.de!not-for-mail From: Adrian Knoth Newsgroups: comp.lang.ada Subject: Re: static GtkAda Date: 25 Aug 2004 20:10:41 GMT Organization: loris.TV Message-ID: References: <87isb7nluv.fsf@insalien.org> NNTP-Posting-Host: ppc201.mipool.uni-jena.de X-Trace: fsuj29.rz.uni-jena.de 1093464641 14321 141.35.13.101 (25 Aug 2004 20:10:41 GMT) X-Complaints-To: news@rz.uni-jena.de NNTP-Posting-Date: 25 Aug 2004 20:10:41 GMT User-Agent: slrn/0.9.8.0 (Linux) Xref: g2news1.google.com comp.lang.ada:2997 Date: 2004-08-25T20:10:41+00:00 List-Id: Ludovic Brenta 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.