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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
Description: Allow more directories to be configured.
libsubdir, libexecsubdir, libsubincludedir, fincludedir, and toolexeclibdir are
hardcoded in many makefiles. MULTIOSDIR is hardcoded in gcc/Makefile.in. We
want to change these values.
.
Also, the GCC driver needs to be told to search for compiler programs and
include files in the new user-configured location.
From: "P. J. McDermott" <pjm@nac.net>
diff -Naur src.orig/gcc/gcc.c src/gcc/gcc.c
--- src.orig/gcc/gcc.c 2013-03-08 02:25:09.000000000 -0500
+++ src/gcc/gcc.c 2013-04-25 21:16:04.893780032 -0400
@@ -1130,6 +1130,8 @@
static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+static const char *const user_tooldir_prefix = USER_TOOLDIR_PREFIX;
+
/* For native compilers, these are well-known paths containing
components that may be provided by the system. For cross
compilers, these paths are not used. */
@@ -3688,6 +3690,16 @@
PREFIX_PRIORITY_LAST, 0, 0);
}
+ add_prefix (&exec_prefixes,
+ concat (user_tooldir_prefix, dir_separator_str, NULL),
+ 0, PREFIX_PRIORITY_LAST, 0, 0);
+ add_prefix (&startfile_prefixes,
+ concat (user_tooldir_prefix, dir_separator_str, NULL),
+ 0, PREFIX_PRIORITY_LAST, 0, 0);
+ add_prefix (&include_prefixes,
+ concat (user_tooldir_prefix, dir_separator_str, NULL),
+ 0, PREFIX_PRIORITY_LAST, 0, 0);
+
/* COMPILER_PATH and LIBRARY_PATH have values
that are lists of directory names with colons. */
diff -Naur src.orig/gcc/Makefile.in src/gcc/Makefile.in
--- src.orig/gcc/Makefile.in 2013-04-01 04:11:11.000000000 -0400
+++ src/gcc/Makefile.in 2013-04-25 17:58:17.104382447 -0400
@@ -2097,6 +2097,7 @@
-DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
-DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
-DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
+ -DUSER_TOOLDIR_PREFIX=\"$(libexecsubdir)\" \
@TARGET_SYSTEM_ROOT_DEFINE@ \
$(VALGRIND_DRIVER_DEFINES) \
`test "X$${SHLIB}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
diff -Naur src.orig/libmudflap/Makefile.am src/libmudflap/Makefile.am
--- src.orig/libmudflap/Makefile.am 2009-08-22 09:41:50.000000000 -0400
+++ src/libmudflap/Makefile.am 2013-04-20 15:19:34.500991568 -0400
@@ -81,6 +81,8 @@
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"includedir=$(includedir)" \
+ "libsubincludedir=$(libsubincludedir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
diff -Naur src.orig/libmudflap/Makefile.in src/libmudflap/Makefile.in
--- src.orig/libmudflap/Makefile.in 2010-05-04 14:58:11.000000000 -0400
+++ src/libmudflap/Makefile.in 2013-04-20 15:19:55.517600152 -0400
@@ -324,6 +324,8 @@
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"includedir=$(includedir)" \
+ "libsubincludedir=$(libsubincludedir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
diff -Naur src.orig/libquadmath/Makefile.am src/libquadmath/Makefile.am
--- src.orig/libquadmath/Makefile.am 2011-09-21 10:36:03.000000000 -0400
+++ src/libquadmath/Makefile.am 2013-04-20 15:26:12.908521625 -0400
@@ -96,6 +96,8 @@
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"includedir=$(includedir)" \
+ "libsubincludedir=$(libsubincludedir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
diff -Naur src.orig/libquadmath/Makefile.in src/libquadmath/Makefile.in
--- src.orig/libquadmath/Makefile.in 2011-09-21 10:36:03.000000000 -0400
+++ src/libquadmath/Makefile.in 2013-04-20 15:27:36.898950596 -0400
@@ -374,6 +374,8 @@
@BUILD_LIBQUADMATH_TRUE@ "libdir=$(libdir)" \
@BUILD_LIBQUADMATH_TRUE@ "prefix=$(prefix)" \
@BUILD_LIBQUADMATH_TRUE@ "includedir=$(includedir)" \
+@BUILD_LIBQUADMATH_TRUE@ "libsubincludedir=$(libsubincludedir)" \
+@BUILD_LIBQUADMATH_TRUE@ "toolexeclibdir=$(toolexeclibdir)" \
@BUILD_LIBQUADMATH_TRUE@ "AR=$(AR)" \
@BUILD_LIBQUADMATH_TRUE@ "AS=$(AS)" \
@BUILD_LIBQUADMATH_TRUE@ "CC=$(CC)" \
diff -Naur src.orig/libssp/Makefile.am src/libssp/Makefile.am
--- src.orig/libssp/Makefile.am 2010-12-05 19:50:04.000000000 -0500
+++ src/libssp/Makefile.am 2013-04-20 15:32:51.356039523 -0400
@@ -92,6 +92,8 @@
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"includedir=$(includedir)" \
+ "libsubincludedir=$(libsubincludedir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
diff -Naur src.orig/libssp/Makefile.in src/libssp/Makefile.in
--- src.orig/libssp/Makefile.in 2011-02-13 06:45:53.000000000 -0500
+++ src/libssp/Makefile.in 2013-04-20 15:33:02.536362532 -0400
@@ -312,6 +312,8 @@
"libdir=$(libdir)" \
"prefix=$(prefix)" \
"includedir=$(includedir)" \
+ "libsubincludedir=$(libsubincludedir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
diff -Naur src.orig/libstdc++-v3/Makefile.am src/libstdc++-v3/Makefile.am
--- src.orig/libstdc++-v3/Makefile.am 2012-01-23 18:12:01.000000000 -0500
+++ src/libstdc++-v3/Makefile.am 2013-04-20 15:35:56.177410624 -0400
@@ -163,6 +163,8 @@
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"gxx_include_dir=$(gxx_include_dir)" \
+ "host_installdir=$(host_installdir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
diff -Naur src.orig/libstdc++-v3/Makefile.in src/libstdc++-v3/Makefile.in
--- src.orig/libstdc++-v3/Makefile.in 2012-02-17 15:26:32.000000000 -0500
+++ src/libstdc++-v3/Makefile.in 2013-04-20 15:36:11.077844405 -0400
@@ -362,6 +362,8 @@
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"gxx_include_dir=$(gxx_include_dir)" \
+ "host_installdir=$(host_installdir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
diff -Naur src.orig/Makefile.def src/Makefile.def
--- src.orig/Makefile.def 2013-04-20 14:46:22.918763972 -0400
+++ src/Makefile.def 2013-04-21 10:37:16.013678375 -0400
@@ -199,6 +199,14 @@
flags_to_pass = { flag= tooldir ; };
flags_to_pass = { flag= build_tooldir ; };
flags_to_pass = { flag= target_alias ; };
+flags_to_pass = { flag= libsubdir ; };
+flags_to_pass = { flag= libexecsubdir ; };
+flags_to_pass = { flag= gxx_include_dir ; };
+flags_to_pass = { flag= host_installdir ; };
+flags_to_pass = { flag= libsubincludedir ; };
+flags_to_pass = { flag= fincludedir ; };
+flags_to_pass = { flag= toolexeclibdir ; };
+flags_to_pass = { flag= MULTIOSDIR ; };
// Build tools
flags_to_pass = { flag= AWK ; };
diff -Naur src.orig/Makefile.in src/Makefile.in
--- src.orig/Makefile.in 2012-08-06 10:34:27.000000000 -0400
+++ src/Makefile.in 2013-04-21 10:33:31.899390474 -0400
@@ -721,6 +721,14 @@
"tooldir=$(tooldir)" \
"build_tooldir=$(build_tooldir)" \
"target_alias=$(target_alias)" \
+ "libsubdir=$(libsubdir)" \
+ "libexecsubdir=$(libexecsubdir)" \
+ "gxx_include_dir=$(gxx_include_dir)" \
+ "host_installdir=$(host_installdir)" \
+ "libsubincludedir=$(libsubincludedir)" \
+ "fincludedir=$(fincludedir)" \
+ "toolexeclibdir=$(toolexeclibdir)" \
+ "MULTIOSDIR=$(MULTIOSDIR)" \
"AWK=$(AWK)" \
"BISON=$(BISON)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|