/usr/src/gcc-4.9/debian/patches/ada-default-project-path.diff is in gcc-4.9-source 4.9.3-13ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | # DP: - Change the default search path for project files to the one specified
# DP: by the Debian Policy for Ada: /usr/share/ada/adainclude.
Index: b/src/gcc/ada/Make-generated.in
===================================================================
--- a/src/gcc/ada/Make-generated.in
+++ b/src/gcc/ada/Make-generated.in
@@ -118,6 +118,7 @@
$(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
$(ECHO) " S3 : constant String := \"$(target_noncanonical)/\";" >>tmp-sdefault.adb
$(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S5 : constant String := \"/usr/share/ada/adainclude/\";" >>tmp-sdefault.adb
$(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
$(ECHO) " begin" >>tmp-sdefault.adb
$(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
@@ -134,6 +135,10 @@
$(ECHO) " begin" >>tmp-sdefault.adb
$(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb
$(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb
+ $(ECHO) " function Project_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb
+ $(ECHO) " begin" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S5);" >>tmp-sdefault.adb
+ $(ECHO) " end Project_Dir_Prefix;" >>tmp-sdefault.adb
$(ECHO) "end Sdefault;" >> tmp-sdefault.adb
$(MOVE_IF_CHANGE) tmp-sdefault.adb $(ADA_GEN_SUBDIR)/sdefault.adb
touch $(ADA_GEN_SUBDIR)/stamp-sdefault
Index: b/src/gcc/ada/prj-env.adb
===================================================================
--- a/src/gcc/ada/prj-env.adb
+++ b/src/gcc/ada/prj-env.adb
@@ -25,7 +25,6 @@
with Fmap;
with Hostparm;
-with Makeutl; use Makeutl;
with Opt;
with Osint; use Osint;
with Output; use Output;
@@ -1905,6 +1904,7 @@
(Self : in out Project_Search_Path;
Target_Name : String)
is
+ pragma Unreferenced (Target_Name);
Add_Default_Dir : Boolean := True;
First : Positive;
Last : Positive;
@@ -2084,74 +2084,9 @@
-- Set the initial value of Current_Project_Path
- if Add_Default_Dir then
- declare
- Prefix : String_Ptr;
-
- begin
- if Sdefault.Search_Dir_Prefix = null then
-
- -- gprbuild case
-
- Prefix := new String'(Executable_Prefix_Path);
-
- else
- Prefix := new String'(Sdefault.Search_Dir_Prefix.all
- & ".." & Dir_Separator
- & ".." & Dir_Separator
- & ".." & Dir_Separator
- & ".." & Dir_Separator);
- end if;
-
- if Prefix.all /= "" then
- if Target_Name /= "" then
-
- -- $prefix/$target/lib/gnat
-
- Add_Str_To_Name_Buffer
- (Path_Separator & Prefix.all & Target_Name);
-
- -- Note: Target_Name has a trailing / when it comes from
- -- Sdefault.
-
- if Name_Buffer (Name_Len) /= '/' then
- Add_Char_To_Name_Buffer (Directory_Separator);
- end if;
-
- Add_Str_To_Name_Buffer
- ("lib" & Directory_Separator & "gnat");
-
- -- $prefix/$target/share/gpr
-
- Add_Str_To_Name_Buffer
- (Path_Separator & Prefix.all & Target_Name);
-
- -- Note: Target_Name has a trailing / when it comes from
- -- Sdefault.
-
- if Name_Buffer (Name_Len) /= '/' then
- Add_Char_To_Name_Buffer (Directory_Separator);
- end if;
-
- Add_Str_To_Name_Buffer
- ("share" & Directory_Separator & "gpr");
- end if;
-
- -- $prefix/share/gpr
-
- Add_Str_To_Name_Buffer
- (Path_Separator & Prefix.all &
- "share" & Directory_Separator & "gpr");
-
- -- $prefix/lib/gnat
-
- Add_Str_To_Name_Buffer
- (Path_Separator & Prefix.all &
- "lib" & Directory_Separator & "gnat");
- end if;
-
- Free (Prefix);
- end;
+ if Add_Default_Dir and Sdefault.Project_Dir_Prefix /= null then
+ Add_Str_To_Name_Buffer (Path_Separator
+ & Sdefault.Project_Dir_Prefix.all);
end if;
Self.Path := new String'(Name_Buffer (1 .. Name_Len));
Index: b/src/gcc/ada/sdefault.ads
===================================================================
--- a/src/gcc/ada/sdefault.ads
+++ b/src/gcc/ada/sdefault.ads
@@ -35,4 +35,5 @@
function Object_Dir_Default_Name return String_Ptr;
function Target_Name return String_Ptr;
function Search_Dir_Prefix return String_Ptr;
+ function Project_Dir_Prefix return String_Ptr;
end Sdefault;
|