Subject: share/gprconfig/compilers.xml regexps must allow Debian
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Forwarded: not-needed

There are regular expressions in share/gprconfig/compilers.xml that
must match the version string output by 'gcc'; patch these to allow
"Debian" in the string.

Change linker.xml and gnat.xml to find gprlib and gprbind in /usr/lib

Use gcc-4.4 explicitly, so gpbuild does not depend on which top-level
gcc is installed.

---

Index: gprbuild-1.3.0/share/gprconfig/compilers.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/compilers.xml	2009-04-22 09:41:49.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/compilers.xml	2010-03-03 07:32:56.000000000 -0500
@@ -9,14 +9,14 @@
   <!--    GCC 3.x & 4.x -->
   <compiler_description>
     <name>GCC</name>
-    <executable prefix="1">(.*(-wrs-|-elf-|-eabispe-|avr-|-elinos-linux).*)?gcc</executable>
+    <executable prefix="1">(.*(-wrs-|-elf-|-eabispe-|avr-|-elinos-linux).*)?gcc-4.4</executable>
     <version>
-      <external>${PREFIX}gcc -v</external>
-      <grep regexp="^gcc version (\S+)" group="1"></grep>
+      <external>${PREFIX}gcc-4.4 -dumpversion</external>
+      <grep regexp=".+"></grep>
     </version>
     <languages>C</languages>
     <target>
-      <external>${PREFIX}gcc -dumpmachine</external>
+      <external>${PREFIX}gcc-4.4 -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
@@ -96,12 +96,12 @@
     <name>G++</name>
     <executable>g++</executable>
     <version>
-      <external>g++ -v</external>
-      <grep regexp="^gcc version (\S+)" group="1"></grep>
+      <external>g++-4.4 -dumpversion</external>
+      <grep regexp=".+"></grep>
     </version>
     <languages>C++</languages>
     <target>
-      <external>g++ -dumpmachine</external>
+      <external>g++-4.4 -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
@@ -125,14 +125,14 @@
   <!--  Assembler -->
   <compiler_description>
     <name>GCC-ASM</name>
-    <executable prefix="1">(.*(-wrs-|-elf-|-eabispe-|avr-|elinos-linux).*)?gcc</executable>
+    <executable prefix="1">(.*(-wrs-|-elf-|-eabispe-|avr-|elinos-linux).*)?gcc-4.4</executable>
     <version>
-      <external>${PREFIX}gcc -v</external>
-      <grep regexp="^gcc version (\S+)" group="1"></grep>
+      <external>${PREFIX}gcc-4.4 -dumpversion</external>
+      <grep regexp=".+"></grep>
     </version>
     <languages>Asm,Asm_Cpp,Asm2</languages>
     <target>
-      <external>${PREFIX}gcc -dumpmachine</external>
+      <external>${PREFIX}gcc-4.4 -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
@@ -155,8 +155,8 @@
       <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
     </version>
     <variable name="gcc_version">
-      <external>${PREFIX}gcc -v</external>
-      <grep regexp="^gcc version (\S+)" group="1"></grep>
+      <external>${PREFIX}gcc-4.4 -dumpversion</external>
+      <grep regexp=".+"></grep>
     </variable>
     <languages>Ada</languages>
     <runtimes default="default,kernel">
@@ -164,7 +164,7 @@
        <directory group="2" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/</directory>
     </runtimes>
     <target>
-      <external>${PREFIX}gcc -dumpmachine</external>
+      <external>${PREFIX}gcc-4.4 -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
Index: gprbuild-1.3.0/share/gprconfig/linker.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/linker.xml	2009-03-20 06:47:26.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/linker.xml	2010-03-03 07:19:37.000000000 -0500
@@ -166,7 +166,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/gprlib";
     </config>
   </configuration>

@@ -176,7 +176,7 @@
        <target name="^.*darwin.*$" />
     </targets>
     <config>
-   for Library_Builder use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support use "full";
    for Shared_Library_Prefix use "lib";
    for Symbolic_Link_Supported use "true";
@@ -198,7 +198,7 @@
        <target name="^.*hpux.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Symbolic_Link_Supported use "true";
@@ -236,7 +236,7 @@
        <target name="^.*irix.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Symbolic_Link_Supported use "true";
@@ -299,7 +299,7 @@
        <target name="^.*solaris.*$"/>
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Symbolic_Link_Supported use "true";
@@ -321,7 +321,7 @@
       <target name="^.*mingw.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Symbolic_Link_Supported use "false";
@@ -345,7 +345,7 @@
        <target name="^.*osf.*$" />
     </targets>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Symbolic_Link_Supported use "true";
