This is the mail archive of the gcc-patches@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]

[Ada] -margs for gnatmake


Hi,

A few monthes ago I proposed a -margs switch to extend
the power of the gnatmake tool, the idea was approved by Robert Dewar:

<http://gcc.gnu.org/ml/gcc/2001-12/msg00152.html>
<http://gcc.gnu.org/ml/gcc/2001-12/msg00178.html>

I took the liberty of removing the restriction about file name
placement since it does not make much sense once -margs is there.

The on-line help has been updated, but not the manual since it is not
in CVS.

I'd like to commit this to the 3.1 branch as well, it will make our
life easier if we want to use gnatmake for the build process in the future.

Tested by bootstraping (with my previous patch) and playing around
with gnatmake.

Ok to commit?

--
Laurent Guerby <guerby@acm.org>

2002-03-31  Laurent Guerby  <guerby@acm.org>

	* make.adb: Implement -margs, remove restriction about file name placement.
	* makeusg.adb: Documentation update.

Index: make.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/make.adb,v
retrieving revision 1.12
diff -c -3 -p -r1.12 make.adb
*** make.adb	2002/03/14 10:59:30	1.12
--- make.adb	2002/03/31 20:42:42
*************** package body Make is
*** 447,460 ****
      --  Set to True after having scanned the file_name for
      --  switch "-o file_name"

-    File_Name_Seen : Boolean := False;
-    --  Set to true after having seen at least one file name.
-    --  Used in Scan_Make_Arg only, but must be a global variable.
-
      type Make_Program_Type is (None, Compiler, Binder, Linker);

      Program_Args : Make_Program_Type := None;
!    --  Used to indicate if we are scanning gcc, gnatbind, or gnatbl
      --  options within the gnatmake command line.
      --  Used in Scan_Make_Arg only, but must be a global variable.

--- 447,456 ----
      --  Set to True after having scanned the file_name for
      --  switch "-o file_name"

      type Make_Program_Type is (None, Compiler, Binder, Linker);

      Program_Args : Make_Program_Type := None;
!    --  Used to indicate if we are scanning gnatmake, gcc, gnatbind, or 
gnatbind
      --  options within the gnatmake command line.
      --  Used in Scan_Make_Arg only, but must be a global variable.

*************** package body Make is
*** 4260,4275 ****
               Argv = "-cargs"
                 or else
               Argv = "-largs"
         then
-          if not File_Name_Seen then
-             Fail ("-cargs, -bargs, -largs ",
-                   "must appear after unit or file name");
-          end if;
-
            case Argv (2) is
               when 'c' => Program_Args := Compiler;
               when 'b' => Program_Args := Binder;
               when 'l' => Program_Args := Linker;

               when others =>
raise Program_Error;
--- 4256,4269 ----
               Argv = "-cargs"
                 or else
               Argv = "-largs"
+               or else
+             Argv = "-margs"
         then
            case Argv (2) is
               when 'c' => Program_Args := Compiler;
               when 'b' => Program_Args := Binder;
               when 'l' => Program_Args := Linker;
+             when 'm' => Program_Args := None;

               when others =>
raise Program_Error;
*************** package body Make is
*** 4674,4680 ****
         --  If not a switch it must be a file name

         else
-          File_Name_Seen := True;
            Add_File (Argv);
         end if;
      end Scan_Make_Arg;
--- 4668,4673 ----
Index: makeusg.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/makeusg.adb,v
retrieving revision 1.4
diff -c -3 -p -r1.4 makeusg.adb
*** makeusg.adb	2002/03/14 10:59:30	1.4
--- makeusg.adb	2002/03/31 20:42:43
*************** begin
*** 39,49 ****
      Write_Str ("Usage: ");
      Osint.Write_Program_Name;
      Write_Str ("  opts  name  ");
!    Write_Str ("{[-cargs opts] [-bargs opts] [-largs opts]}");
      Write_Eol;
      Write_Eol;
!    Write_Str ("  name  is a file name from which you can omit the");
!    Write_Str (" .adb or .ads suffix");
      Write_Eol;
      Write_Eol;

--- 39,49 ----
      Write_Str ("Usage: ");
      Osint.Write_Program_Name;
      Write_Str ("  opts  name  ");
!    Write_Str ("{[-cargs opts] [-bargs opts] [-largs opts] [-margs 
opts]}");
      Write_Eol;
      Write_Eol;
!    Write_Str ("  name is one or more file name from which you");
!    Write_Str (" can omit the .adb or .ads suffix");
      Write_Eol;
      Write_Eol;

*************** begin
*** 251,256 ****
--- 251,261 ----
      --  Line for -largs

      Write_Str ("  -largs opts   opts are passed to the linker");
+    Write_Eol;
+
+    --  Line for -margs
+
+    Write_Str ("  -margs opts   opts are passed to gnatmake");
      Write_Eol;

      --  Add usage information for gcc


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