1 |
solar 08/01/01 23:28:54 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: uclibc-0.9.28.3-r2.ebuild |
5 |
Log: |
6 |
* 0.9.28.3 - 1.2 - Backport a few header defines |
7 |
(Portage version: 2.1.3.9) |
8 |
|
9 |
Revision Changes Path |
10 |
1.25 sys-libs/uclibc/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/uclibc/ChangeLog?rev=1.25&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/uclibc/ChangeLog?rev=1.25&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/uclibc/ChangeLog?r1=1.24&r2=1.25 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v |
19 |
retrieving revision 1.24 |
20 |
retrieving revision 1.25 |
21 |
diff -u -r1.24 -r1.25 |
22 |
--- ChangeLog 21 Sep 2007 02:49:13 -0000 1.24 |
23 |
+++ ChangeLog 1 Jan 2008 23:28:54 -0000 1.25 |
24 |
@@ -1,6 +1,11 @@ |
25 |
# ChangeLog for sys-libs/uclibc |
26 |
-# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.24 2007/09/21 02:49:13 solar Exp $ |
28 |
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 |
29 |
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.25 2008/01/01 23:28:54 solar Exp $ |
30 |
+ |
31 |
+*uclibc-0.9.28.3-r2 (01 Jan 2008) |
32 |
+ |
33 |
+ 01 Jan 2008; <solar@g.o> +uclibc-0.9.28.3-r2.ebuild: |
34 |
+ * 0.9.28.3 - 1.2 - Backport a few header defines |
35 |
|
36 |
*uclibc-0.9.28.3-r1 (21 Sep 2007) |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
1.1 sys-libs/uclibc/uclibc-0.9.28.3-r2.ebuild |
42 |
|
43 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/uclibc/uclibc-0.9.28.3-r2.ebuild?rev=1.1&view=markup |
44 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-libs/uclibc/uclibc-0.9.28.3-r2.ebuild?rev=1.1&content-type=text/plain |
45 |
|
46 |
Index: uclibc-0.9.28.3-r2.ebuild |
47 |
=================================================================== |
48 |
# Copyright 1999-2008 Gentoo Foundation |
49 |
# Distributed under the terms of the GNU General Public License v2 |
50 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.28.3-r2.ebuild,v 1.1 2008/01/01 23:28:54 solar Exp $ |
51 |
|
52 |
#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc" |
53 |
#inherit subversion |
54 |
inherit eutils flag-o-matic toolchain-funcs |
55 |
|
56 |
export CBUILD=${CBUILD:-${CHOST}} |
57 |
export CTARGET=${CTARGET:-${CHOST}} |
58 |
if [[ ${CTARGET} == ${CHOST} ]] ; then |
59 |
if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then |
60 |
export CTARGET=${CATEGORY/cross-} |
61 |
fi |
62 |
fi |
63 |
# Handle the case where we want uclibc on glibc ... |
64 |
if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc ]] ; then |
65 |
export UCLIBC_AND_GLIBC="sitting in a tree" |
66 |
export CTARGET=${CHOST%%-*}-pc-linux-uclibc |
67 |
fi |
68 |
|
69 |
MY_P=uClibc-${PV} |
70 |
SVN_VER="" |
71 |
PATCH_VER="1.2" |
72 |
DESCRIPTION="C library for developing embedded Linux systems" |
73 |
HOMEPAGE="http://www.uclibc.org/" |
74 |
SRC_URI="mirror://kernel/linux/libs/uclibc/${MY_P}.tar.bz2 |
75 |
http://uclibc.org/downloads/${MY_P}.tar.bz2 |
76 |
nls? ( !userlocales? ( pregen? ( |
77 |
x86? ( http://www.uclibc.org/downloads/uClibc-locale-030818.tgz ) |
78 |
) ) )" |
79 |
[[ -z ${SVN_VER} ]] || \ |
80 |
SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2" |
81 |
[[ -z ${PATCH_VER} ]] || \ |
82 |
SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2" |
83 |
|
84 |
LICENSE="LGPL-2" |
85 |
[[ ${CTARGET} != ${CHOST} ]] \ |
86 |
&& SLOT="${CTARGET}" \ |
87 |
|| SLOT="0" |
88 |
KEYWORDS="-* ~arm ~m68k -mips ~ppc ~sh ~sparc ~x86" |
89 |
IUSE="build uclibc-compat debug hardened iconv ipv6 minimal nls pregen savedconfig userlocales wordexp" |
90 |
RESTRICT="strip" |
91 |
|
92 |
RDEPEND="" |
93 |
if [[ ${CTARGET} == ${CHOST} ]] ; then |
94 |
DEPEND="virtual/os-headers app-misc/pax-utils" |
95 |
PROVIDE="virtual/libc" |
96 |
else |
97 |
DEPEND="" |
98 |
fi |
99 |
|
100 |
S=${WORKDIR}/${MY_P} |
101 |
|
102 |
alt_build_kprefix() { |
103 |
if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \ |
104 |
|| [[ -n ${UCLIBC_AND_GLIBC} ]] |
105 |
then |
106 |
echo /usr |
107 |
else |
108 |
echo /usr/${CTARGET}/usr |
109 |
fi |
110 |
} |
111 |
just_headers() { |
112 |
use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]] |
113 |
} |
114 |
|
115 |
uclibc_endian() { |
116 |
# XXX: this wont work for a toolchain which is bi-endian, but we |
117 |
# dont have any such thing at the moment, so not a big deal |
118 |
touch "${T}"/endian.s |
119 |
$(tc-getAS) "${T}"/endian.s -o "${T}"/endian.o |
120 |
case $(file "${T}"/endian.o) in |
121 |
*" MSB "*) echo "big";; |
122 |
*" LSB "*) echo "little";; |
123 |
*) echo "NFC";; |
124 |
esac |
125 |
rm -f "${T}"/endian.{s,o} |
126 |
} |
127 |
|
128 |
pkg_setup() { |
129 |
just_headers && return 0 |
130 |
has_version ${CATEGORY}/uclibc || return 0 |
131 |
[[ -n ${UCLIBC_AND_GLIBC} ]] && return 0 |
132 |
[[ ${ROOT} != "/" ]] && return 0 |
133 |
[[ ${CATEGORY} == cross-* ]] && return 0 |
134 |
|
135 |
if ! built_with_use --missing false ${CATEGORY}/uclibc nls && use nls && ! use pregen ; then |
136 |
eerror "You previously built uclibc with USE=-nls." |
137 |
eerror "You cannot generate locale data with this" |
138 |
eerror "system. Please rerun emerge with USE=pregen." |
139 |
die "host cannot support locales" |
140 |
elif built_with_use --missing false ${CATEGORY}/uclibc nls && ! use nls ; then |
141 |
eerror "You previously built uclibc with USE=nls." |
142 |
eerror "Rebuilding uClibc with USE=-nls will prob" |
143 |
eerror "destroy your system." |
144 |
die "switching from nls is baaaad" |
145 |
fi |
146 |
} |
147 |
|
148 |
PIE_STABLE="arm mips ppc x86" |
149 |
|
150 |
CPU_ALPHA="" |
151 |
CPU_AMD64="" |
152 |
CPU_ARM="GENERIC_ARM ARM{610,710,720T,920T,922T,926T,_{SA110,SA1100,XSCALE}}" |
153 |
CPU_IA64="" |
154 |
CPU_M68K="" |
155 |
CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}}" |
156 |
CPU_PPC="" |
157 |
CPU_SH="SH{2,3,4,5}" |
158 |
CPU_SPARC="" |
159 |
CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" |
160 |
IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" |
161 |
|
162 |
check_cpu_opts() { |
163 |
local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" |
164 |
[[ -z ${!cpu_var} ]] && return 0 |
165 |
|
166 |
if [[ -z ${UCLIBC_CPU} ]] ; then |
167 |
ewarn "You really should consider setting UCLIBC_CPU" |
168 |
ewarn "Otherwise, the build will be generic (read: slow)." |
169 |
ewarn "Available CPU options:" |
170 |
UCLIBC_CPU=$(eval echo ${!cpu_var}) |
171 |
echo ${UCLIBC_CPU} |
172 |
case ${CTARGET} in |
173 |
mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; |
174 |
sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; |
175 |
i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; |
176 |
*) export UCLIBC_CPU=${UCLIBC_CPU%% *};; |
177 |
esac |
178 |
else |
179 |
local cpu found=0 |
180 |
for cpu in $(eval echo ${!cpu_var}) ; do |
181 |
[[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break |
182 |
done |
183 |
if [[ ${found} -eq 0 ]] ; then |
184 |
ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" |
185 |
ewarn "Valid choices:" |
186 |
eval echo ${!cpu_var} |
187 |
die "pick a supported cpu type" |
188 |
fi |
189 |
fi |
190 |
} |
191 |
|
192 |
src_unpack() { |
193 |
[[ -n ${ESVN_REPO_URI} ]] \ |
194 |
&& subversion_src_unpack \ |
195 |
|| unpack ${A} |
196 |
cd "${S}" |
197 |
|
198 |
check_cpu_opts |
199 |
|
200 |
echo |
201 |
einfo "Runtime Prefix: /" |
202 |
einfo "Devel Prefix: /usr" |
203 |
einfo "Kernel Prefix: $(alt_build_kprefix)" |
204 |
einfo "CBUILD: ${CBUILD}" |
205 |
einfo "CHOST: ${CHOST}" |
206 |
einfo "CTARGET: ${CTARGET}" |
207 |
einfo "CPU: ${UCLIBC_CPU:-default}" |
208 |
einfo "ENDIAN: $(uclibc_endian)" |
209 |
echo |
210 |
|
211 |
########## PATCHES ########## |
212 |
|
213 |
[[ -n ${SVN_VER} ]] && \ |
214 |
epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch |
215 |
|
216 |
if [[ -n ${PATCH_VER} ]] ; then |
217 |
unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2 |
218 |
EPATCH_SUFFIX="patch" |
219 |
epatch "${WORKDIR}"/patch |
220 |
# math functions (sinf,cosf,tanf,atan2f,powf,fabsf,copysignf,scalbnf,rem_pio2f) |
221 |
cp "${WORKDIR}"/patch/math/libm/* "${S}"/libm/ || die |
222 |
epatch "${WORKDIR}"/patch/math |
223 |
fi |
224 |
|
225 |
########## CPU SELECTION ########## |
226 |
|
227 |
local target config_target |
228 |
case $(tc-arch) in |
229 |
alpha) target="alpha"; config_target="no cpu-specific options";; |
230 |
amd64) target="x86_64"; config_target="no cpu-specific options";; |
231 |
arm) target="arm"; config_target="GENERIC_ARM";; |
232 |
ia64) target="ia64"; config_target="no cpu-specific options";; |
233 |
m68k) target="m68k"; config_target="no cpu-specific options";; |
234 |
mips) target="mips"; config_target="MIPS_ISA_1";; |
235 |
ppc) target="powerpc"; config_target="no cpu-specific options";; |
236 |
sh) target="sh"; config_target="SH4";; |
237 |
sparc) target="sparc"; config_target="no cpu-specific options";; |
238 |
x86) target="i386"; config_target="GENERIC_386";; |
239 |
*) die "$(tc-arch) lists no defaults :/";; |
240 |
esac |
241 |
sed -i -e "s:default TARGET_i386:default TARGET_${target}:" \ |
242 |
extra/Configs/Config.in |
243 |
sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ |
244 |
extra/Configs/Config.${target} |
245 |
|
246 |
########## CONFIG SETUP ########## |
247 |
|
248 |
make defconfig >/dev/null || die "could not config" |
249 |
|
250 |
for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do |
251 |
sed -i -e "s:${def}=y:# ${def} is not set:" .config |
252 |
done |
253 |
if use debug ; then |
254 |
#echo "SUPPORT_LD_DEBUG_EARLY=y" >> .config |
255 |
echo "SUPPORT_LD_DEBUG=y" >> .config |
256 |
echo "DODEBUG=y" >> .config |
257 |
#echo "DODEBUG_PT=y" >> .config |
258 |
fi |
259 |
|
260 |
sed -i -e '/ARCH_.*_ENDIAN/d' .config |
261 |
echo "ARCH_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN=y" >> .config |
262 |
|
263 |
if [[ $(tc-is-softfloat) != "no" ]] ; then |
264 |
sed -i -e '/^HAS_FPU=y$/d' .config |
265 |
echo 'HAS_FPU=n' >> .config |
266 |
fi |
267 |
|
268 |
local moredefs="DL_FINI_CRT_COMPAT" |
269 |
# We need todo this for a few months. .28 is a major upgrade. |
270 |
# Don't do it from cross-compiling case though |
271 |
if ! use uclibc-compat ; then |
272 |
if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \ |
273 |
! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then |
274 |
local fnames="" |
275 |
einfo "Doing a scanelf in paths for bins containing the __uClibc_start_main symbol" |
276 |
fnames=$(scanelf -pyqs__uClibc_start_main -F%F#s) |
277 |
if [[ -z ${fnames} ]] ; then |
278 |
einfo "This system is clean." |
279 |
einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1" |
280 |
moredefs="" |
281 |
else |
282 |
ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled." |
283 |
ewarn "qfile ${fnames}" |
284 |
echo |
285 |
ewarn "Leaving on ${moredefs}" |
286 |
fi |
287 |
else |
288 |
moredefs="" |
289 |
fi |
290 |
fi |
291 |
for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} ; do |
292 |
sed -i -e "s:# ${def} is not set:${def}=y:" .config |
293 |
done |
294 |
echo "UCLIBC_HAS_FULL_RPC=y" >> .config |
295 |
echo "PTHREADS_DEBUG_SUPPORT=y" >> .config |
296 |
echo "UCLIBC_HAS_TZ_FILE_READ_MANY=n" >> .config |
297 |
|
298 |
if use iconv ; then |
299 |
sed -i -e "s:# UCLIBC_HAS_LOCALE is not set:UCLIBC_HAS_LOCALE=y:" .config |
300 |
echo "UCLIBC_HAS_XLOCALE=n" >> .config |
301 |
echo "UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y" >> .config |
302 |
echo "UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y" >> .config |
303 |
|
304 |
if use nls ; then |
305 |
echo "UCLIBC_HAS_GETTEXT_AWARENESS=y" >> .config |
306 |
else |
307 |
echo "UCLIBC_HAS_GETTEXT_AWARENESS=n" >> .config |
308 |
fi |
309 |
|
310 |
if use pregen ; then |
311 |
echo "UCLIBC_PREGENERATED_LOCALE_DATA=y" >> .config |
312 |
echo "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y" >> .config |
313 |
if use userlocales ; then |
314 |
cp "${DISTDIR}"/${MY_P}-user-locale.tar.gz \ |
315 |
extra/locale/uClibc-locale-030818.tgz \ |
316 |
|| die "could not copy ${MY_P}-user-locale.tar.gz" |
317 |
else |
318 |
cp "${DISTDIR}"/${MY_P}-$(tc-arch)-full-locale.tar.gz \ |
319 |
extra/locale/uClibc-locale-030818.tgz \ |
320 |
|| die "could not copy locale" |
321 |
fi |
322 |
else |
323 |
echo "UCLIBC_PREGENERATED_LOCALE_DATA=n" >> .config |
324 |
fi |
325 |
else |
326 |
echo "UCLIBC_HAS_LOCALE=n" >> .config |
327 |
fi |
328 |
|
329 |
use ipv6 && sed -i -e "s:# UCLIBC_HAS_IPV6 is not set:UCLIBC_HAS_IPV6=y:" .config |
330 |
|
331 |
# uncomment if you miss wordexp (alsa-lib) |
332 |
use wordexp && sed -i -e "s:# UCLIBC_HAS_WORDEXP is not set:UCLIBC_HAS_WORDEXP=y:" .config |
333 |
|
334 |
# we need to do it independently of hardened to get ssp.c built into libc |
335 |
sed -i -e "s:# UCLIBC_SECURITY.*:UCLIBC_SECURITY=y:" .config |
336 |
echo "UCLIBC_HAS_SSP=y" >> .config |
337 |
echo "SSP_USE_ERANDOM=n" >> .config |
338 |
echo "PROPOLICE_BLOCK_ABRT=n" >> .config |
339 |
if use debug ; then |
340 |
echo "PROPOLICE_BLOCK_SEGV=y" >> .config |
341 |
echo "PROPOLICE_BLOCK_KILL=n" >> .config |
342 |
else |
343 |
echo "PROPOLICE_BLOCK_SEGV=n" >> .config |
344 |
echo "PROPOLICE_BLOCK_KILL=y" >> .config |
345 |
fi |
346 |
|
347 |
# arm/mips do not emit PT_GNU_STACK, but if we enable this here |
348 |
# it will be emitted as RWE, ppc has to be checked, x86 needs it |
349 |
# this option should be used independently of hardened |
350 |
# relro could be also moved out of hardened |
351 |
if has $(tc-arch) x86 ; then |
352 |
echo "UCLIBC_BUILD_NOEXECSTACK=y" >> .config |
353 |
else |
354 |
echo "UCLIBC_BUILD_NOEXECSTACK=n" >> .config |
355 |
fi |
356 |
echo "UCLIBC_BUILD_RELRO=y" >> .config |
357 |
if use hardened ; then |
358 |
if has $(tc-arch) ${PIE_STABLE} ; then |
359 |
echo "UCLIBC_BUILD_PIE=y" >> .config |
360 |
else |
361 |
echo "UCLIBC_BUILD_PIE=n" >> .config |
362 |
fi |
363 |
echo "SSP_QUICK_CANARY=n" >> .config |
364 |
echo "UCLIBC_BUILD_SSP=y" >> .config |
365 |
echo "UCLIBC_BUILD_NOW=y" >> .config |
366 |
else |
367 |
echo "UCLIBC_BUILD_PIE=n" >> .config |
368 |
echo "SSP_QUICK_CANARY=y" >> .config |
369 |
echo "UCLIBC_BUILD_SSP=n" >> .config |
370 |
echo "UCLIBC_BUILD_NOW=n" >> .config |
371 |
fi |
372 |
|
373 |
# Allow users some custom control over the config |
374 |
if use savedconfig ; then |
375 |
for conf in ${PN}-${PV}-${PR} ${PN}-${PV} ${PN}; do |
376 |
configfile=${ROOT}/etc/${PN}/${CTARGET}/${conf}.config |
377 |
einfo "Checking existence of ${configfile} ..." |
378 |
[[ -r ${configfile} ]] || configfile=/etc/${PN}/${CHOST}/${conf}.config |
379 |
if [[ -r ${configfile} ]] ; then |
380 |
cp "${configfile}" "${S}"/.config |
381 |
einfo "Found your ${configfile} and using it." |
382 |
einfo "Note that this feature is *totally unsupported*." |
383 |
break |
384 |
fi |
385 |
done |
386 |
fi |
387 |
|
388 |
# setup build and run paths |
389 |
local cross=${CTARGET}- |
390 |
type -p ${cross}ar > /dev/null || cross="" |
391 |
sed -i \ |
392 |
-e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \ |
393 |
-e "/^KERNEL_SOURCE/s:=.*:=\"$(alt_build_kprefix)\":" \ |
394 |
-e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ |
395 |
-e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ |
396 |
-e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ |
397 |
.config || die |
398 |
|
399 |
yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig" |
400 |
|
401 |
cp .config myconfig |
402 |
|
403 |
emake -s clean > /dev/null || die "could not clean" |
404 |
} |
405 |
|
406 |
setup_locales() { |
407 |
cd "${S}"/extra/locale |
408 |
if use userlocales && [[ -f ${ROOT}/etc/locales.build ]] ; then |
409 |
:; |
410 |
elif use minimal ; then |
411 |
find ./charmaps -name ASCII.pairs > codesets.txt |
412 |
find ./charmaps -name ISO-8859-1.pairs >> codesets.txt |
413 |
cat <<-EOF > locales.txt |
414 |
@euro e |
415 |
UTF-8 yes |
416 |
8-bit yes |
417 |
en_US ISO-8859-1 |
418 |
en_US.UTF-8 UTF-8 |
419 |
EOF |
420 |
else |
421 |
find ./charmaps -name '*.pairs' > codesets.txt |
422 |
cp LOCALES locales.txt |
423 |
fi |
424 |
cd - |
425 |
} |
426 |
|
427 |
src_compile() { |
428 |
cp myconfig .config |
429 |
|
430 |
emake headers || die "make headers failed" |
431 |
just_headers && return 0 |
432 |
|
433 |
if use iconv && ! use pregen ; then |
434 |
cd extra/locale |
435 |
make clean || die "make locale clean failed" |
436 |
setup_locales |
437 |
emake || die "make locales failed" |
438 |
cd ../.. |
439 |
fi |
440 |
|
441 |
emake || die "make failed" |
442 |
if [[ ${CTARGET} != ${CHOST} ]] ; then |
443 |
emake -C utils hostutils || die "make hostutils failed" |
444 |
elif [[ ${CHOST} == *-uclibc ]] ; then |
445 |
emake utils || die "make utils failed" |
446 |
fi |
447 |
} |
448 |
|
449 |
src_test() { |
450 |
[[ ${CHOST} != ${CTARGET} ]] && return 0 |
451 |
[[ ${CBUILD} != ${CHOST} ]] && return 0 |
452 |
|
453 |
# assert test fails on pax/grsec enabled kernels - normal |
454 |
# vfork test fails in sandbox (both glibc/uclibc) |
455 |
make UCLIBC_ONLY=1 check || die "test failed" |
456 |
} |
457 |
|
458 |
src_install() { |
459 |
local sysroot=${D} |
460 |
[[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}" |
461 |
|
462 |
local target="install" |
463 |
just_headers && target="install_dev" |
464 |
emake DESTDIR="${sysroot}" ${target} || die "install failed" |
465 |
|
466 |
# remove files coming from kernel-headers |
467 |
rm -rf "${sysroot}"/usr/include/{linux,asm*} |
468 |
|
469 |
# Make sure we install the sys-include symlink so that when |
470 |
# we build a 2nd stage cross-compiler, gcc finds the target |
471 |
# system headers correctly. See gcc/doc/gccinstall.info |
472 |
if [[ ${CTARGET} != ${CHOST} ]] ; then |
473 |
dosym usr/include /usr/${CTARGET}/sys-include |
474 |
newbin utils/ldconfig.host ${CTARGET}-ldconfig || die |
475 |
newbin utils/ldd.host ${CTARGET}-ldd || die |
476 |
return 0 |
477 |
fi |
478 |
|
479 |
if [[ ${CHOST} == *-uclibc ]] ; then |
480 |
make DESTDIR="${D}" install_utils || die "install-utils failed" |
481 |
dobin extra/scripts/getent |
482 |
fi |
483 |
|
484 |
if ! use build ; then |
485 |
dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 |
486 |
doman docs/man/*.[1-9] |
487 |
fi |
488 |
} |
489 |
|
490 |
pkg_postinst() { |
491 |
[[ ${CTARGET} != ${CHOST} ]] && return 0 |
492 |
[[ ${CHOST} != *-uclibc ]] && return 0 |
493 |
|
494 |
if [[ ! -e ${ROOT}/etc/TZ ]] ; then |
495 |
ewarn "Please remember to set your timezone in /etc/TZ" |
496 |
[[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc |
497 |
echo "UTC" > "${ROOT}"/etc/TZ |
498 |
fi |
499 |
|
500 |
if [[ ${ROOT} == "/" ]] ; then |
501 |
# update cache before reloading init |
502 |
/sbin/ldconfig |
503 |
# reload init ... |
504 |
[[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null |
505 |
fi |
506 |
} |
507 |
|
508 |
|
509 |
|
510 |
-- |
511 |
gentoo-commits@g.o mailing list |