@@ -373,7 +373,7 @@
     </targets>
     <compilers><compiler name="GNAT" /></compilers>
     <config>
-   for Library_Builder  use "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprlib";
+   for Library_Builder  use "${GPRCONFIG_PREFIX}/lib/gprlib";
    for Library_Support  use "full";
    for Shared_Library_Prefix use "lib";
    for Shared_Library_Suffix use ".exe";
Index: gprbuild-1.3.0/share/gprconfig/gnat.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/gnat.xml	2009-03-20 06:47:26.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/gnat.xml	2010-03-03 07:32:56.000000000 -0500
@@ -16,7 +16,7 @@
    end Naming;

    package Compiler is
-      for Driver                   ("Ada") use "${PATH}${PREFIX}gcc";
+      for Driver                   ("Ada") use "${PATH}${PREFIX}gcc-4.4";
       for Leading_Required_Switches        ("Ada") use
           Compiler'Leading_Required_Switches ("Ada")
 	     &amp; ("-c", "-x", "ada", "-gnatA");
@@ -32,7 +32,7 @@
       for Required_Switches     ("Ada") use
           Binder'Required_Switches ("Ada")  &amp; ("-I-");
       for Driver         ("Ada") use
-          "${GPRCONFIG_PREFIX}/libexec/gprbuild/gprbind";
+          "${GPRCONFIG_PREFIX}/lib/gprbind";
    end Binder;

    for Toolchain_Version     ("Ada") use "GNAT ${VERSION}";
Index: gprbuild-1.3.0/share/gprconfig/cpp.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/cpp.xml	2009-03-17 17:53:19.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/cpp.xml	2010-03-03 07:19:37.000000000 -0500
@@ -24,7 +24,7 @@
      </compilers>
      <config>
    package Compiler is
-      for Driver              ("C++") use "${PATH}g++${PREFIX}";
+      for Driver              ("C++") use "${PATH}g++-4.4${PREFIX}";
    end Compiler;
      </config>
    </configuration>
Index: gprbuild-1.3.0/share/gprconfig/fortran.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/fortran.xml	2009-03-17 17:53:19.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/fortran.xml	2010-03-03 07:32:56.000000000 -0500
@@ -50,7 +50,7 @@
    end Naming;

    package Compiler is
-      for Driver            ("Fortran") use "${PATH}gfortran${PREFIX}";
+      for Driver            ("Fortran") use "${PATH}gfortran-4.4${PREFIX}";
       for Leading_Required_Switches ("Fortran") use
          Compiler'Leading_Required_Switches ("Fortran") &amp;
          ("-c", "-fno-underscoring");
Index: gprbuild-1.3.0/share/gprconfig/asm.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/asm.xml	2009-03-17 17:53:19.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/asm.xml	2010-03-03 07:34:01.000000000 -0500
@@ -13,7 +13,7 @@
    end Naming;

    package Compiler is
-      for Driver            ("Asm_Cpp") use "${PATH}${PREFIX}gcc";
+      for Driver            ("Asm_Cpp") use "${PATH}${PREFIX}gcc-4.4";
       for Leading_Required_Switches ("Asm_Cpp") use
          Compiler'Leading_Required_Switches ("Asm_Cpp") &amp;
          ("-c", "-x", "assembler-with-cpp");
@@ -33,7 +33,7 @@
    end Naming;

    package Compiler is
-      for Driver            ("Asm") use "${PATH}${PREFIX}gcc";
+      for Driver            ("Asm") use "${PATH}${PREFIX}gcc-4.4";
       for Leading_Required_Switches ("Asm") use
         Compiler'Leading_Required_Switches ("Asm") &amp;
         ("-c", "-x", "assembler");
@@ -53,7 +53,7 @@
    end Naming;

    package Compiler is
-      for Driver            ("Asm2") use "${PATH}${PREFIX}gcc";
+      for Driver            ("Asm2") use "${PATH}${PREFIX}gcc-4.4";
       for Leading_Required_Switches ("Asm2") use
         Compiler'Leading_Required_Switches ("Asm2") &amp;
         ("-c", "-x", "assembler");
Index: gprbuild-1.3.0/share/gprconfig/c.xml
===================================================================
--- gprbuild-1.3.0.orig/share/gprconfig/c.xml	2009-03-17 17:53:19.000000000 -0400
+++ gprbuild-1.3.0/share/gprconfig/c.xml	2010-03-03 07:19:37.000000000 -0500
@@ -23,7 +23,7 @@
      </compilers>
      <config>
    package Compiler is
-      for Driver              ("C") use "${PATH}${PREFIX}gcc";
+      for Driver              ("C") use "${PATH}${PREFIX}gcc-4.4";
    end Compiler;
      </config>
    </configuration>
