prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt to find a configurati...
authorVincent Celier <celier@adacore.com>
Thu, 23 Jan 2014 16:52:00 +0000 (16:52 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 23 Jan 2014 16:52:00 +0000 (17:52 +0100)
2014-01-23  Vincent Celier  <celier@adacore.com>

* prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt
to find a configuration project file when Config_File_Name is
No_Configuration_File.
* prj-conf.ads (No_Configuration_File): New constant String.
* prj-pars.adb (Parse): Call Get_Or_Create_Configuration_File
with Config_File_Name set to No_Configuration_File, so that
no existing configuration project file will be used, and the
configuration project will be only created in memory when
Add_Default_GNAT_Naming_Scheme is called.
* projects.texi: Minor reformatting.

From-SVN: r206985

gcc/ada/ChangeLog
gcc/ada/prj-conf.adb
gcc/ada/prj-conf.ads
gcc/ada/prj-pars.adb
gcc/ada/projects.texi

index 5bf50ad1edd70078011f7a165f78a1651a87ded3..556cc9d159c2a56a9ae43a9c84e4dc240e581846 100644 (file)
@@ -1,3 +1,16 @@
+2014-01-23  Vincent Celier  <celier@adacore.com>
+
+       * prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt
+       to find a configuration project file when Config_File_Name is
+       No_Configuration_File.
+       * prj-conf.ads (No_Configuration_File): New constant String.
+       * prj-pars.adb (Parse): Call Get_Or_Create_Configuration_File
+       with Config_File_Name set to No_Configuration_File, so that
+       no existing configuration project file will be used, and the
+       configuration project will be only created in memory when
+       Add_Default_GNAT_Naming_Scheme is called.
+       * projects.texi: Minor reformatting.
+
 2014-01-23  Vincent Celier  <celier@adacore.com>
 
        * prj-conf.adb (Get_Or_Create_Configuration_File): Never parse
index de4e980ffa7eac5c175073be7c653ea9f9a2206a..dc569627b887aeaf3ded5756809849eb30df6ebc 100644 (file)
@@ -1372,19 +1372,27 @@ package body Prj.Conf is
       Get_Project_Target;
       Check_Builder_Switches;
 
-      if Conf_File_Name'Length > 0 then
-         Config_File_Path := Locate_Config_File (Conf_File_Name.all);
+      --  Do not attempt to find a configuration project file when
+      --  Config_File_Name is No_Configuration_File.
+
+      if Config_File_Name = No_Configuration_File then
+         Config_File_Path := null;
+
       else
-         Config_File_Path := Locate_Config_File (Default_File_Name);
-      end if;
+         if Conf_File_Name'Length > 0 then
+            Config_File_Path := Locate_Config_File (Conf_File_Name.all);
+         else
+            Config_File_Path := Locate_Config_File (Default_File_Name);
+         end if;
 
-      if Config_File_Path = null then
-         if not Allow_Automatic_Generation
-           and then Conf_File_Name'Length > 0
-         then
-            Raise_Invalid_Config
-              ("could not locate main configuration project "
-               & Conf_File_Name.all);
+         if Config_File_Path = null then
+            if not Allow_Automatic_Generation
+              and then Conf_File_Name'Length > 0
+            then
+               Raise_Invalid_Config
+                 ("could not locate main configuration project "
+                  & Conf_File_Name.all);
+            end if;
          end if;
       end if;
 
@@ -1415,22 +1423,18 @@ package body Prj.Conf is
         and then On_Load_Config = null
       then
          Write_Line
-           ("warning: --RTS is taken into account only in auto-configuration");
+           ("warning: " &
+              "--RTS is taken into account only in auto-configuration");
       end if;
 
       --  Parse the configuration file
 
-      if Verbose_Mode
-        and then Config_File_Path /= null
-        and then On_Load_Config = null
-      then
+      if Verbose_Mode and then Config_File_Path /= null then
          Write_Str  ("Checking configuration ");
          Write_Line (Config_File_Path.all);
       end if;
 
-      --  Add comment for On_Load_Config test ???
-
-      if Config_File_Path /= null and then On_Load_Config = null then
+      if Config_File_Path /= null then
          Prj.Part.Parse
            (In_Tree           => Project_Node_Tree,
             Project           => Config_Project_Node,
index 1c72fa769baf3137062e46d89c569b94f2191120..467d9741e03c47c2338273d0d391eec24b5f9e3a 100644 (file)
@@ -40,6 +40,12 @@ package Prj.Conf is
    --  is set to Empty_Node when this procedure is called. You can then decide
    --  to create a new config file if you need.
 
+   No_Configuration_File : constant String := "/";
+   --  When specified as a parameter Config_File_Name in the procedures below,
+   --  no existing configuration project file is parsed. This is used by
+   --  gnatmake, gnatclean and the GNAT driver to avoid parsing an existing
+   --  default configuration project file.
+
    procedure Parse_Project_And_Apply_Config
      (Main_Project               : out Prj.Project_Id;
       User_Project_Node          : out Prj.Tree.Project_Node_Id;
@@ -68,6 +74,10 @@ package Prj.Conf is
    --  happened while parsing the project itself (i.e. creating the tree),
    --  User_Project_Node is also set to Empty_Node.
    --
+   --  If Config_File_Name is No_Configuration_File, then no configuration
+   --  project file is parsed. Normally, in this case On_Load_Config is not
+   --  null, and it is used to create a configuration project file in memory.
+   --
    --  Autoconf_Specified indicates whether the user has specified --autoconf.
    --  If this is the case, the config file might be (re)generated, as
    --  appropriate, to match languages and target if the one specified doesn't
index a0d083488cf3b795b70b1dcda3d767b3530bd954..7fbce49fa9affa2198426b895b90320cd3712760 100644 (file)
@@ -86,7 +86,7 @@ package body Prj.Pars is
             Process_Project_And_Apply_Config
               (Main_Project               => The_Project,
                User_Project_Node          => Project_Node,
-               Config_File_Name           => "",
+               Config_File_Name           => No_Configuration_File,
                Autoconf_Specified         => False,
                Project_Tree               => In_Tree,
                Project_Node_Tree          => Project_Node_Tree,
index 8253477fce4f633f5926efba1351393dd10b65c6..0236ba2dc3a2fa0637ba5c39a9a2a1031d5d3362 100644 (file)
@@ -4384,11 +4384,11 @@ Index is a language name. Indicates the kind of the language, either file based
 or unit based. Only authorized case-insensitive values are "unit_based" and
 "file_based" (the default).
 
-@item @b{Dependency_Kind}: single, indexed, case-insensitive index
+@item @b{Dependency_Kind}: single, indexed, case-insensitive index
 
 Index is a language name. Indicates how the dependencies are handled for the
 language. Only authorized case-insensitive values are "makefile", "ali_file",
-"ali_closure" or "none" (the default.
+"ali_closure" or "none" (the default).
 
 @item @b{Required_Switches}: list, indexed, case-insensitive index