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,df7cea30536a085f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news2.google.com!news.glorb.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Controlling the linking of shared libraries Date: Sat, 23 Jul 2011 00:50:46 +0100 Organization: A noiseless patient Spider Message-ID: References: <98r7sbFs66U1@mid.individual.net> <82tyae4ya8.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="13240"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dXrTkBzZgt8J7jCoHnMmhk3W3NUmLzTE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:znR8wc6oQAUOSkmMEYVC3Z657BM= Xref: g2news1.google.com comp.lang.ada:20303 Date: 2011-07-23T00:50:46+01:00 List-Id: Stephen Leake writes: > Björn Persson writes: > >> Does anyone know how to pass command line parameters to Gnatmake and >> GPRbuild that they should forward to gcc when they invoke gcc as a >> linker to build a shared library? -largs seems to be used only when a >> program is linked. When a shared library is linked it seems to be >> ignored. > > Read chapters 11.12 "GNAT Project Manager | Library Projects" and 19 > "GNAT and Libraries" of the GNAT User manual. I did this and it took me a *long* time to see that you need Linker'Linker_Options. This is a subset of one I'm working on: with "tash_options"; project Tashlib is for Library_Name use "tash"; for Library_Kind use "static"; for Library_Dir use "lib"; for Source_Dirs use ("include"); for Externally_Built use "true"; package Linker is for Linker_Options use Tash_Options.Library_Options; end Linker; end Tashlib; and project Tash_Options is for Source_Dirs use (); Library_Options := ( "-L/usr/lib", "-ltk8.5", "-ltcl8.5" ); end Tash_Options; The resulting link for a program using tashlib.gpr is $ gnatmake -P tash_tests.gpr tashtest.adb gnatbind -E -I- -x /Users/simon/sf/tcladashell/tests/.build/tashtest.ali gnatlink /Users/simon/sf/tcladashell/tests/.build/tashtest.ali -g \ -L/Users/simon/sf/tcladashell/lib/ -ltash \ <<<