aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-ext.adb
diff options
context:
space:
mode:
authorEmmanuel Briot <briot@adacore.com>2009-07-13 10:45:14 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-07-13 12:45:14 +0200
commit7bccff2426b3ed3c0400cf6610c61198779f797c (patch)
treef36850a6b47b83f1fbdba5bbb834d88e131763f5 /gcc/ada/prj-ext.adb
parent5a64837c6b14f97b066772abc1463aa8f2c962d5 (diff)
downloadgcc-7bccff2426b3ed3c0400cf6610c61198779f797c.zip
gcc-7bccff2426b3ed3c0400cf6610c61198779f797c.tar.gz
gcc-7bccff2426b3ed3c0400cf6610c61198779f797c.tar.bz2
gnatcmd.adb, [...] (Prj.Tree.Create*): New subprograms to create new packages and attributes in a project tree.
2009-07-13 Emmanuel Briot <briot@adacore.com> * gnatcmd.adb, prj-proc.adb, make.adb, mlib-prj.adb, prj-ext.adb, gnat_ugn.texi, prj.adb, prj.ads, clean.adb, prj-nmsc.adb, prj-util.adb, prj-conf.adb, gnatname.adb, prj-env.adb, prj-env.ads, prj-tree.adb, prj-tree.ads (Prj.Tree.Create*): New subprograms to create new packages and attributes in a project tree. (Add_Default_GNAT_Naming_Scheme): Provide real implementation. Remove last remaining mode-specific code (ada_only or multi_language). This was duplicating code (Get_Mode, Set_Mode): removed, no longer used. (Initialize_Project_Path): all tools will now take into account both GPR_PROJECT_PATH and ADA_PROJECT_PATH (in that order). Remove some global variables and subprograms no longer used Make temporary files tree-specific, to avoid interferences between trees loaded in memory at the same time. (Prj.Delete_Temporary_File): new subprogram (Object_Paths, Source_Paths): fields no longer stored in the project tree, since they are only needed locally in Set_Ada_Paths. (Set_Mapping_File_Initial_State_To_Empty): removed, since had no effect in practice. (Project_Tree_Data.Ada_Path_Buffer): removed, since it can be replaced by local variables in the appropriate subprograms (Has_Foreign_Sources): removed. * gcc-interface/Makefile.in: prj-pp.o is now needed to build gnatmake From-SVN: r149568
Diffstat (limited to 'gcc/ada/prj-ext.adb')
-rw-r--r--gcc/ada/prj-ext.adb34
1 files changed, 10 insertions, 24 deletions
diff --git a/gcc/ada/prj-ext.adb b/gcc/ada/prj-ext.adb
index 37c6296..853542e 100644
--- a/gcc/ada/prj-ext.adb
+++ b/gcc/ada/prj-ext.adb
@@ -25,7 +25,6 @@
with Hostparm;
with Makeutl; use Makeutl;
-with Output; use Output;
with Osint; use Osint;
with Sdefault;
with Table;
@@ -139,23 +138,8 @@ package body Prj.Ext is
Last : Positive;
New_Len : Positive;
New_Last : Positive;
- Prj_Path : String_Access := Gpr_Prj_Path;
begin
- if Gpr_Prj_Path.all /= "" then
-
- -- In Ada only mode, warn if both environment variables are defined
-
- if Get_Mode = Ada_Only and then Ada_Prj_Path.all /= "" then
- Write_Line
- ("Warning: ADA_PROJECT_PATH is not taken into account");
- Write_Line (" when GPR_PROJECT_PATH is defined");
- end if;
-
- else
- Prj_Path := Ada_Prj_Path;
- end if;
-
-- The current directory is always first
Name_Len := 1;
@@ -172,11 +156,16 @@ package body Prj.Ext is
-- If environment variable is defined and not empty, add its content
- if Prj_Path.all /= "" then
+ if Gpr_Prj_Path.all /= "" then
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := Path_Separator;
+ Add_Str_To_Name_Buffer (Gpr_Prj_Path.all);
+ end if;
- Add_Str_To_Name_Buffer (Prj_Path.all);
+ if Ada_Prj_Path.all /= "" then
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := Path_Separator;
+ Add_Str_To_Name_Buffer (Ada_Prj_Path.all);
end if;
-- Scan the directory path to see if "-" is one of the directories.
@@ -260,12 +249,9 @@ package body Prj.Ext is
Prefix := new String'(Executable_Prefix_Path);
if Prefix.all /= "" then
- if Get_Mode = Multi_Language then
- Add_Str_To_Name_Buffer
- (Path_Separator & Prefix.all &
- "share" & Directory_Separator & "gpr");
- end if;
-
+ Add_Str_To_Name_Buffer
+ (Path_Separator & Prefix.all &
+ "share" & Directory_Separator & "gpr");
Add_Str_To_Name_Buffer
(Path_Separator & Prefix.all &
Directory_Separator & "lib" &