diff options
Diffstat (limited to 'meta/packages/gcc/gcc-4.3.1/debian/ada-default-project-path.dpatch')
-rw-r--r-- | meta/packages/gcc/gcc-4.3.1/debian/ada-default-project-path.dpatch | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-4.3.1/debian/ada-default-project-path.dpatch b/meta/packages/gcc/gcc-4.3.1/debian/ada-default-project-path.dpatch new file mode 100644 index 0000000000..b3283d75f3 --- /dev/null +++ b/meta/packages/gcc/gcc-4.3.1/debian/ada-default-project-path.dpatch | |||
@@ -0,0 +1,147 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: - Change the default search path for project files to the one specified | ||
4 | # DP: by the Debian Policy for Ada: /usr/share/ada/adainclude. | ||
5 | |||
6 | dir= | ||
7 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
8 | pdir="-d $3" | ||
9 | dir="$3/" | ||
10 | elif [ $# -ne 1 ]; then | ||
11 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
12 | exit 1 | ||
13 | fi | ||
14 | case "$1" in | ||
15 | -patch) | ||
16 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
17 | ;; | ||
18 | -unpatch) | ||
19 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
20 | ;; | ||
21 | *) | ||
22 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
23 | exit 1 | ||
24 | esac | ||
25 | exit 0 | ||
26 | |||
27 | Index: gcc/ada/Make-lang.in | ||
28 | =================================================================== | ||
29 | --- gcc/ada/Make-lang.in.orig | ||
30 | +++ gcc/ada/Make-lang.in | ||
31 | @@ -974,7 +974,7 @@ | ||
32 | $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb | ||
33 | $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb | ||
34 | $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb | ||
35 | - $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb | ||
36 | + $(ECHO) " S4 : constant String := \"/usr/share/ada/adainclude/\";" >>tmp-sdefault.adb | ||
37 | $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb | ||
38 | $(ECHO) " begin" >>tmp-sdefault.adb | ||
39 | $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb | ||
40 | Index: gcc/ada/prj-ext.adb | ||
41 | =================================================================== | ||
42 | --- gcc/ada/prj-ext.adb.orig | ||
43 | +++ gcc/ada/prj-ext.adb | ||
44 | @@ -24,7 +24,6 @@ | ||
45 | ------------------------------------------------------------------------------ | ||
46 | |||
47 | with Hostparm; | ||
48 | -with Makeutl; use Makeutl; | ||
49 | with Output; use Output; | ||
50 | with Osint; use Osint; | ||
51 | with Sdefault; | ||
52 | @@ -254,38 +253,10 @@ | ||
53 | |||
54 | -- Set the initial value of Current_Project_Path | ||
55 | |||
56 | - if Add_Default_Dir then | ||
57 | - declare | ||
58 | - Prefix : String_Ptr := Sdefault.Search_Dir_Prefix; | ||
59 | - begin | ||
60 | - if Prefix = null then | ||
61 | - Prefix := new String'(Executable_Prefix_Path); | ||
62 | - | ||
63 | - if Prefix.all /= "" then | ||
64 | - if Get_Mode = Ada_Only then | ||
65 | - Current_Project_Path := | ||
66 | - new String'(Name_Buffer (1 .. Name_Len) & | ||
67 | - Path_Separator & | ||
68 | - Prefix.all & Directory_Separator & "gnat"); | ||
69 | - | ||
70 | - else | ||
71 | - Current_Project_Path := | ||
72 | - new String'(Name_Buffer (1 .. Name_Len) & | ||
73 | - Path_Separator & | ||
74 | - Prefix.all & Directory_Separator & | ||
75 | - "share" & Directory_Separator & "gpr"); | ||
76 | - end if; | ||
77 | - end if; | ||
78 | - | ||
79 | - else | ||
80 | - Current_Project_Path := | ||
81 | - new String'(Name_Buffer (1 .. Name_Len) & Path_Separator & | ||
82 | - Prefix.all & | ||
83 | - ".." & Directory_Separator & | ||
84 | - ".." & Directory_Separator & | ||
85 | - ".." & Directory_Separator & "gnat"); | ||
86 | - end if; | ||
87 | - end; | ||
88 | + if Add_Default_Dir and Sdefault.Search_Dir_Prefix /= null then | ||
89 | + Current_Project_Path := | ||
90 | + new String'(Name_Buffer (1 .. Name_Len) & Path_Separator & | ||
91 | + Sdefault.Search_Dir_Prefix.all); | ||
92 | end if; | ||
93 | |||
94 | if Current_Project_Path = null then | ||
95 | Index: gcc/ada/gnatls.adb | ||
96 | =================================================================== | ||
97 | --- gcc/ada/gnatls.adb.orig | ||
98 | +++ gcc/ada/gnatls.adb | ||
99 | @@ -1622,9 +1622,6 @@ | ||
100 | declare | ||
101 | Project_Path : String_Access := Getenv (Gpr_Project_Path); | ||
102 | |||
103 | - Lib : constant String := | ||
104 | - Directory_Separator & "lib" & Directory_Separator; | ||
105 | - | ||
106 | First : Natural; | ||
107 | Last : Natural; | ||
108 | |||
109 | @@ -1684,36 +1681,8 @@ | ||
110 | if Add_Default_Dir then | ||
111 | Name_Len := 0; | ||
112 | Add_Str_To_Name_Buffer (Sdefault.Search_Dir_Prefix.all); | ||
113 | - | ||
114 | - -- On Windows, make sure that all directory separators are '\' | ||
115 | - | ||
116 | - if Directory_Separator /= '/' then | ||
117 | - for J in 1 .. Name_Len loop | ||
118 | - if Name_Buffer (J) = '/' then | ||
119 | - Name_Buffer (J) := Directory_Separator; | ||
120 | - end if; | ||
121 | - end loop; | ||
122 | - end if; | ||
123 | - | ||
124 | - -- Find the sequence "/lib/" | ||
125 | - | ||
126 | - while Name_Len >= Lib'Length | ||
127 | - and then Name_Buffer (Name_Len - 4 .. Name_Len) /= Lib | ||
128 | - loop | ||
129 | - Name_Len := Name_Len - 1; | ||
130 | - end loop; | ||
131 | - | ||
132 | - -- If the sequence "/lib"/ was found, display the default | ||
133 | - -- directory <prefix>/lib/gnat/. | ||
134 | - | ||
135 | - if Name_Len >= 5 then | ||
136 | - Name_Buffer (Name_Len + 1 .. Name_Len + 4) := "gnat"; | ||
137 | - Name_Buffer (Name_Len + 5) := Directory_Separator; | ||
138 | - Name_Len := Name_Len + 5; | ||
139 | - Write_Str (" "); | ||
140 | - Write_Line | ||
141 | - (To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all); | ||
142 | - end if; | ||
143 | + Write_Str (" "); | ||
144 | + Write_Line (Name_Buffer (1 .. Name_Len)); | ||
145 | end if; | ||
146 | end; | ||
147 | |||