From 9f01c96cb64d77a571693840dbdae564eebfe87d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 25 Mar 2007 15:14:30 +0000 Subject: [PATCH] Version bump #168747 by Josh G. Package-Manager: portage-2.1.2.2 --- sys-libs/uclibc/ChangeLog | 7 +- sys-libs/uclibc/Manifest | 25 +- sys-libs/uclibc/files/digest-uclibc-0.9.28.3 | 9 + sys-libs/uclibc/uclibc-0.9.28.3.ebuild | 450 +++++++++++++++++++ 4 files changed, 482 insertions(+), 9 deletions(-) create mode 100644 sys-libs/uclibc/files/digest-uclibc-0.9.28.3 create mode 100644 sys-libs/uclibc/uclibc-0.9.28.3.ebuild diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog index 53346dd728d9..8f5ad4aebb7f 100644 --- a/sys-libs/uclibc/ChangeLog +++ b/sys-libs/uclibc/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-libs/uclibc # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.19 2007/02/16 03:30:27 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.20 2007/03/25 15:14:30 vapier Exp $ + +*uclibc-0.9.28.3 (25 Mar 2007) + + 25 Mar 2007; Mike Frysinger +uclibc-0.9.28.3.ebuild: + Version bump #168747 by Josh G. 16 Feb 2007; Diego Pettenò uclibc-0.9.27-r1.ebuild, uclibc-0.9.28.ebuild, uclibc-0.9.28-r1.ebuild, diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest index 1b82f3071847..c2381d067517 100644 --- a/sys-libs/uclibc/Manifest +++ b/sys-libs/uclibc/Manifest @@ -9,6 +9,8 @@ DIST uClibc-0.9.28-patches-1.6.tar.bz2 28097 RMD160 b171d9e20fd80550e4aca83fbc1b DIST uClibc-0.9.28-patches-1.7.tar.bz2 31188 RMD160 aab3e3cc52c22b88b477259aa1b162755df24ae4 SHA1 e47dac600ace9128a728cb1486d64fc564da6cc7 SHA256 331dc7ee32eede26f72c1af564f22d99d8d7f1902dbee85fa778e779d0747e55 DIST uClibc-0.9.28.1-patches-1.0.tar.bz2 16654 RMD160 5114240c7dcd95c908a5ee956e10e7f52c96053e SHA1 3ed65a6808b9aa182036bf3059e9a51163799030 SHA256 d91f0a458c6f35eb862f6bb54daf74eb7e58d4c2543cf6dd0ac01d2eade51314 DIST uClibc-0.9.28.1.tar.bz2 1782149 RMD160 7b225c5554427045732fecc4a1771e7847a9186e SHA1 3b7e34d05697456f5afe23d8666fad1c458813d6 SHA256 0b4381eb3a99948958dec592a7cc64bd5a07195139f5ee6d8d687f4d45b1ee56 +DIST uClibc-0.9.28.3-patches-1.0.tar.bz2 16079 RMD160 2224a7b826932fcd5c96a0bddb30fcfa4173de35 SHA1 098f90da4879bc3a14afe662f19163c969bde431 SHA256 c432d869fc3e8a4e2137541e8a1ab93e7d634387d9ca5131842721f4b080b72e +DIST uClibc-0.9.28.3.tar.bz2 1795383 RMD160 61591281f4193d4dcd0fa3252fb3286028d4cb63 SHA1 77c5220697a1772d0d9da4bda0d866e4f4b68540 SHA256 1d86d5dad6060e7057cfe023ffc7b7661bdc7fe95112b37447851c0a75b547a1 DIST uClibc-0.9.28.tar.bz2 1763847 RMD160 41646bd94459a9c6f10aea4a4483fa4fedf30e7d SHA1 9124a6e5b0454da3f967725d54fde806189ad27b SHA256 c8bc5383eafaa299e9874ae50acc6549f8b54bc29ed64a9a3387b3e4cd7f4bcb DIST uClibc-locale-030818.tgz 236073 RMD160 8e3f4b20b94e07e535cbbbe81287186014c5f151 SHA1 78f901e6ed228ed84106bd034c1b97eee1eecb50 SHA256 c4362be318a38f18d98dccf462d22d95bab92f05548bb93f65298fe9afaebd57 EBUILD uclibc-0.9.27-r1.ebuild 12137 RMD160 4b164d5c85d84a62a68f7b62e6441e8a83756d0d SHA1 38ead642d506c8340487c44fe20d414edb7f7b16 SHA256 830d5075c7f5cb6e080a34f2e04be2e536c96520102a21108676536f947e5ed5 @@ -27,14 +29,18 @@ EBUILD uclibc-0.9.28.1.ebuild 14075 RMD160 5544fbd4a358e30454b1ebc2de3590d76430d MD5 7d5a8140274e1aa663a40ac5a1d3e359 uclibc-0.9.28.1.ebuild 14075 RMD160 5544fbd4a358e30454b1ebc2de3590d76430d884 uclibc-0.9.28.1.ebuild 14075 SHA256 1aceee354b3b7056af6967904c78d0d32b63597db56b3a063f350f5581dca93b uclibc-0.9.28.1.ebuild 14075 +EBUILD uclibc-0.9.28.3.ebuild 14107 RMD160 e75027f76cad2005a2ff8f64581234200a3076c5 SHA1 49b04e00cda429f093d72da3ebe5ea9f5a203210 SHA256 b05265264499560f0ae00df11762e0c45044858f577a1b5d954e6543d154a161 +MD5 c3a8b1ed49aa54840ee9191ab7c527b0 uclibc-0.9.28.3.ebuild 14107 +RMD160 e75027f76cad2005a2ff8f64581234200a3076c5 uclibc-0.9.28.3.ebuild 14107 +SHA256 b05265264499560f0ae00df11762e0c45044858f577a1b5d954e6543d154a161 uclibc-0.9.28.3.ebuild 14107 EBUILD uclibc-0.9.28.ebuild 14027 RMD160 976d669db31c071e60ca44bd2f37107e8b3642a3 SHA1 eb86b00811ab2a99e740787216f9853422f5fb87 SHA256 f0fb5bdb7cac67f05b94be0417c5522846153622d2fea21aba5f695f2897eb54 MD5 76353aef0949a0be72910995e1f945d7 uclibc-0.9.28.ebuild 14027 RMD160 976d669db31c071e60ca44bd2f37107e8b3642a3 uclibc-0.9.28.ebuild 14027 SHA256 f0fb5bdb7cac67f05b94be0417c5522846153622d2fea21aba5f695f2897eb54 uclibc-0.9.28.ebuild 14027 -MISC ChangeLog 10817 RMD160 b1e1f9572ec1cc575a0628b3eed57a2792cdb709 SHA1 c036b7cd9a5528bd003752228beacf48b1abad5a SHA256 a5ede6597c6098414184911755ede96b0036273d59318036f6ca56c378da84c8 -MD5 7906c0e6c7a46ffbd328972e72cf7c24 ChangeLog 10817 -RMD160 b1e1f9572ec1cc575a0628b3eed57a2792cdb709 ChangeLog 10817 -SHA256 a5ede6597c6098414184911755ede96b0036273d59318036f6ca56c378da84c8 ChangeLog 10817 +MISC ChangeLog 10956 RMD160 8e1e0057a7c49031b802050d4ab00377b434b9cb SHA1 e9e4fc1773dd0f0eed520f6d35a7cccdd92db8f9 SHA256 1338e818a8c2e34716f60c9e36b93efca2872dd8b69db8f4500cb4e26ac6d9f9 +MD5 28a6789d264691cdd2edc2126ebd167d ChangeLog 10956 +RMD160 8e1e0057a7c49031b802050d4ab00377b434b9cb ChangeLog 10956 +SHA256 1338e818a8c2e34716f60c9e36b93efca2872dd8b69db8f4500cb4e26ac6d9f9 ChangeLog 10956 MISC metadata.xml 999 RMD160 8367607c1e522c03d21a0f0ce68b316d42bd08cb SHA1 0433f3a405603e702c155ec67f67cb95bf628a1c SHA256 0be91c12da3e7c119ee885d360c0e983a69f0141614902bb2de6c54c08d4c56c MD5 e96b4dfc373a1cdf7735aeae52c4cf7e metadata.xml 999 RMD160 8367607c1e522c03d21a0f0ce68b316d42bd08cb metadata.xml 999 @@ -54,10 +60,13 @@ SHA256 be46d5d046c8d03c95eaadd3ab8ae6fddb65837b2ed811168f889aee985874c1 files/di MD5 a9495d1b9fd5a4be3096169705152271 files/digest-uclibc-0.9.28.1 789 RMD160 2a435ff3c43b4f82277b41451dd9962f428ec7ad files/digest-uclibc-0.9.28.1 789 SHA256 4c2d85bf4fc8a85c50c4890041d9874dbd280f2da1c988782be2bd87b0717c81 files/digest-uclibc-0.9.28.1 789 +MD5 38b215797e74a23be7a953799554d464 files/digest-uclibc-0.9.28.3 789 +RMD160 43d6edcfaf3e9566e8134fb6958924c14ace742a files/digest-uclibc-0.9.28.3 789 +SHA256 70be88af804ec2642625ef9d0ef0feed1f6eaddaa08a3134bdb4640b83ddce8d files/digest-uclibc-0.9.28.3 789 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.2 (GNU/Linux) +Version: GnuPG v2.0.3 (GNU/Linux) -iD8DBQFF1SVmAiZjviIA2XgRApqzAJ9Pi8F59SmlLEKf0847oO+0xiYFYgCfX90g -OODzzRH2BxVFx0JZ6Q0EVoY= -=hPwr +iD8DBQFGBpH78bi6rjpTunYRAv4rAKDcMb/EL4+Jexe6QneVo9ZEn7t6pACfby21 +KQ078BdDMiAN4iMgie0hHQo= +=xSHa -----END PGP SIGNATURE----- diff --git a/sys-libs/uclibc/files/digest-uclibc-0.9.28.3 b/sys-libs/uclibc/files/digest-uclibc-0.9.28.3 new file mode 100644 index 000000000000..0448d28d8173 --- /dev/null +++ b/sys-libs/uclibc/files/digest-uclibc-0.9.28.3 @@ -0,0 +1,9 @@ +MD5 16700ec373e17f63a96a4f27259e0460 uClibc-0.9.28.3-patches-1.0.tar.bz2 16079 +RMD160 2224a7b826932fcd5c96a0bddb30fcfa4173de35 uClibc-0.9.28.3-patches-1.0.tar.bz2 16079 +SHA256 c432d869fc3e8a4e2137541e8a1ab93e7d634387d9ca5131842721f4b080b72e uClibc-0.9.28.3-patches-1.0.tar.bz2 16079 +MD5 428405a36b4662980d9343b32089b5a6 uClibc-0.9.28.3.tar.bz2 1795383 +RMD160 61591281f4193d4dcd0fa3252fb3286028d4cb63 uClibc-0.9.28.3.tar.bz2 1795383 +SHA256 1d86d5dad6060e7057cfe023ffc7b7661bdc7fe95112b37447851c0a75b547a1 uClibc-0.9.28.3.tar.bz2 1795383 +MD5 d75b2239b4e27c3c9cbed1c8f6eabba6 uClibc-locale-030818.tgz 236073 +RMD160 8e3f4b20b94e07e535cbbbe81287186014c5f151 uClibc-locale-030818.tgz 236073 +SHA256 c4362be318a38f18d98dccf462d22d95bab92f05548bb93f65298fe9afaebd57 uClibc-locale-030818.tgz 236073 diff --git a/sys-libs/uclibc/uclibc-0.9.28.3.ebuild b/sys-libs/uclibc/uclibc-0.9.28.3.ebuild new file mode 100644 index 000000000000..b88b02e73838 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.28.3.ebuild @@ -0,0 +1,450 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.28.3.ebuild,v 1.1 2007/03/25 15:14:30 vapier Exp $ + +#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc" +#inherit subversion +inherit eutils flag-o-matic toolchain-funcs + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +# Handle the case where we want uclibc on glibc ... +if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc ]] ; then + export UCLIBC_AND_GLIBC="sitting in a tree" + export CTARGET=${CHOST%%-*}-pc-linux-uclibc +fi + +MY_P=uClibc-${PV} +SVN_VER="" +PATCH_VER="1.0" +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +SRC_URI="mirror://kernel/linux/libs/uclibc/${MY_P}.tar.bz2 + http://uclibc.org/downloads/${MY_P}.tar.bz2 + nls? ( !userlocales? ( pregen? ( + x86? ( http://www.uclibc.org/downloads/uClibc-locale-030818.tgz ) + ) ) )" +[[ -z ${SVN_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2" +[[ -z ${PATCH_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2" + +LICENSE="LGPL-2" +[[ ${CTARGET} != ${CHOST} ]] \ + && SLOT="${CTARGET}" \ + || SLOT="0" +KEYWORDS="-* ~arm ~m68k -mips ~ppc ~sh ~sparc x86" +IUSE="build uclibc-compat debug hardened iconv ipv6 minimal nls pregen savedconfig userlocales wordexp" +RESTRICT="nostrip" + +RDEPEND="" +if [[ ${CTARGET} == ${CHOST} ]] ; then + DEPEND="virtual/os-headers app-misc/pax-utils" + PROVIDE="virtual/libc" +else + DEPEND="" +fi + +S=${WORKDIR}/${MY_P} + +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \ + || [[ -n ${UCLIBC_AND_GLIBC} ]] + then + echo /usr + else + echo /usr/${CTARGET}/usr + fi +} +just_headers() { + use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]] +} + +uclibc_endian() { + printf "#include \n#if __BYTE_ORDER == __LITTLE_ENDIAN\nlittle\n#else\nbig\n#endif\n" \ + | $(tc-getCPP ${CTARGET}) - \ + | tail -n 1 +} + +pkg_setup() { + just_headers && return 0 + has_version ${CATEGORY}/uclibc || return 0 + [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0 + [[ ${ROOT} != "/" ]] && return 0 + [[ ${CATEGORY} == cross-* ]] && return 0 + + if ! built_with_use --missing false ${CATEGORY}/uclibc nls && use nls && ! use pregen ; then + eerror "You previously built uclibc with USE=-nls." + eerror "You cannot generate locale data with this" + eerror "system. Please rerun emerge with USE=pregen." + die "host cannot support locales" + elif built_with_use --missing false ${CATEGORY}/uclibc nls && ! use nls ; then + eerror "You previously built uclibc with USE=nls." + eerror "Rebuilding uClibc with USE=-nls will prob" + eerror "destroy your system." + die "switching from nls is baaaad" + fi +} + +PIE_STABLE="arm mips ppc x86" + +CPU_ALPHA="" +CPU_AMD64="" +CPU_ARM="GENERIC_ARM ARM{610,710,720T,920T,922T,926T,_{SA110,SA1100,XSCALE}}" +CPU_IA64="" +CPU_M68K="" +CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}}" +CPU_PPC="" +CPU_SH="SH{2,3,4,5}" +CPU_SPARC="" +CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" +IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" + +check_cpu_opts() { + local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" + [[ -z ${!cpu_var} ]] && return 0 + + if [[ -z ${UCLIBC_CPU} ]] ; then + ewarn "You really should consider setting UCLIBC_CPU" + ewarn "Otherwise, the build will be generic (read: slow)." + ewarn "Available CPU options:" + UCLIBC_CPU=$(eval echo ${!cpu_var}) + echo ${UCLIBC_CPU} + case ${CTARGET} in + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + *) export UCLIBC_CPU=${UCLIBC_CPU%% *};; + esac + else + local cpu found=0 + for cpu in $(eval echo ${!cpu_var}) ; do + [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break + done + if [[ ${found} -eq 0 ]] ; then + ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" + ewarn "Valid choices:" + eval echo ${!cpu_var} + die "pick a supported cpu type" + fi + fi +} + +src_unpack() { + [[ -n ${ESVN_REPO_URI} ]] \ + && subversion_src_unpack \ + || unpack ${A} + cd "${S}" + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## PATCHES ########## + + [[ -n ${SVN_VER} ]] && \ + epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch + + if [[ -n ${PATCH_VER} ]] ; then + unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2 + EPATCH_SUFFIX="patch" + epatch "${WORKDIR}"/patch + # math functions (sinf,cosf,tanf,atan2f,powf,fabsf,copysignf,scalbnf,rem_pio2f) + cp "${WORKDIR}"/patch/math/libm/* "${S}"/libm/ || die + epatch "${WORKDIR}"/patch/math + fi + + ########## CPU SELECTION ########## + + local target config_target + case $(tc-arch) in + alpha) target="alpha"; config_target="no cpu-specific options";; + amd64) target="x86_64"; config_target="no cpu-specific options";; + arm) target="arm"; config_target="GENERIC_ARM";; + ia64) target="ia64"; config_target="no cpu-specific options";; + m68k) target="m68k"; config_target="no cpu-specific options";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc"; config_target="no cpu-specific options";; + sh) target="sh"; config_target="SH4";; + sparc) target="sparc"; config_target="no cpu-specific options";; + x86) target="i386"; config_target="GENERIC_386";; + *) die "$(tc-arch) lists no defaults :/";; + esac + sed -i -e "s:default TARGET_i386:default TARGET_${target}:" \ + extra/Configs/Config.in + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} + + ########## CONFIG SETUP ########## + + make defconfig >/dev/null || die "could not config" + + for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do + sed -i -e "s:${def}=y:# ${def} is not set:" .config + done + if use debug ; then + #echo "SUPPORT_LD_DEBUG_EARLY=y" >> .config + echo "SUPPORT_LD_DEBUG=y" >> .config + echo "DODEBUG=y" >> .config + #echo "DODEBUG_PT=y" >> .config + fi + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + echo "ARCH_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN=y" >> .config + + if [[ $(tc-is-softfloat) != "no" ]] ; then + sed -i -e '/^HAS_FPU=y$/d' .config + echo 'HAS_FPU=n' >> .config + fi + + local moredefs="DL_FINI_CRT_COMPAT" + # We need todo this for a few months. .28 is a major upgrade. + # Don't do it from cross-compiling case though + if ! use uclibc-compat ; then + if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \ + ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then + local fnames="" + einfo "Doing a scanelf in paths for bins containing the __uClibc_start_main symbol" + fnames=$(scanelf -pyqs__uClibc_start_main -F%F#s) + if [[ -z ${fnames} ]] ; then + einfo "This system is clean." + einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1" + moredefs="" + else + ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled." + ewarn "qfile ${fnames}" + echo + ewarn "Leaving on ${moredefs}" + fi + else + moredefs="" + fi + fi + 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 + sed -i -e "s:# ${def} is not set:${def}=y:" .config + done + echo "UCLIBC_HAS_FULL_RPC=y" >> .config + echo "PTHREADS_DEBUG_SUPPORT=y" >> .config + echo "UCLIBC_HAS_TZ_FILE_READ_MANY=n" >> .config + + if use iconv ; then + sed -i -e "s:# UCLIBC_HAS_LOCALE is not set:UCLIBC_HAS_LOCALE=y:" .config + echo "UCLIBC_HAS_XLOCALE=n" >> .config + echo "UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y" >> .config + echo "UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y" >> .config + + if use nls ; then + echo "UCLIBC_HAS_GETTEXT_AWARENESS=y" >> .config + else + echo "UCLIBC_HAS_GETTEXT_AWARENESS=n" >> .config + fi + + if use pregen ; then + echo "UCLIBC_PREGENERATED_LOCALE_DATA=y" >> .config + echo "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y" >> .config + if use userlocales ; then + cp "${DISTDIR}"/${MY_P}-user-locale.tar.gz \ + extra/locale/uClibc-locale-030818.tgz \ + || die "could not copy ${MY_P}-user-locale.tar.gz" + else + cp "${DISTDIR}"/${MY_P}-$(tc-arch)-full-locale.tar.gz \ + extra/locale/uClibc-locale-030818.tgz \ + || die "could not copy locale" + fi + else + echo "UCLIBC_PREGENERATED_LOCALE_DATA=n" >> .config + fi + else + echo "UCLIBC_HAS_LOCALE=n" >> .config + fi + + use ipv6 && sed -i -e "s:# UCLIBC_HAS_IPV6 is not set:UCLIBC_HAS_IPV6=y:" .config + + # uncomment if you miss wordexp (alsa-lib) + use wordexp && sed -i -e "s:# UCLIBC_HAS_WORDEXP is not set:UCLIBC_HAS_WORDEXP=y:" .config + + # we need to do it independently of hardened to get ssp.c built into libc + sed -i -e "s:# UCLIBC_SECURITY.*:UCLIBC_SECURITY=y:" .config + echo "UCLIBC_HAS_SSP=y" >> .config + echo "SSP_USE_ERANDOM=n" >> .config + echo "PROPOLICE_BLOCK_ABRT=n" >> .config + if use debug ; then + echo "PROPOLICE_BLOCK_SEGV=y" >> .config + echo "PROPOLICE_BLOCK_KILL=n" >> .config + else + echo "PROPOLICE_BLOCK_SEGV=n" >> .config + echo "PROPOLICE_BLOCK_KILL=y" >> .config + fi + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + # relro could be also moved out of hardened + if has $(tc-arch) x86 ; then + echo "UCLIBC_BUILD_NOEXECSTACK=y" >> .config + else + echo "UCLIBC_BUILD_NOEXECSTACK=n" >> .config + fi + echo "UCLIBC_BUILD_RELRO=y" >> .config + if use hardened ; then + if has $(tc-arch) ${PIE_STABLE} ; then + echo "UCLIBC_BUILD_PIE=y" >> .config + else + echo "UCLIBC_BUILD_PIE=n" >> .config + fi + echo "SSP_QUICK_CANARY=n" >> .config + echo "UCLIBC_BUILD_SSP=y" >> .config + echo "UCLIBC_BUILD_NOW=y" >> .config + else + echo "UCLIBC_BUILD_PIE=n" >> .config + echo "SSP_QUICK_CANARY=y" >> .config + echo "UCLIBC_BUILD_SSP=n" >> .config + echo "UCLIBC_BUILD_NOW=n" >> .config + fi + + # Allow users some custom control over the config + if use savedconfig ; then + for conf in ${PN}-${PV}-${PR} ${PN}-${PV} ${PN}; do + configfile=${ROOT}/etc/${PN}/${CTARGET}/${conf}.config + einfo "Checking existence of ${configfile} ..." + [[ -r ${configfile} ]] || configfile=/etc/${PN}/${CHOST}/${conf}.config + if [[ -r ${configfile} ]] ; then + cp "${configfile}" "${S}"/.config + einfo "Found your ${configfile} and using it." + einfo "Note that this feature is *totally unsupported*." + break + fi + done + fi + + # setup build and run paths + local cross=${CTARGET}- + type -p ${cross}ar > /dev/null || cross="" + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \ + -e "/^KERNEL_SOURCE/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + .config || die + + yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig" + + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" +} + +setup_locales() { + cd "${S}"/extra/locale + if use userlocales && [[ -f ${ROOT}/etc/locales.build ]] ; then + :; + elif use minimal ; then + find ./charmaps -name ASCII.pairs > codesets.txt + find ./charmaps -name ISO-8859-1.pairs >> codesets.txt + cat <<-EOF > locales.txt + @euro e + UTF-8 yes + 8-bit yes + en_US ISO-8859-1 + en_US.UTF-8 UTF-8 + EOF + else + find ./charmaps -name '*.pairs' > codesets.txt + cp LOCALES locales.txt + fi + cd - +} + +src_compile() { + cp myconfig .config + + emake headers || die "make headers failed" + just_headers && return 0 + + if use iconv && ! use pregen ; then + cd extra/locale + make clean || die "make locale clean failed" + setup_locales + emake || die "make locales failed" + cd ../.. + fi + + emake || die "make failed" + [[ ${CTARGET} != ${CHOST} ]] && return 0 + + if [[ ${CHOST} == *-uclibc ]] ; then + emake utils || die "make utils failed" + fi +} + +src_test() { + [[ ${CHOST} != ${CTARGET} ]] && return 0 + [[ ${CBUILD} != ${CHOST} ]] && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + make UCLIBC_ONLY=1 check || die "test failed" +} + +src_install() { + local sysroot=${D} + [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}" + + local target="install" + just_headers && target="install_dev" + make DESTDIR="${sysroot}" ${target} || die "install failed" + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # Make sure we install the sys-include symlink so that when + # we build a 2nd stage cross-compiler, gcc finds the target + # system headers correctly. See gcc/doc/gccinstall.info + if [[ ${CTARGET} != ${CHOST} ]] ; then + dosym usr/include /usr/${CTARGET}/sys-include + return 0 + fi + + if [[ ${CHOST} == *-uclibc ]] ; then + make DESTDIR="${D}" install_utils || die "install-utils failed" + dobin extra/scripts/getent + fi + + if ! use build ; then + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 + doman docs/man/*.[1-9] + fi +} + +pkg_postinst() { + [[ ${CTARGET} != ${CHOST} ]] && return 0 + [[ ${CHOST} != *-uclibc ]] && return 0 + + if [[ ! -e ${ROOT}/etc/TZ ]] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + + if [[ ${ROOT} == "/" ]] ; then + # update cache before reloading init + /sbin/ldconfig + # reload init ... + [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null + fi +} -- 2.26.2