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/uclibc: uclibc-0.9.33.2-r1.ebuild ChangeLog
Date: Thu, 05 Jul 2012 04:13:29
Message-Id: 20120705041320.3DE352004B@flycatcher.gentoo.org
1 vapier 12/07/05 04:13:20
2
3 Modified: ChangeLog
4 Added: uclibc-0.9.33.2-r1.ebuild
5 Log:
6 Pull in rpmatch from upstream to move it from header to C library for gnulib #423491.
7
8 (Portage version: 2.2.0_alpha115/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.68 sys-libs/uclibc/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/ChangeLog?rev=1.68&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/ChangeLog?rev=1.68&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/ChangeLog?r1=1.67&r2=1.68
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v
20 retrieving revision 1.67
21 retrieving revision 1.68
22 diff -u -r1.67 -r1.68
23 --- ChangeLog 9 Jun 2012 06:47:12 -0000 1.67
24 +++ ChangeLog 5 Jul 2012 04:13:20 -0000 1.68
25 @@ -1,6 +1,12 @@
26 # ChangeLog for sys-libs/uclibc
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.67 2012/06/09 06:47:12 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.68 2012/07/05 04:13:20 vapier Exp $
30 +
31 +*uclibc-0.9.33.2-r1 (05 Jul 2012)
32 +
33 + 05 Jul 2012; Mike Frysinger <vapier@g.o> +uclibc-0.9.33.2-r1.ebuild:
34 + Pull in rpmatch from upstream to move it from header to C library for gnulib
35 + #423491.
36
37 09 Jun 2012; Mike Frysinger <vapier@g.o> -uclibc-0.9.27-r1.ebuild,
38 -uclibc-0.9.28.3-r3.ebuild, -uclibc-0.9.28.3-r7.ebuild,
39
40
41
42 1.1 sys-libs/uclibc/uclibc-0.9.33.2-r1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: uclibc-0.9.33.2-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2012 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r1.ebuild,v 1.1 2012/07/05 04:13:20 vapier Exp $
52
53 inherit eutils flag-o-matic multilib toolchain-funcs savedconfig
54 if [[ ${PV} == "9999" ]] ; then
55 EGIT_REPO_URI="git://git.busybox.net/uClibc"
56 inherit git-2
57 fi
58
59 export CBUILD=${CBUILD:-${CHOST}}
60 export CTARGET=${CTARGET:-${CHOST}}
61 if [[ ${CTARGET} == ${CHOST} ]] ; then
62 if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
63 export CTARGET=${CATEGORY/cross-}
64 fi
65 fi
66
67 MY_P=uClibc-${PV}
68 DESCRIPTION="C library for developing embedded Linux systems"
69 HOMEPAGE="http://www.uclibc.org/"
70 if [[ ${PV} != "9999" ]] ; then
71 PATCH_VER="2"
72 SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2
73 ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}"
74 KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
75 fi
76
77 LICENSE="LGPL-2"
78 SLOT="0"
79 IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only"
80 RESTRICT="strip"
81
82 S=${WORKDIR}/${MY_P}
83
84 is_crosscompile() {
85 [[ ${CHOST} != ${CTARGET} ]]
86 }
87 alt_build_kprefix() {
88 if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then
89 echo /usr/include
90 else
91 echo /usr/${CTARGET}/usr/include
92 fi
93 }
94
95 just_headers() {
96 use crosscompile_opts_headers-only && is_crosscompile
97 }
98
99 uclibc_endian() {
100 # XXX: this wont work for a toolchain which is bi-endian, but we
101 # dont have any such thing at the moment, so not a big deal
102 touch "${T}"/endian.s
103 $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
104 case $(file "${T}"/endian.o) in
105 *" MSB "*) echo "BIG";;
106 *" LSB "*) echo "LITTLE";;
107 *) echo "NFC";;
108 esac
109 rm -f "${T}"/endian.{s,o}
110 }
111
112 pkg_setup() {
113 if [ ${CTARGET} == ${CHOST} ] ; then
114 case ${CHOST} in
115 *-uclinux*|*-uclibc*) ;;
116 *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
117 esac
118 fi
119 }
120
121 # XXX: We should kill these off.
122 CPU_ALPHA=""
123 CPU_AMD64=""
124 CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT},_CORTEX_{M3,M1}}"
125 CPU_IA64=""
126 CPU_M68K=""
127 CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32{,R2},64}} MIPS_{N64,O32,N32}_ABI"
128 CPU_PPC=""
129 CPU_SH="SH{2,2A,3,4,5}"
130 CPU_SPARC="SPARC_V{7,8,9,9B}"
131 CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH"
132 IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}"
133
134 check_cpu_opts() {
135 local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])"
136 [[ -z ${!cpu_var} ]] && return 0
137
138 if [[ -z ${UCLIBC_CPU} ]] ; then
139 ewarn "You really should consider setting UCLIBC_CPU"
140 ewarn "Otherwise, the build will be generic (read: slow)."
141 ewarn "Available CPU options:"
142 UCLIBC_CPU=$(eval echo ${!cpu_var})
143 echo ${UCLIBC_CPU}
144 case ${CTARGET} in
145 mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
146 sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
147 i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
148 *) export UCLIBC_CPU=${UCLIBC_CPU%% *};;
149 esac
150 else
151 local cpu found=0
152 for cpu in $(eval echo ${!cpu_var}) ; do
153 [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break
154 done
155 if [[ ${found} -eq 0 ]] ; then
156 ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported"
157 ewarn "Valid choices:"
158 eval echo ${!cpu_var}
159 die "pick a supported cpu type"
160 fi
161 fi
162 }
163
164 kconfig_q_opt() {
165 local flag=$1; shift
166 case ${flag} in
167 y|n) ;;
168 *) flag=$(usex ${flag} y n) ;;
169 esac
170
171 local var="defs_${flag}"
172 eval "${var}+=( $* )"
173 }
174
175 get_opt() {
176 (
177 unset ${1}
178 . ${2:-"${S}"/.config}
179 echo ${!1}
180 )
181 }
182
183 src_oldconfig() {
184 yes "" 2>/dev/null | emake -s oldconfig >/dev/null
185 }
186 src_config() {
187 restore_config .config
188 if [ -f .config ]; then
189 src_oldconfig
190 return 0
191 else
192 ewarn "Could not locate user configfile, so we will save a default one"
193 fi
194
195 emake ARCH=${target} defconfig >/dev/null || die
196
197 local defs_{y,n} defs
198
199 defs=(
200 DO{DEBUG_PT,ASSERTS}
201 SUPPORT_LD_DEBUG_EARLY
202 UCLIBC_HAS_PROFILING
203 )
204 kconfig_q_opt n "${defs[@]}"
205 kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG
206
207 sed -i -e '/ARCH_.*_ENDIAN/d' .config
208 kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
209
210 if [[ ${CTARGET} == arm* ]] ; then
211 kconfig_q_opt n CONFIG_ARM_OABI
212 kconfig_q_opt y CONFIG_ARM_EABI
213 fi
214
215 defs=(
216 MALLOC_GLIBC_COMPAT
217 DO_C99_MATH
218 UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC}
219 UCLIBC_HAS_FENV
220 UCLIBC_HAS_{N,}FTW
221 UCLIBC_HAS_GNU_GLOB
222 UCLIBC_HAS_LIBUTIL
223 UCLIBC_HAS_PROGRAM_INVOCATION_NAME
224 UCLIBC_HAS_RESOLVER_SUPPORT
225 UCLIBC_HAS_TZ_FILE_READ_MANY
226 UCLIBC_HAS_UTMPX
227 UCLIBC_SUSV3_LEGACY
228 UCLIBC_SUSV3_LEGACY_MACROS
229 UCLIBC_SUSV4_LEGACY
230 PTHREADS_DEBUG_SUPPORT
231 )
232 kconfig_q_opt y "${defs[@]}"
233 kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE
234 kconfig_q_opt n UCLIBC_HAS_LOCALE
235 kconfig_q_opt n HAS_NO_THREADS
236 kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
237 kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE
238 kconfig_q_opt !nptl LINUXTHREADS_OLD
239 kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC
240 kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP
241 kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT
242
243 # we need to do it independently of hardened to get ssp.c built into libc
244 kconfig_q_opt y UCLIBC_HAS_SSP
245 kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT
246 kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM
247 kconfig_q_opt n PROPOLICE_BLOCK_ABRT
248 kconfig_q_opt y PROPOLICE_BLOCK_SEGV
249
250 # arm/mips do not emit PT_GNU_STACK, but if we enable this here
251 # it will be emitted as RWE, ppc has to be checked, x86 needs it
252 # this option should be used independently of hardened
253 if has $(tc-arch) x86 || has $(tc-arch) ppc ; then
254 kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK
255 else
256 kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK
257 fi
258 kconfig_q_opt y UCLIBC_BUILD_RELRO
259 kconfig_q_opt hardened UCLIBC_BUILD_PIE
260 kconfig_q_opt hardened UCLIBC_BUILD_NOW
261 kconfig_q_opt !ssp SSP_QUICK_CANARY
262 kconfig_q_opt ssp UCLIBC_BUILD_SSP
263
264 local def
265 for def in 1 2 ; do
266 # Run twice as some config opts depend on others being enabled first.
267 for def in ${defs_y[@]} ; do
268 sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config
269 done
270 for def in ${defs_n[@]} ; do
271 sed -i -e "s:${def}=y:# ${def} is not set:g" .config
272 done
273 src_oldconfig
274 done
275
276 einfo "Enabled options:"
277 for def in ${defs_y[@]} ; do
278 einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
279 done
280 einfo "Disabled options:"
281 for def in ${defs_n[@]} ; do
282 einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
283 done
284
285 # setup build and run paths
286 sed -i \
287 -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \
288 -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
289 -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
290 -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
291 -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
292 -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
293 .config || die
294
295 src_oldconfig
296 }
297
298 src_unpack() {
299 if [[ ${PV} == "9999" ]] ; then
300 git-2_src_unpack
301 else
302 unpack ${A}
303 fi
304 cd "${S}"
305 if [[ -n ${PATCH_VER} ]] ; then
306 EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
307 fi
308
309 check_cpu_opts
310
311 echo
312 einfo "Runtime Prefix: /"
313 einfo "Devel Prefix: /usr"
314 einfo "Kernel Prefix: $(alt_build_kprefix)"
315 einfo "CBUILD: ${CBUILD}"
316 einfo "CHOST: ${CHOST}"
317 einfo "CTARGET: ${CTARGET}"
318 einfo "CPU: ${UCLIBC_CPU:-default}"
319 einfo "ENDIAN: $(uclibc_endian)"
320 echo
321
322 ########## CPU SELECTION ##########
323
324 local target config_target
325 case $(tc-arch) in
326 alpha) target="alpha"; config_target="no cpu-specific options";;
327 amd64) target="x86_64"; config_target="no cpu-specific options";;
328 arm) target="arm"; config_target="GENERIC_ARM";;
329 avr) target="avr32"; config_target="no cpu-specific options";;
330 ia64) target="ia64"; config_target="no cpu-specific options";;
331 m68k) target="m68k"; config_target="no cpu-specific options";;
332 mips) target="mips"; config_target="MIPS_ISA_1";;
333 ppc) target="powerpc"; config_target="no cpu-specific options";;
334 sh) target="sh"; config_target="SH4";;
335 sparc) target="sparc"; config_target="no cpu-specific options";;
336 x86) target="i386"; config_target="GENERIC_386";;
337 *) die "$(tc-arch) lists no defaults :/";;
338 esac
339 sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
340 extra/Configs/Config.${target}
341 sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
342
343 src_config
344
345 if use iconv ; then
346 # Run after make clean, otherwise files removed
347 find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt
348 if [[ ! -f /etc/locale.gen ]] ; then
349 # See ./extra/locale/LOCALES for examples
350 die "Please create an appropriate /etc/locale.gen for locale support"
351 fi
352 echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt
353 cat /etc/locale.gen >> ./extra/locale/locales.txt
354 fi
355 }
356
357 src_compile() {
358 emake headers || die
359 just_headers && return 0
360
361 emake || die
362 if is_crosscompile ; then
363 emake -C utils hostutils || die
364 else
365 emake utils || die
366 fi
367 }
368
369 src_test() {
370 is_crosscompile && return 0
371
372 # assert test fails on pax/grsec enabled kernels - normal
373 # vfork test fails in sandbox (both glibc/uclibc)
374 emake UCLIBC_ONLY=1 check || die
375 }
376
377 src_install() {
378 local sysroot=${D}
379 is_crosscompile && sysroot+="/usr/${CTARGET}"
380
381 local target="install"
382 just_headers && target="install_headers"
383 emake DESTDIR="${sysroot}" ${target} || die
384
385 save_config .config
386
387 # remove files coming from kernel-headers
388 rm -rf "${sysroot}"/usr/include/{linux,asm*}
389
390 # Make sure we install the sys-include symlink so that when
391 # we build a 2nd stage cross-compiler, gcc finds the target
392 # system headers correctly. See gcc/doc/gccinstall.info
393 if is_crosscompile ; then
394 dosym usr/include /usr/${CTARGET}/sys-include
395 if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
396 newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
397 newbin utils/ldd.host ${CTARGET}-ldd || die
398 fi
399 return 0
400 fi
401
402 emake DESTDIR="${D}" install_utils || die
403 dobin extra/scripts/getent
404 dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
405 }
406
407 pkg_postinst() {
408 is_crosscompile && return 0
409
410 if [ ! -e "${ROOT}"/etc/TZ ] ; then
411 ewarn "Please remember to set your timezone in /etc/TZ"
412 mkdir -p "${ROOT}"/etc
413 echo "UTC" > "${ROOT}"/etc/TZ
414 fi
415 [ "${ROOT}" != "/" ] && return 0
416 # update cache before reloading init
417 ldconfig
418 # reload init ...
419 /sbin/telinit U 2>/dev/null
420 }