[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dynamic and static version of installed project





Le 30/04/2014 20:55, Nicolas Boulenguez a écrit :
On Wed, Apr 30, 2014 at 01:42:42PM +0100, Ludovic Brenta wrote:
xavier grave wrote:
In the Holy Debian Ada Policy [1] it is stated that
Rule: The project file SHALL have
/usr/share/ada/adainclude/LIBRARY.
    a Library_Kind attribute equal to ‘dynamic’.
I'm wondering if the Library_Kind attribute constraint can be changed to :
   a Library_Kind attribute equal to External ("LIBRARY_KIND", dynamic);

It will allow for static linking for development.

This might be a good idea.  Could you give it a try on libxmlezout and
report back how well it works?  If then we can sanctify a
"clarification" to the Holy Debian Ada Policy :)

I suggested something similar in
https://lists.debian.org/debian-ada/2014/03/msg00038.html

If we provide a single project configurable with a variable, the
variable name should contain the library name, so that indirect
dependencies are not affected by the setting.

Indeed, but :), maybe we can offer an united variable name for all debian projects file : debian_library_kind in order to minimize the number option to be passed ?

Here is a concrete suggestion.

--  Dependencies described by a GNAT project.
with "dep1";
library project Foo is
   type Kind_Type is ("dynamic", "relocatable", "static");
   Kind : Kind_Type := External ("foo_library_kind", "dynamic");
   for Library_Name use "foo";
   for Library_Kind use Kind;
   for Source_Dirs use ("/usr/share/ada/adainclude/foo");
   for Library_Dir use "/usr/lib/$(DEB_HOST_MULTIARCH)";
   for Library_Ali_Dir use "/usr/lib/ada/adalib/foo";
   for Externally_Built use "True";
   package Linker is
      case Kind is
         when "static" =>
            --  All dependencies without GNAT project.
            for Linker_Options use ("-ldep2", "-ldep3");
         when "dynamic" | "relocatable" =>
            -- Dependencies without GNAT project, whose symbols may
            -- be referenced by an end user (renamings, C imports...).
            for Linker_Options use ("-ldep3");
      end case;
   end Linker;
end Foo;

Another one :
- Kind : Kind_Type := External ("foo_library_kind", "dynamic");
+ Kind : Kind_Type := External ("debian_library_kind", "dynamic");


Reply to: