1 |
vapier 10/07/05 22:25:09 |
2 |
|
3 |
Modified: toolchain.eclass |
4 |
Log: |
5 |
drop old eselect compiler logic |
6 |
|
7 |
Revision Changes Path |
8 |
1.434 eclass/toolchain.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?rev=1.434&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?rev=1.434&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.433&r2=1.434 |
13 |
|
14 |
Index: toolchain.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v |
17 |
retrieving revision 1.433 |
18 |
retrieving revision 1.434 |
19 |
diff -u -r1.433 -r1.434 |
20 |
--- toolchain.eclass 5 Jul 2010 22:22:20 -0000 1.433 |
21 |
+++ toolchain.eclass 5 Jul 2010 22:25:09 -0000 1.434 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2008 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.433 2010/07/05 22:22:20 vapier Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.434 2010/07/05 22:25:09 vapier Exp $ |
27 |
# |
28 |
# Maintainer: Toolchain Ninjas <toolchain@g.o> |
29 |
|
30 |
@@ -772,111 +772,6 @@ |
31 |
doins "${WORKDIR}"/specs/specs || die "failed to install the specs file" |
32 |
fi |
33 |
} |
34 |
-add_profile_eselect_conf() { |
35 |
- local compiler_config_file=$1 |
36 |
- local abi=$2 |
37 |
- local specs=$3 |
38 |
- local gcc_specs_file |
39 |
- local var |
40 |
- |
41 |
- if [[ -z ${specs} ]] ; then |
42 |
- # I'm leaving the following commented out to remind me that it |
43 |
- # was an insanely -bad- idea. Stuff broke. GCC_SPECS isnt unset |
44 |
- # on chroot or in non-toolchain.eclass gcc ebuilds! |
45 |
- #gcc_specs_file="${LIBPATH}/specs" |
46 |
- gcc_specs_file="" |
47 |
- |
48 |
- if use hardened ; then |
49 |
- specs="hardened" |
50 |
- else |
51 |
- specs="vanilla" |
52 |
- fi |
53 |
- else |
54 |
- gcc_specs_file="${LIBPATH}/${specs}.specs" |
55 |
- fi |
56 |
- |
57 |
- echo >> ${compiler_config_file} |
58 |
- if ! is_multilib ; then |
59 |
- echo "[${specs}]" >> ${compiler_config_file} |
60 |
- echo " ctarget=${CTARGET}" >> ${compiler_config_file} |
61 |
- else |
62 |
- echo "[${abi}-${specs}]" >> ${compiler_config_file} |
63 |
- var="CTARGET_${abi}" |
64 |
- if [[ -n ${!var} ]] ; then |
65 |
- echo " ctarget=${!var}" >> ${compiler_config_file} |
66 |
- else |
67 |
- var="CHOST_${abi}" |
68 |
- if [[ -n ${!var} ]] ; then |
69 |
- echo " ctarget=${!var}" >> ${compiler_config_file} |
70 |
- else |
71 |
- echo " ctarget=${CTARGET}" >> ${compiler_config_file} |
72 |
- fi |
73 |
- fi |
74 |
- fi |
75 |
- |
76 |
- local MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) |
77 |
- local LDPATH=${LIBPATH} |
78 |
- if [[ ${MULTIDIR} != "." ]] ; then |
79 |
- LDPATH="${LIBPATH}/${MULTIDIR}" |
80 |
- fi |
81 |
- |
82 |
- echo " ldpath=${LDPATH}" >> ${compiler_config_file} |
83 |
- |
84 |
- if [[ -n ${gcc_specs_file} ]] ; then |
85 |
- echo " specs=${gcc_specs_file}" >> ${compiler_config_file} |
86 |
- fi |
87 |
- |
88 |
- var="CFLAGS_${abi}" |
89 |
- if [[ -n ${!var} ]] ; then |
90 |
- echo " cflags=${!var}" >> ${compiler_config_file} |
91 |
- fi |
92 |
-} |
93 |
- |
94 |
-create_eselect_conf() { |
95 |
- local config_dir="/etc/eselect/compiler" |
96 |
- local compiler_config_file="${D}/${config_dir}/${CTARGET}-${GCC_CONFIG_VER}.conf" |
97 |
- local abi |
98 |
- |
99 |
- dodir ${config_dir} |
100 |
- |
101 |
- echo "[global]" > ${compiler_config_file} |
102 |
- echo " version=${CTARGET}-${GCC_CONFIG_VER}" >> ${compiler_config_file} |
103 |
- echo " binpath=${BINPATH}" >> ${compiler_config_file} |
104 |
- echo " manpath=${DATAPATH}/man" >> ${compiler_config_file} |
105 |
- echo " infopath=${DATAPATH}/info" >> ${compiler_config_file} |
106 |
- echo " alias_cc=gcc" >> ${compiler_config_file} |
107 |
- echo " stdcxx_incdir=${STDCXX_INCDIR##*/}" >> ${compiler_config_file} |
108 |
- echo " bin_prefix=${CTARGET}" >> ${compiler_config_file} |
109 |
- |
110 |
- # Per spyderous, it is best not to alias the fortran compilers |
111 |
- #if [[ -x "${D}/${BINPATH}/${CTARGET}-g77" ]] ; then |
112 |
- # echo " alias_gfortran=g77" >> ${compiler_config_file} |
113 |
- #elif [[ -x "${D}/${BINPATH}/${CTARGET}-gfortran" ]] ; then |
114 |
- # echo " alias_g77=gfortran" >> ${compiler_config_file} |
115 |
- #fi |
116 |
- |
117 |
- for abi in $(get_all_abis) ; do |
118 |
- add_profile_eselect_conf "${compiler_config_file}" "${abi}" |
119 |
- |
120 |
- if want_split_specs ; then |
121 |
- if use hardened ; then |
122 |
- add_profile_eselect_conf "${compiler_config_file}" "${abi}" vanilla |
123 |
- elif hardened_gcc_works ; then |
124 |
- add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardened |
125 |
- fi |
126 |
- |
127 |
- if hardened_gcc_works || hardened_gcc_works pie ; then |
128 |
- add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednossp |
129 |
- fi |
130 |
- |
131 |
- if hardened_gcc_works || hardened_gcc_works ssp ; then |
132 |
- add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednopie |
133 |
- fi |
134 |
- |
135 |
- add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednopiessp |
136 |
- fi |
137 |
- done |
138 |
-} |
139 |
|
140 |
#----<< specs + env.d logic >>---- |
141 |
|
142 |
@@ -937,11 +832,7 @@ |
143 |
} |
144 |
|
145 |
gcc-compiler_pkg_postinst() { |
146 |
- if has_version 'app-admin/eselect-compiler' ; then |
147 |
- do_eselect_compiler |
148 |
- else |
149 |
- do_gcc_config |
150 |
- fi |
151 |
+ do_gcc_config |
152 |
|
153 |
if ! is_crosscompile ; then |
154 |
echo |
155 |
@@ -1980,9 +1871,6 @@ |
156 |
# the group 'root' set to gid 0 |
157 |
chown -R root:0 "${D}"${LIBPATH} |
158 |
|
159 |
- # Create config files for eselect-compiler |
160 |
- create_eselect_conf |
161 |
- |
162 |
# Move pretty-printers to gdb datadir to shut ldconfig up |
163 |
gdbdir=/usr/share/gdb/auto-load |
164 |
for module in $(find "${D}" -iname "*-gdb.py" -print); do |
165 |
@@ -2417,96 +2305,6 @@ |
166 |
gcc-config ${CTARGET}-${GCC_CONFIG_VER}${use_specs} |
167 |
} |
168 |
|
169 |
-should_we_eselect_compiler() { |
170 |
- # we always want to run gcc-config if we're bootstrapping, otherwise |
171 |
- # we might get stuck with the c-only stage1 compiler |
172 |
- use bootstrap && return 0 |
173 |
- use build && return 0 |
174 |
- |
175 |
- # if the current config is invalid, we definitely want a new one |
176 |
- # Note: due to bash quirkiness, the following must not be 1 line |
177 |
- local curr_config |
178 |
- curr_config=$(env -i eselect compiler show ${CTARGET} 2>&1) || return 0 |
179 |
- [[ -z ${curr_config} || ${curr_config} == "(none)" ]] && return 0 |
180 |
- |
181 |
- # if the previously selected config has the same major.minor (branch) as |
182 |
- # the version we are installing, then it will probably be uninstalled |
183 |
- # for being in the same SLOT, make sure we run gcc-config. |
184 |
- local curr_config_ver=$(echo ${curr_config} | cut -f1 -d/ | awk -F - '{ print $5 }') |
185 |
- local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) |
186 |
- |
187 |
- # If we're using multislot, just run gcc-config if we're installing |
188 |
- # to the same profile as the current one. |
189 |
- use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]]) |
190 |
- |
191 |
- if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then |
192 |
- return 0 |
193 |
- else |
194 |
- # if we're installing a genuinely different compiler version, |
195 |
- # we should probably tell the user -how- to switch to the new |
196 |
- # gcc version, since we're not going to do it for him/her. |
197 |
- # We don't want to switch from say gcc-3.3 to gcc-3.4 right in |
198 |
- # the middle of an emerge operation (like an 'emerge -e world' |
199 |
- # which could install multiple gcc versions). |
200 |
- einfo "The current gcc config appears valid, so it will not be" |
201 |
- einfo "automatically switched for you. If you would like to" |
202 |
- einfo "switch to the newly installed gcc version, do the" |
203 |
- einfo "following:" |
204 |
- echo |
205 |
- einfo "eselect compiler set <profile>" |
206 |
- echo |
207 |
- ebeep |
208 |
- return 1 |
209 |
- fi |
210 |
-} |
211 |
- |
212 |
-do_eselect_compiler() { |
213 |
- if ! should_we_eselect_compiler; then |
214 |
- eselect compiler update |
215 |
- return 0 |
216 |
- fi |
217 |
- |
218 |
- for abi in $(get_all_abis) ; do |
219 |
- local ctarget=$(get_abi_CHOST ${abi}) |
220 |
- local current_specs=$(env -i eselect compiler show ${ctarget} | cut -f2 -d/) |
221 |
- |
222 |
- if [[ -n ${current_specs} && ${current_specs} != "(none)" ]] && eselect compiler set ${CTARGET}-${GCC_CONFIG_VER}/${current_specs} &> /dev/null; then |
223 |
- einfo "The following compiler profile has been activated based on your previous profile:" |
224 |
- einfo "${CTARGET}-${GCC_CONFIG_VER}/${current_specs}" |
225 |
- else |
226 |
- # We couldn't choose based on the old specs, so fall back on vanilla/hardened based on USE |
227 |
- |
228 |
- local spec |
229 |
- if use hardened ; then |
230 |
- spec="hardened" |
231 |
- else |
232 |
- spec="vanilla" |
233 |
- fi |
234 |
- |
235 |
- local profile |
236 |
- local isset=0 |
237 |
- for profile in "${current_specs%-*}-${spec}" "${abi}-${spec}" "${spec}" ; do |
238 |
- if eselect compiler set ${CTARGET}-${GCC_CONFIG_VER}/${profile} &> /dev/null ; then |
239 |
- ewarn "The newly installed version of gcc does not have a profile that matches the name of your" |
240 |
- ewarn "currently selected profile for ${ctarget}, so we have enabled the following instead:" |
241 |
- ewarn "${CTARGET}-${GCC_CONFIG_VER}/${profile}" |
242 |
- ewarn "If this is incorrect, please use 'eselect compiler set' to" |
243 |
- ewarn "select another profile." |
244 |
- |
245 |
- isset=1 |
246 |
- break |
247 |
- fi |
248 |
- done |
249 |
- |
250 |
- if [[ ${isset} == 0 ]] ; then |
251 |
- eerror "We were not able to automatically set the current compiler for ${ctarget}" |
252 |
- eerror "to your newly emerged gcc. Please use 'eselect compiler set'" |
253 |
- eerror "to select your compiler." |
254 |
- fi |
255 |
- fi |
256 |
- done |
257 |
-} |
258 |
- |
259 |
# This function allows us to gentoo-ize gcc's version number and bugzilla |
260 |
# URL without needing to use patches. |
261 |
gcc_version_patch() { |