Description: improve style in projects
 Use "library" explicit project qualifier.
 .
 Only set Library_Version for relocatable libraries.
 .
 Ensure that all projects consistently require explicit BUILD and LIBRARY_KIND.
 .
 Removed unused OS_Kind external variable.
 .
 Compute once External_As_List instead of many Split().
Forwarded: no
Author: Nicolas Boulenguez <nicolas@debian.org>

--- a/gmp/gnatcoll_gmp.gpr
+++ b/gmp/gnatcoll_gmp.gpr
@@ -23,7 +23,7 @@
 
 with "gnatcoll";
 
-project GnatColl_GMP is
+library project GnatColl_GMP is
 
    Version := External ("GNATCOLL_VERSION", "0.0");
    Name    := "gnatcoll_gmp";
@@ -41,12 +41,12 @@
    for Library_Dir
       use "lib/" & Project'Library_Kind;
    for Library_Name    use Name;
-   for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
 
    for Languages use ("Ada", "C");
 
    case Library_Type is
       when "relocatable" =>
+         for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
          for Library_Options use ("-lgmp");
       when others =>
          null;
--- a/iconv/gnatcoll_iconv.gpr
+++ b/iconv/gnatcoll_iconv.gpr
@@ -23,13 +23,13 @@
 
 with "gnatcoll";
 
-project GnatColl_Iconv is
+library project GnatColl_Iconv is
 
    Version := External ("GNATCOLL_VERSION", "0.0");
    Name    := "gnatcoll_iconv";
 
    type Build_Type is ("DEBUG", "PROD");
-   Build : Build_Type := External ("BUILD", "PROD");
+   Build : Build_Type := External ("BUILD");
 
    type Library_Type_Type is ("relocatable", "static", "static-pic");
    Library_Type : Library_Type_Type := External ("LIBRARY_TYPE");
@@ -41,17 +41,14 @@
    for Library_Dir
       use "lib/" & Project'Library_Kind;
    for Library_Name    use Name;
-   for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
 
    for Languages use ("Ada", "C");
 
-   type OS_Kind is ("windows", "unix", "osx");
-   OS : OS_Kind := External ("GNATCOLL_OS", "unix");
-
    Iconv_Opt := External ("GNATCOLL_ICONV_OPT", "-liconv");
 
    case Library_Type is
       when "relocatable" =>
+         for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
          for Library_Options use (Iconv_Opt);
       when others =>
          null;
--- a/python/gnatcoll_python.gpr
+++ b/python/gnatcoll_python.gpr
@@ -23,19 +23,19 @@
 
 with "gnatcoll";
 
-project GnatColl_Python is
+library project GnatColl_Python is
 
    Version := External ("GNATCOLL_VERSION", "0.0");
    Name    := "gnatcoll_python";
 
    type Build_Type is ("DEBUG", "PROD");
-   Build : Build_Type := External ("BUILD", "PROD");
+   Build : Build_Type := External ("BUILD");
 
    type Library_Type_Type is ("relocatable", "static", "static-pic");
-   Library_Type : Library_Type_Type := External ("LIBRARY_TYPE", "static");
+   Library_Type : Library_Type_Type := External ("LIBRARY_TYPE");
 
-   Python_CFLAGS := External("GNATCOLL_PYTHON_CFLAGS", "");
-   Python_Libs := External("GNATCOLL_PYTHON_LIBS", "");
+   Python_CFLAGS := External_As_List ("GNATCOLL_PYTHON_CFLAGS", " ");
+   Python_Libs := External_As_List ("GNATCOLL_PYTHON_LIBS", " ");
    Libpython_Kind := External("GNATCOLL_LIBPYTHON_KIND", "shared");
 
    for Source_Dirs     use (".");
@@ -45,18 +45,17 @@
    for Library_Dir
       use "lib/" & Project'Library_Kind;
    for Library_Name    use Name;
