This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 3.4 - gnatmake has wrong gcc name


Jim Wilson wrote:
Joel Sherrill wrote:

My impression is that Find_Program_Name is broken for
versioned target names with '.' in them and that it really
needs to be removing a known set of extensions.  Is there anything
other than .exe$ that needs to be taken off?


It looks like .exe is the only thing that current targets use.

However, there are configure/Makefile variables to support other extensions. See ac_exeext in configure. exeext in Makefile. It would be better if you could compiled in the exeext value instead of assuming it is .exe.

Thanks Jim.


It is the end of the day and I don't have the EXEEXT part worked in yet
but here is a patch which seems to work correctly for just .exe's.
How does this look?

Would an Ada maintainer please comment on this patch and how they
feel about using EXEEXT since that will require adding some to
sdefault.adb.

Index: osint.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/osint.adb,v
retrieving revision 1.16
diff -u -r1.16 osint.adb
--- osint.adb   5 Jan 2004 15:20:45 -0000       1.16
+++ osint.adb   18 Mar 2004 23:39:21 -0000
@@ -1006,12 +1006,17 @@
          end if;
       end loop;

-      for J in reverse Cindex1 .. Cindex2 loop
-         if Command_Name (J) = '.' then
-            Cindex2 := J - 1;
-            exit;
+      --  Command_Name(Cindex1 .. Cindex2) is now the equivalent of the
+      --  POSIX command "basename argv[0]"
+
+      --  Now strip off any executable extension (usually nothing or .exe)
+      --  but formally reported by autoconf in the variable EXEEXT
+
+      if (Cindex2 - Cindex1) >= 3 then
+         if Command_Name (Cindex2 - 3 .. Cindex2) = ".exe" then
+            Cindex2 := Cindex2 - 3;
          end if;
-      end loop;
+      end if;

       Name_Len := Cindex2 - Cindex1 + 1;
       Name_Buffer (1 .. Name_Len) := Command_Name (Cindex1 .. Cindex2);

--joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]