diff options
author | Vincent Celier <celier@adacore.com> | 2007-12-13 11:27:32 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-12-13 11:27:32 +0100 |
commit | 422ba273d4ee724caa04eb7e1e9c198b4aeb3e1a (patch) | |
tree | eae6ad878ebfbd069d4431d465220d08a6a19261 /gcc/ada/gnatcmd.adb | |
parent | 7b76e80551f4445f2557d9f20bc29f06adb7b4e1 (diff) | |
download | gcc-422ba273d4ee724caa04eb7e1e9c198b4aeb3e1a.tar.gz |
gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when object directory of main project...
2007-12-06 Vincent Celier <celier@adacore.com>
* gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when
object directory of main project does not exist.
On VMS, correctly set then environment variable for the source
directories.
From-SVN: r130841
Diffstat (limited to 'gcc/ada/gnatcmd.adb')
-rw-r--r-- | gcc/ada/gnatcmd.adb | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index debf0c32d5c..c664338ae87 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -2228,10 +2228,14 @@ begin -- For gnatmetric, the generated files should be put in the object -- directory. This must be the first switch, because it may be - -- overriden by a switch in package Metrics in the project file or by - -- a command line option. + -- overriden by a switch in package Metrics in the project file or + -- by a command line option. Note that we don't add the -d= switch + -- if there is no object directory available. - if The_Command = Metric then + if The_Command = Metric + and then + Project_Tree.Projects.Table (Project).Object_Directory /= No_Path + then First_Switches.Increment_Last; First_Switches.Table (2 .. First_Switches.Last) := First_Switches.Table (1 .. First_Switches.Last - 1); @@ -2297,15 +2301,18 @@ begin if ASIS_Main /= null then Get_Closure; - -- On VMS, set up again the env var for source dirs file. This is + -- On VMS, set up the env var again for source dirs file. This is -- because the call to gnatmake has set this env var to another -- file that has now been deleted. if Hostparm.OpenVMS then - Setenv - (Project_Include_Path_File, - Prj.Env.Ada_Include_Path - (Project, Project_Tree, Recursive => True)); + + -- First make sure that the recorded file names are empty + + Prj.Env.Initialize; + + Prj.Env.Set_Ada_Paths + (Project, Project_Tree, Including_Libraries => False); end if; -- For gnat check, gnat pretty, gnat metric, gnat list, and gnat @@ -2313,10 +2320,10 @@ begin -- with all the sources of the main project. elsif The_Command = Check or else - The_Command = Pretty or else - The_Command = Metric or else - The_Command = List or else - The_Command = Stack + The_Command = Pretty or else + The_Command = Metric or else + The_Command = List or else + The_Command = Stack then Check_Files; end if; |