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