aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2014-01-23 16:52:00 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-23 17:52:00 +0100
commitcc55f9bee5f0fc2f705ee27fd95c1339185b077a (patch)
tree24c325e6db8e4bf942e361bc87eb190c7bb74045 /gcc
parent225a0c5c56d59d37dc06f98e8388a21c9bc6d02f (diff)
downloadgcc-cc55f9bee5f0fc2f705ee27fd95c1339185b077a.zip
gcc-cc55f9bee5f0fc2f705ee27fd95c1339185b077a.tar.gz
gcc-cc55f9bee5f0fc2f705ee27fd95c1339185b077a.tar.bz2
prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt to find a configuration project file when...
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog13
-rw-r--r--gcc/ada/prj-conf.adb42
-rw-r--r--gcc/ada/prj-conf.ads10
-rw-r--r--gcc/ada/prj-pars.adb2
-rw-r--r--gcc/ada/projects.texi4
5 files changed, 49 insertions, 22 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5bf50ad..556cc9d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,18 @@
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
a config project file if On_Load_Config is not null.
* prj-pars.adb: Minor comment changes.
diff --git a/gcc/ada/prj-conf.adb b/gcc/ada/prj-conf.adb
index de4e980..dc569627 100644
--- a/gcc/ada/prj-conf.adb
+++ b/gcc/ada/prj-conf.adb
@@ -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,
diff --git a/gcc/ada/prj-conf.ads b/gcc/ada/prj-conf.ads
index 1c72fa7..467d974 100644
--- a/gcc/ada/prj-conf.ads
+++ b/gcc/ada/prj-conf.ads
@@ -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
diff --git a/gcc/ada/prj-pars.adb b/gcc/ada/prj-pars.adb
index a0d0834..7fbce49 100644
--- a/gcc/ada/prj-pars.adb
+++ b/gcc/ada/prj-pars.adb
@@ -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,
diff --git a/gcc/ada/projects.texi b/gcc/ada/projects.texi
index 8253477..0236ba2 100644
--- a/gcc/ada/projects.texi
+++ b/gcc/ada/projects.texi
@@ -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