Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-libs/glibc/files/eblits: src_install-2.6.eblit src_install-2.7.eblit
Date: Mon, 24 Mar 2008 19:45:21
Message-Id: E1Jdsbc-0007LA-2x@stork.gentoo.org
1 vapier 08/03/24 19:45:16
2
3 Added: src_install-2.6.eblit
4 Removed: src_install-2.7.eblit
5 Log:
6 Reversion things so old is old #191088.
7 (Portage version: 2.2_pre5)
8
9 Revision Changes Path
10 1.1 sys-libs/glibc/files/eblits/src_install-2.6.eblit
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/src_install-2.6.eblit?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/glibc/files/eblits/src_install-2.6.eblit?rev=1.1&content-type=text/plain
14
15 Index: src_install-2.6.eblit
16 ===================================================================
17 # Copyright 1999-2007 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install-2.6.eblit,v 1.1 2008/03/24 19:45:15 vapier Exp $
20
21 toolchain-glibc_src_install() {
22 # These should not be set, else the
23 # zoneinfo do not always get installed ...
24 unset LANGUAGE LANG LC_ALL
25
26 local GBUILDDIR
27 if want_linuxthreads ; then
28 GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
29 else
30 GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
31 fi
32
33 local install_root=${D}
34 is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
35 if want_linuxthreads ; then
36 cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
37 einfo "Installing GLIBC ${ABI} with linuxthreads ..."
38 make PARALLELMFLAGS="${MAKEOPTS}" \
39 install_root="${install_root}" \
40 install || die
41 else # nptlonly
42 cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
43 einfo "Installing GLIBC ${ABI} with NPTL ..."
44 make PARALLELMFLAGS="${MAKEOPTS}" \
45 install_root="${install_root}" \
46 install || die
47 fi
48
49 if is_crosscompile ; then
50 # punt all the junk not needed by a cross-compiler
51 cd "${D}"/usr/${CTARGET} || die
52 rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
53 fi
54
55 if want_linuxthreads && want_nptl ; then
56 einfo "Installing NPTL to $(alt_libdir)/tls/..."
57 cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
58 dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
59
60 local l src_lib
61 for l in libc libm librt libpthread libthread_db ; do
62 # take care of shared lib first ...
63 l=${l}.so
64 if [[ -e ${l} ]] ; then
65 src_lib=${l}
66 else
67 src_lib=$(eval echo */${l})
68 fi
69 cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
70 fperms a+rx $(alt_libdir)/tls/${l}
71 dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
72
73 # then grab the linker script or the symlink ...
74 if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
75 dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
76 else
77 sed \
78 -e "s:/${l}:/tls/${l}:g" \
79 -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
80 "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
81 fi
82
83 # then grab the static lib ...
84 src_lib=${src_lib/%.so/.a}
85 [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
86 cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
87 src_lib=${src_lib/%.a/_nonshared.a}
88 if [[ -e ${src_lib} ]] ; then
89 cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
90 fi
91 done
92
93 # use the nptl linker instead of the linuxthreads one as the linuxthreads
94 # one may lack TLS support and that can be really bad for business
95 cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
96 fi
97
98 # We'll take care of the cache ourselves
99 rm -f "${D}"/etc/ld.so.cache
100
101 # Some things want this, notably ash.
102 dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
103
104 # Handle includes for different ABIs
105 prep_ml_includes $(alt_headers)
106
107 # When cross-compiling for a non-multilib setup, make sure we have
108 # lib and a proper symlink setup
109 if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
110 cd "${D}"$(alt_libdir)/..
111 mv $(get_libdir) lib || die
112 ln -s lib $(get_libdir) || die
113 cd "${D}"$(alt_usrlibdir)/..
114 mv $(get_libdir) lib || die
115 ln -s lib $(get_libdir) || die
116 fi
117
118 #################################################################
119 # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
120 # Make sure we install some symlink hacks so that when we build
121 # a 2nd stage cross-compiler, gcc finds the target system
122 # headers correctly. See gcc/doc/gccinstall.info
123 if is_crosscompile ; then
124 dosym usr/include /usr/${CTARGET}/sys-include
125 return 0
126 fi
127
128 # Everything past this point just needs to be done once ...
129 is_final_abi || return 0
130
131 # Make sure the non-native interp can be found on multilib systems
132 if has_multilib_profile ; then
133 case $(tc-arch) in
134 amd64)
135 [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
136 dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
137 ;;
138 ppc64)
139 [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
140 dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
141 ;;
142 esac
143 fi
144
145 # Files for Debian-style locale updating
146 dodir /usr/share/i18n
147 sed \
148 -e "/^#/d" \
149 -e "/SUPPORTED-LOCALES=/d" \
150 -e "s: \\\\::g" -e "s:/: :g" \
151 "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
152 || die "generating /usr/share/i18n/SUPPORTED failed"
153 cd "${WORKDIR}"/extra/locale
154 dosbin locale-gen || die
155 doman *.[0-8]
156 insinto /etc
157 doins locale.gen || die
158
159 # Make sure all the ABI's can find the locales and so we only
160 # have to generate one set
161 local a
162 keepdir /usr/$(get_libdir)/locale
163 for a in $(get_install_abis) ; do
164 if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
165 dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
166 fi
167 done
168
169 if ! has noinfo ${FEATURES} && [[ -n ${INFOPAGE_VER} ]] ; then
170 einfo "Installing info pages..."
171
172 make \
173 -C "${GBUILDDIR}" \
174 PARALLELMFLAGS="${MAKEOPTS}" \
175 install_root="${install_root}" \
176 info -i || die
177 fi
178
179 if [[ -n ${MANPAGE_VER} ]] ; then
180 einfo "Installing man pages..."
181
182 # Install linuxthreads man pages even if nptl is enabled
183 cd "${WORKDIR}"/man
184 doman *.3thr
185 fi
186
187 cd "${S}"
188
189 # Install misc network config files
190 insinto /etc
191 doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
192 doins "${WORKDIR}"/extra/etc/*.conf || die
193 doinitd "${WORKDIR}"/extra/etc/nscd || die
194
195 dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
196
197 # Prevent overwriting of the /etc/localtime symlink. We'll handle the
198 # creation of the "factory" symlink in pkg_postinst().
199 rm -f "${D}"/etc/localtime
200 }
201
202 toolchain-glibc_headers_install() {
203 local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
204 cd "${GBUILDDIR}"
205 make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
206 # Copy over headers that are not part of install-headers ... these
207 # are pretty much taken verbatim from crosstool, see it for more details
208 insinto $(alt_headers)/bits
209 doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
210 insinto $(alt_headers)/gnu
211 doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
212 # Make sure we install the sys-include symlink so that when
213 # we build a 2nd stage cross-compiler, gcc finds the target
214 # system headers correctly. See gcc/doc/gccinstall.info
215 dosym usr/include /usr/${CTARGET}/sys-include
216 }
217
218 src_strip() {
219 # gdb is lame and requires some debugging information to remain in
220 # libpthread, so we need to strip it by hand. libthread_db makes no
221 # sense stripped as it is only used when debugging.
222 local pthread=$(hasq splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}")
223 env \
224 -uRESTRICT \
225 CHOST=${CTARGET} \
226 STRIP_MASK="/*/{,tls/}${pthread}*" \
227 prepallstrip
228 # if user has stripping enabled and does not have split debug turned on,
229 # then leave the debugging sections in libpthread.
230 if ! hasq nostrip ${FEATURES} && ! hasq splitdebug ${FEATURES} ; then
231 ${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so
232 fi
233 }
234
235 eblit-glibc-src_install() {
236 setup_env
237
238 if [[ -z ${OABI} ]] ; then
239 local abilist=""
240 if has_multilib_profile ; then
241 abilist=$(get_install_abis)
242 einfo "Installing multilib glibc for ABIs: ${abilist}"
243 elif is_crosscompile || tc-is-cross-compiler ; then
244 abilist=${DEFAULT_ABI}
245 fi
246 if [[ -n ${abilist} ]] ; then
247 OABI=${ABI}
248 for ABI in ${abilist} ; do
249 export ABI
250 eblit-glibc-src_install
251 done
252 ABI=${OABI}
253 unset OABI
254 src_strip
255 return 0
256 fi
257 fi
258
259 if just_headers ; then
260 toolchain-glibc_headers_install
261 else
262 toolchain-glibc_src_install
263 fi
264 [[ -z ${OABI} ]] && src_strip
265 }
266
267
268
269 --
270 gentoo-commits@l.g.o mailing list