From: Vincent Celier Date: Thu, 13 Dec 2007 10:27:32 +0000 (+0100) Subject: gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when object directory... X-Git-Tag: releases/gcc-4.3.0~1055 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=422ba273d4ee724caa04eb7e1e9c198b4aeb3e1a;p=thirdparty%2Fgcc.git gnatcmd.adb (GNATCmd): Do not issue -d= switch to gnatmetric when object directory of main project... 2007-12-06 Vincent Celier * 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 --- diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index debf0c32d5c1..c664338ae870 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;