-   for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
 
    for Languages use ("Ada", "C");
 
-   type OS_Kind is ("windows", "unix", "osx");
-   OS : OS_Kind := External ("GNATCOLL_OS", "unix");
-
    case Library_Type is
       when "relocatable" =>
+         for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
          case Libpython_Kind is
             when "shared" =>
-               for Library_Options use Split(Python_Libs, " ");
+               for Library_Options use Python_Libs;
+            when others =>
+               null;
          end case;
       when others =>
          null;
@@ -68,12 +67,14 @@
             for Switches ("Ada") use
               ("-g", "-O0", "-gnata", "-gnatVa", "-gnatQ", "-gnaty", "-gnateE",
                "-gnatwaCJe", "-fstack-check");
-            for Switches ("C") use ("-g", "-Wunreachable-code") & Split(Python_CFLAGS, " ");
+            for Switches ("C") use ("-g", "-Wunreachable-code")
+              & Python_CFLAGS;
 
          when "PROD" =>
             --  Do not use -gnatwe for production mode
             for Switches ("Ada") use ("-O2", "-gnatn", "-gnatwaCJ");
-            for Switches ("C") use ("-O2", "-Wunreachable-code") & Split(Python_CFLAGS, " ");
+            for Switches ("C") use ("-O2", "-Wunreachable-code")
+              & Python_CFLAGS;
       end case;
    end Compiler;
 
@@ -96,7 +97,7 @@
    end Builder;
 
    package Linker is
-      for Linker_Options use Split(Python_Libs, " ");
+      for Linker_Options use Python_Libs;
    end Linker;
 
    package Ide is
--- a/readline/gnatcoll_readline.gpr
+++ b/readline/gnatcoll_readline.gpr
@@ -23,7 +23,7 @@
 
 with "gnatcoll";
 
-project GnatColl_Readline is
+library project GnatColl_Readline is
 
    Version := External ("GNATCOLL_VERSION", "0.0");
    Name    := "gnatcoll_readline";
@@ -41,10 +41,10 @@
    for Library_Dir
       use "lib/" & Project'Library_Kind;
    for Library_Name    use Name;
-   for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
 
    case Library_Type is
       when "relocatable" =>
+         for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
          for Library_Options use ("-lreadline");
       when others =>
          null;
@@ -52,9 +52,6 @@
 
    for Languages use ("Ada");
 
-   type OS_Kind is ("windows", "unix", "osx");
-   OS : OS_Kind := External ("GNATCOLL_OS", "unix");
-
    package Compiler is
       case Build is
          when "DEBUG" =>
--- a/syslog/gnatcoll_syslog.gpr
+++ b/syslog/gnatcoll_syslog.gpr
@@ -23,13 +23,13 @@
 
 with "gnatcoll";
 
-project GnatColl_Syslog is
+library project GnatColl_Syslog is
 
    Version := External ("GNATCOLL_VERSION", "0.0");
    Name    := "gnatcoll_syslog";
 
    type Build_Type is ("DEBUG", "PROD");
-   Build : Build_Type := External ("BUILD", "PROD");
+   Build : Build_Type := External ("BUILD");
 
    type Library_Type_Type is ("relocatable", "static", "static-pic");
    Library_Type : Library_Type_Type := External ("LIBRARY_TYPE");
@@ -41,13 +41,14 @@
    for Library_Dir
       use "lib/" & Project'Library_Kind;
    for Library_Name    use Name;
-   for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
-
+   case Library_Type is
+      when "relocatable" =>
+         for Library_Version use "lib" & Name & Gnatcoll.So_Ext & "." & Version;
+      when others =>
+         null;
+   end case;
    for Languages use ("Ada", "C");
 
-   type OS_Kind is ("windows", "unix", "osx");
-   OS : OS_Kind := External ("GNATCOLL_OS", "unix");
-
    package Compiler is
       case Build is
          when "DEBUG" =>
