summaryrefslogtreecommitdiff
path: root/debian/patches/ada-default-project-path.diff
blob: cc9abfe26831c50c2112af155945d3ef1f2949b0 (plain)
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
# DP: - Change the default search path for project files to the one specified
# DP:   by the Debian Policy for Ada: /usr/share/ada/adainclude.

--- a/src/gcc/ada/Make-generated.in
+++ b/src/gcc/ada/Make-generated.in
@@ -104,7 +104,7 @@
 	$(ECHO) "   S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
 	$(ECHO) "   S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
 	$(ECHO) "   S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb
-	$(ECHO) "   S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
+	$(ECHO) "   S4 : 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
--- a/src/gcc/ada/prj-env.adb
+++ b/src/gcc/ada/prj-env.adb
@@ -1923,41 +1923,10 @@
 
       --  Set the initial value of Current_Project_Path
 
-      if Add_Default_Dir then
-         declare
-            Prefix : String_Ptr := Sdefault.Search_Dir_Prefix;
-
-         begin
-            if Prefix = null then
-               Prefix := new String'(Executable_Prefix_Path);
-
-               if Prefix.all /= "" then
-                  if Target_Name /= "" then
-                     Add_Str_To_Name_Buffer
-                       (Path_Separator & Prefix.all &
-                        "lib" & Directory_Separator & "gpr" &
-                        Directory_Separator & Target_Name);
-                  end if;
-
-                  Add_Str_To_Name_Buffer
-                    (Path_Separator & Prefix.all &
-                     "share" & Directory_Separator & "gpr");
-                  Add_Str_To_Name_Buffer
-                    (Path_Separator & Prefix.all &
-                     "lib" & Directory_Separator & "gnat");
-               end if;
-
-            else
-               Self.Path :=
-                 new String'(Name_Buffer (1 .. Name_Len) & Path_Separator &
-                             Prefix.all &
-                             ".." &  Directory_Separator &
-                             ".." & Directory_Separator &
-                             ".." & Directory_Separator & "gnat");
-            end if;
-
-            Free (Prefix);
-         end;
+      if Add_Default_Dir and Sdefault.Search_Dir_Prefix /= null then
+         Self.Path :=
+           new String'(Name_Buffer (1 .. Name_Len) & Path_Separator &
+                         Sdefault.Search_Dir_Prefix.all);
       end if;
 
       if Self.Path = null then
--- a/src/gcc/ada/gnatls.adb
+++ b/src/gcc/ada/gnatls.adb
@@ -1617,9 +1617,6 @@
       declare
          Project_Path : String_Access := Getenv (Gpr_Project_Path);
 
-         Lib : constant String :=
-                 Directory_Separator & "lib" & Directory_Separator;
-
          First : Natural;
          Last  : Natural;
 
@@ -1679,36 +1676,8 @@
          if Add_Default_Dir then
             Name_Len := 0;
             Add_Str_To_Name_Buffer (Sdefault.Search_Dir_Prefix.all);
-
-            --  On Windows, make sure that all directory separators are '\'
-
-            if Directory_Separator /= '/' then
-               for J in 1 .. Name_Len loop
-                  if Name_Buffer (J) = '/' then
-                     Name_Buffer (J) := Directory_Separator;
-                  end if;
-               end loop;
-            end if;
-
-            --  Find the sequence "/lib/"
-
-            while Name_Len >= Lib'Length
-              and then Name_Buffer (Name_Len - 4 .. Name_Len) /= Lib
-            loop
-               Name_Len := Name_Len - 1;
-            end loop;
-
-            --  If the sequence "/lib"/ was found, display the default
-            --  directory <prefix>/lib/gnat/.
-
-            if Name_Len >= 5 then
-               Name_Buffer (Name_Len + 1 .. Name_Len + 4) := "gnat";
-               Name_Buffer (Name_Len + 5) := Directory_Separator;
-               Name_Len := Name_Len + 5;
-               Write_Str ("   ");
-               Write_Line
-                 (To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all);
-            end if;
+            Write_Str ("   ");
+            Write_Line (Name_Buffer (1 .. Name_Len));
          end if;
       end;