1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
|
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" =>
|