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: a07f3367d7,b2c4d98cbc17f0a9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder.news-service.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: A proposal for Debian policy for Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <87aarzd14c.fsf@ludovic-brenta.org> Date: Sun, 16 May 2010 23:15:39 +0200 Message-ID: <198miwzl97pnl$.1onmpwoadjr1p.dlg@40tude.net> NNTP-Posting-Date: 16 May 2010 23:15:38 CEST NNTP-Posting-Host: 0e453c13.newsspool3.arcor-online.net X-Trace: DXC=L\QGcm@;73S[7Non7UCi8UMcF=Q^Z^V3X4Fo<]lROoRQ8kFFj]@[ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:11667 Date: 2010-05-16T23:15:38+02:00 List-Id: On Sun, 16 May 2010 22:48:19 +0200, Ludovic Brenta wrote: > "Dmitry A. Kazakov" writes: >> In the past we are used to link external libraries using package Linker and >> Default_Switches ("ada") set to, e.g. "-lgdk_pixbuf-2.0". The problem with >> this approach is that Linker package is not automatically inherited. There >> exist different workarounds all more or less unpleasant. >> >> Meanwhile there is IMO a cleaner and simpler way. Just create a gpr file >> for the library(es) in use. For example: >> >> project Gdk_Pixbuf is >> for Externally_Built use "true"; >> for Source_Files use (); >> for Library_Dir use "/usr/lib"; -- Where it resides >> for Library_Name use "gdk_pixbuf-2.0"; -- Its name (no ".so" ending) >> for Library_Kind use "dynamic"; -- Shared in this case >> end Gdk_Pixbuf; >> >> Then with it in your project: >> >> with "gdk_pixbuf.gpr"; >> project My_Library is >> ... -- No linker package needed >> end My_Library; >> >> That is. gnatmake and gprbuild will add necessary linker options to all >> projects referencing My_Library. >> >> What about adding this as a requirement to the Debian policy? > > It seems you forgot to read �5.3.6 GNAT project file and �6 Using shared > libraries. 5.3.6 seems to refer to the Ada library being packaged. What I mean is a way to reference to an external C library, e.g. libgdk_pixbuf in the example. As for 6, it gives an example with "LIBRARY"; project PROGRAM is for Source_Dirs use ("."); for Object_Dir use "obj"; for Exec_Dir use "."; for Main use ("PROGRAM"); package Linker is for Default_Switches ("Ada") use ("/usr/lib/libLIBRARY.a"); end Linker; end; that uses Default_Switches. It were not necessary if the LIBRARY.gpr (in 5.3.6) described both static and dynamic builds controlled by Library_Type variable. gnatmake is smart enough to choose either *.a or *.so for the dependant library/application. E.g. project LIBRARY is type Library_Kind_Type is ("static", "relocatable"); Library_Kind : Library_Kind_Type := external ("Library_Type", "relocatable"); for Library_Kind use Library_Kind; for Library_Name use "LIBRARY"; -- Valid for either choice for Library_Dir use "/usr/lib"; -- Valid for either choice ... for Externally_Built use "true"; end LIBRARY; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de