summaryrefslogtreecommitdiff
path: root/gcc/ada/gnatcmd.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-29 12:37:05 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-29 12:37:05 +0000
commit12cb78d1cca1387a092ec0bd49c250340bff4afc (patch)
tree1eab97da96906e0a2786d51d9f25f20de02befcf /gcc/ada/gnatcmd.adb
parent31879e18aea3222fe3e56f2c0319c9f230645ff3 (diff)
downloadgcc-12cb78d1cca1387a092ec0bd49c250340bff4afc.tar.gz
2012-08-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 190745 using svnmerge, notably C++ conversion. [gcc/] 2012-08-29 Basile Starynkevitch <basile@starynkevitch.net> {{merging with trunk, converted to C++}} * melt-runtime.h (MELT_FLEXIBLE_DIM): Set when C++. * melt-runtime.c (melt_tempdir_path): Don't use choose_tmpdir from libiberty. (meltgc_start_module_by_index): Use address-of & on VEC_index. (melt_really_initialize): When printing builtin settings, handle GCC 4.8 as with implicit ENABLE_BUILD_WITH_CXX. (meltgc_out_edge): Provide additional flag TDF_DETAILS for dump_edge_info. (melt_val2passflag): Handle PROP_referenced_vars only when defined. * melt-module.mk: Use GCCMELT_COMPILER instead of GCCMELT_CC. * melt-build-script.tpl: Transmit GCCMELT_COMPILER on every make using melt-module.mk and improve the error message. * melt-build-script.sh: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@190778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gnatcmd.adb')
-rw-r--r--gcc/ada/gnatcmd.adb176
1 files changed, 87 insertions, 89 deletions
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb
index 87983997a7a..82e3f4593b4 100644
--- a/gcc/ada/gnatcmd.adb
+++ b/gcc/ada/gnatcmd.adb
@@ -238,12 +238,7 @@ procedure GNATCmd is
function Configuration_Pragmas_File return Path_Name_Type;
-- Return an argument, if there is a configuration pragmas file to be
- -- specified for Project, otherwise return No_Name. Used for gnatstub (GNAT
- -- STUB), gnatpp (GNAT PRETTY), gnatelim (GNAT ELIM), and gnatmetric (GNAT
- -- METRIC).
-
- function Mapping_File return Path_Name_Type;
- -- Create and return the path name of a mapping file. Used for gnatstub
+ -- specified for Project, otherwise return No_Name. Used for gnatstub
-- (GNAT STUB), gnatpp (GNAT PRETTY), gnatelim (GNAT ELIM), and gnatmetric
-- (GNAT METRIC).
@@ -251,10 +246,22 @@ procedure GNATCmd is
-- Delete all temporary config files. The caller is responsible for
-- ensuring that Keep_Temporary_Files is False.
+ procedure Ensure_Absolute_Path
+ (Switch : in out String_Access;
+ Parent : String);
+ -- Test if Switch is a relative search path switch. If it is and it
+ -- includes directory information, prepend the path with Parent. This
+ -- subprogram is only called when using project files.
+
procedure Get_Closure;
-- Get the sources in the closure of the ASIS_Main and add them to the
-- list of arguments.
+ function Mapping_File return Path_Name_Type;
+ -- Create and return the path name of a mapping file. Used for gnatstub
+ -- (GNAT STUB), gnatpp (GNAT PRETTY), gnatelim (GNAT ELIM), and gnatmetric
+ -- (GNAT METRIC).
+
procedure Non_VMS_Usage;
-- Display usage for platforms other than VMS
@@ -268,17 +275,9 @@ procedure GNATCmd is
-- If Project is a library project, add the correct -L and -l switches to
-- the linker invocation.
- procedure Set_Libraries is
- new For_Every_Project_Imported (Boolean, Set_Library_For);
- -- Add the -L and -l switches to the linker for all of the library
- -- projects.
-
- procedure Test_If_Relative_Path
- (Switch : in out String_Access;
- Parent : String);
- -- Test if Switch is a relative search path switch. If it is and it
- -- includes directory information, prepend the path with Parent. This
- -- subprogram is only called when using project files.
+ procedure Set_Libraries is new
+ For_Every_Project_Imported (Boolean, Set_Library_For);
+ -- Add the -L and -l switches to the linker for all the library projects
--------------------------
-- Add_To_Carg_Switches --
@@ -789,6 +788,22 @@ procedure GNATCmd is
end if;
end Delete_Temp_Config_Files;
+ ---------------------------
+ -- Ensure_Absolute_Path --
+ ---------------------------
+
+ procedure Ensure_Absolute_Path
+ (Switch : in out String_Access;
+ Parent : String)
+ is
+ begin
+ Makeutl.Ensure_Absolute_Path
+ (Switch, Parent,
+ Do_Fail => Osint.Fail'Access,
+ Including_Non_Switch => False,
+ Including_RTS => True);
+ end Ensure_Absolute_Path;
+
-----------------
-- Get_Closure --
-----------------
@@ -962,6 +977,59 @@ procedure GNATCmd is
return Result;
end Mapping_File;
+ -------------------
+ -- Non_VMS_Usage --
+ -------------------
+
+ procedure Non_VMS_Usage is
+ begin
+ Output_Version;
+ New_Line;
+ Put_Line ("List of available commands");
+ New_Line;
+
+ for C in Command_List'Range loop
+
+ -- No usage for VMS only command or for Sync
+
+ if not Command_List (C).VMS_Only and then C /= Sync then
+ if Targparm.AAMP_On_Target then
+ Put ("gnaampcmd ");
+ else
+ Put ("gnat ");
+ end if;
+
+ Put (To_Lower (Command_List (C).Cname.all));
+ Set_Col (25);
+
+ -- Never call gnatstack with a prefix
+
+ if C = Stack then
+ Put (Command_List (C).Unixcmd.all);
+ else
+ Put (Program_Name (Command_List (C).Unixcmd.all, "gnat").all);
+ end if;
+
+ declare
+ Sws : Argument_List_Access renames Command_List (C).Unixsws;
+ begin
+ if Sws /= null then
+ for J in Sws'Range loop
+ Put (' ');
+ Put (Sws (J).all);
+ end loop;
+ end if;
+ end;
+
+ New_Line;
+ end if;
+ end loop;
+
+ New_Line;
+ Put_Line ("All commands except chop, krunch and preprocess " &
+ "accept project file switches -vPx, -Pprj and -Xnam=val");
+ New_Line;
+ end Non_VMS_Usage;
------------------
-- Process_Link --
------------------
@@ -1302,76 +1370,6 @@ procedure GNATCmd is
end if;
end Set_Library_For;
- ---------------------------
- -- Test_If_Relative_Path --
- ---------------------------
-
- procedure Test_If_Relative_Path
- (Switch : in out String_Access;
- Parent : String)
- is
- begin
- Makeutl.Test_If_Relative_Path
- (Switch, Parent,
- Do_Fail => Osint.Fail'Access,
- Including_Non_Switch => False,
- Including_RTS => True);
- end Test_If_Relative_Path;
-
- -------------------
- -- Non_VMS_Usage --
- -------------------
-
- procedure Non_VMS_Usage is
- begin
- Output_Version;
- New_Line;
- Put_Line ("List of available commands");
- New_Line;
-
- for C in Command_List'Range loop
-
- -- No usage for VMS only command or for Sync
-
- if not Command_List (C).VMS_Only and then C /= Sync then
- if Targparm.AAMP_On_Target then
- Put ("gnaampcmd ");
- else
- Put ("gnat ");
- end if;
-
- Put (To_Lower (Command_List (C).Cname.all));
- Set_Col (25);
-
- -- Never call gnatstack with a prefix
-
- if C = Stack then
- Put (Command_List (C).Unixcmd.all);
- else
- Put (Program_Name (Command_List (C).Unixcmd.all, "gnat").all);
- end if;
-
- declare
- Sws : Argument_List_Access renames Command_List (C).Unixsws;
- begin
- if Sws /= null then
- for J in Sws'Range loop
- Put (' ');
- Put (Sws (J).all);
- end loop;
- end if;
- end;
-
- New_Line;
- end if;
- end loop;
-
- New_Line;
- Put_Line ("All commands except chop, krunch and preprocess " &
- "accept project file switches -vPx, -Pprj and -Xnam=val");
- New_Line;
- end Non_VMS_Usage;
-
-- Start of processing for GNATCmd
begin
@@ -2387,7 +2385,7 @@ begin
-- arguments.
for J in 1 .. Last_Switches.Last loop
- GNATCmd.Test_If_Relative_Path
+ GNATCmd.Ensure_Absolute_Path
(Last_Switches.Table (J), Current_Work_Dir);
end loop;
@@ -2397,7 +2395,7 @@ begin
Project_Dir : constant String := Name_Buffer (1 .. Name_Len);
begin
for J in 1 .. First_Switches.Last loop
- GNATCmd.Test_If_Relative_Path
+ GNATCmd.Ensure_Absolute_Path
(First_Switches.Table (J), Project_Dir);
end loop;
end;