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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,10706aebb8b707de X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.136.40 with SMTP id px8mr23044334pbb.1.1329942104117; Wed, 22 Feb 2012 12:21:44 -0800 (PST) Path: wr5ni56456pbc.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: gnat executables Date: Wed, 22 Feb 2012 21:21:38 +0100 Organization: cbb software GmbH Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: /Wcnb7Rkuam5OjTkui4lSw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-02-22T21:21:38+01:00 List-Id: On Wed, 22 Feb 2012 19:29:57 +0000 (UTC), Jan Andres wrote: > On 2012-02-22, tonyg wrote: >> On Feb 22, 4:01�pm, "Dmitry A. Kazakov" >> 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