File: gprconfig.patch

package info (click to toggle)
gprbuild 2018-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,248 kB
  • sloc: ada: 68,368; xml: 4,043; makefile: 423; sh: 365; ansic: 97; cpp: 89; fortran: 62
file content (246 lines) | stat: -rw-r--r-- 9,469 bytes parent folder | download
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
Subject: share/gprconfig/*.xml fixes for Debian
 Add gnatgcc to the knowledge base.
 EXEC seems more general than ${PREFIX}gcc, gcc-${VERSION} or similar.
 .
 In compilers.xml, select X (>= 5) instead of X.Y (<= 4.9) as Ada version.
 This affects Toolchain_Version in gnat.xml, then -lgnatX linker arguments.
 .
 Prefer gnatgcc to gcc for Ada. This requires a work-around in gprlib,
 because it does strong assertions about the compiler name.
 .
 We put gprbind and gprlib in /lib/gprbuild, not /libexec/gprbuild. We don't
 put them in /usr/lib/${DEB_HOST_MULTIARCH}/gprbuild, because the multiarch
 conventions do not yet address executables.
 Moreover, their path must be written in the arch-indep
 /usr/share/gprconfig/*.xml.
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Author: Nicolas Boulenguez <nicolas@debian.org>
Forwarded: not-needed

--- a/share/gprconfig/compilers.xml
+++ b/share/gprconfig/compilers.xml
@@ -173,12 +173,11 @@
     <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-generic-linux-gnu-|.*-pc-mingw32.*|.*-xcoff-.*|arm-linux-androideabi-|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|aarch64-linux-gnu-|.*-qnx.*)?gnatls</executable>
     <version>
       <external>${PREFIX}gnatls -v --version</external>
-      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
+      <grep regexp="^GNATLS.+?(\d+)" group="1"></grep>
     </version>
     <languages>Ada</languages>
     <variable name="gcc_version">
-      <external>${PREFIX}gcc -v</external>
-      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
+      <external>${PREFIX}gnatgcc -dumpversion</external>
     </variable>
     <runtimes default="default,kernel,native">
        <directory group="default" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>
@@ -187,7 +186,7 @@
        <directory group="1" >\.\./$TARGET/lib/gnat/(.*)/adalib/</directory>
     </runtimes>
     <target>
-      <external>${PREFIX}gcc -dumpmachine</external>
+      <external>${PREFIX}gnatgcc -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
--- a/share/gprconfig/gnat.xml
+++ b/share/gprconfig/gnat.xml
@@ -47,7 +47,7 @@
           Binder'Required_Switches ("Ada")  &amp;
           ("ada_binder=gnaampbind");
       for Driver         ("Ada") use
-          "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprbind";
+          "${GPRCONFIG_PREFIX}/lib/gprbuild/gprbind";
    end Binder;
 
    for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
@@ -60,7 +60,7 @@
    &filter_gnat;
    <config>
    package Compiler is
-      for Driver                   ("Ada") use "${PATH(ada)}${PREFIX(ada)}gcc";
+      for Driver                   ("Ada") use "${PATH(ada)}${PREFIX(ada)}gnatgcc";
       for Language_Kind            ("Ada") use "unit_based";
       for Dependency_Kind          ("Ada") use "ALI_File";
       for Leading_Required_Switches        ("Ada") use
@@ -76,7 +76,7 @@
    package Binder is
       for Objects_Path_File     ("Ada") use "ADA_PRJ_OBJECTS_FILE";
       for Driver         ("Ada") use
-          "${GPRCONFIG_PREFIX}libexec/gprbuild/gprbind";
+          "${GPRCONFIG_PREFIX}lib/gprbuild/gprbind";
    end Binder;
 
    for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
--- a/share/gprconfig/linker.xml
+++ b/share/gprconfig/linker.xml
@@ -811,7 +811,7 @@
     </targets>
     <config>
    for Library_Support  use "static_only";
-   for Library_Builder  use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
     </config>
   </configuration>
 
@@ -875,7 +875,7 @@
        <target name="^x86_64-.*darwin.*$" />
     </targets>
     <config>
-   for Library_Builder use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
    for Library_Support use "full";
    for Shared_Library_Prefix use "lib";
 
@@ -920,7 +920,7 @@
        <target name="^.*hpux.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Shared_Library_Minimum_Switches use ("-shared", "-fPIC");
@@ -960,7 +960,7 @@
        <target name="^.*qnx[0-9]*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Shared_Library_Minimum_Switches use ("-shared");
@@ -1025,7 +1025,7 @@
     </targets>
     <config>
    for Library_Partial_Linker use
-         ("${PATH(ada)}${PREFIX(ada)}gcc", "-nostdlib", "-Wl,-r", "-o");
+         ("${PATH(ada)}${PREFIX(ada)}gnatgcc", "-nostdlib", "-Wl,-r", "-o");
     </config>
   </configuration>
 
@@ -1044,7 +1044,7 @@
     </targets>
     <config>
    for Library_Partial_Linker use
-         ("${PATH(c)}${PREFIX(c)}gcc", "-nostdlib", "-Wl,-r", "-o");
+         ("${PATH(c)}${PREFIX(c)}gnatgcc", "-nostdlib", "-Wl,-r", "-o");
     </config>
   </configuration>
 
@@ -1094,7 +1094,7 @@
        <target name="^.*solaris.*$"/>
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Shared_Library_Minimum_Switches use ("-shared");
@@ -1130,7 +1130,7 @@
       <target name="^.*mingw.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Shared_Library_Minimum_Switches use ("-shared", "-shared-libgcc");
@@ -1151,7 +1151,7 @@
        <target name="^.*osf.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Shared_Library_Minimum_Switches use
@@ -1188,7 +1188,7 @@
     </targets>
     <config>
    for Library_Support use "full";
-   for Library_Builder use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
+   for Library_Builder use "${GPRCONFIG_PREFIX}lib/gprbuild/gprlib";
     </config>
   </configuration>
 
@@ -1614,7 +1614,7 @@
        <compiler language="Ada" runtime="ios-simulator" />
      </compilers>
      <config>
-   for Library_Partial_Linker use ("${PATH(ada)}${PREFIX(ada)}gcc",
+   for Library_Partial_Linker use ("${PATH(ada)}${PREFIX(ada)}gnatgcc",
                                    "-mios-version-min=8.0",
                                    "-nostdlib", "-Wl,-r", "-o");
    package Linker is
--- a/src/gprlib.adb
+++ b/src/gprlib.adb
@@ -1940,7 +1940,13 @@
                      else
                         Compiler_Name := new String'(Line (1 .. Last));
 
-                        if Last > 3
+                        if Last > 7
+                          and then Line (Last - 6 .. Last) = "gnatgcc"
+                        then
+                           Gnatbind_Name :=
+                             new String'(Line (1 .. Last - 7) & "gnatbind");
+
+                        elsif Last > 3
                           and then Line (Last - 2 .. Last) = "gcc"
                         then
                            Gnatbind_Name :=
--- a/share/gprconfig/c.xml
+++ b/share/gprconfig/c.xml
@@ -6,6 +6,7 @@
    <configuration>
      <compilers>
        <compiler name="^GCC$" language="C" />
+       <compiler name="^GNATGCC$" language="C" />
        <compiler name="^GCC_Pro$" language="C" />
        <compiler name="^GCC-28$" language="C" />
        <compiler name="^GCC-CYGMING$" language="C" />
@@ -14,7 +15,7 @@
      </compilers>
      <config>
    package Compiler is
-      for Driver              ("C") use "${PATH(c)}${PREFIX(c)}gcc";
+      for Driver              ("C") use "${PATH(c)}${EXEC(c)}";
    end Compiler;
      </config>
    </configuration>
@@ -138,6 +139,7 @@
    <configuration>
      <compilers>
        <compiler name="^GCC$" language="C" />
+       <compiler name="^GNATGCC$" language="C" />
        <compiler name="^GCC_Pro$" language="C" />
        <compiler name="^GCC-CYGMING$" language="C" />
        <compiler name="^GCC-MINGW32$" language="C" />
@@ -205,6 +207,7 @@
    <configuration>
      <compilers>
        <compiler name="^GCC$" language="C" />
+       <compiler name="^GNATGCC$" language="C" />
        <compiler name="^GCC_Pro$" language="C" />
        <compiler name="^GCC-28$" language="C" />
      </compilers>
--- /dev/null
+++ b/share/gprconfig/gnatgcc.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" ?>
+<gprconfig>
+  <compiler_description>
+    <name>GNATGCC</name>
+    <executable>gnatgcc</executable>
+    <version>
+      <external>gnatgcc -dumpversion</external>
+      <grep regexp="[^\r\n]+"></grep>
+    </version>
+    <languages>C</languages>
+    <target>
+      <external>gnatgcc -dumpmachine</external>
+      <grep regexp="[^\r\n]+"></grep>
+    </target>
+  </compiler_description>
+</gprconfig>